SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2305.02299 · ICLR · 2024

Dynamic Sparse Training with Structured Sparsity

Yani Ioannou, Utku Evci, Mike Lasby, Anna Golubeva, Mihai Nica

arXiv · PDF · Open in the Atlas

Code that ran

8 of 10 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 1 honoured the contract we drafted, 0 violated it and 7 have no contract verdict; 0 failures of our instrument; 2 no recorded run), measured 2026-11-23; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2305.02299.json · badge: /api/ran/2305.02299.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
calgaryml/condensed-sparsity canonical (classifier label)
classifier basis: census
8 ran · 2 no recorded run
FunctionStatusWhere it lives
collate Ran
ran on a synthesized input
calgaryml/condensed-sparsity/src/rigl_torch/datasets/_coco_detection_v2.py
code served (permissive licence) · get_code("ffc9a12b2490e5ad")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

torch.manual_seed(0)

# The collate function takes a batch parameter and unpacks it with zip(*batch)
# This is a typical PyTorch collate_fn pattern where batch is a list of tuples
# Each tuple should contain corresponding elements that will be zipped together

# Create a simple batch: list of (x, y) tuples
batch = [
    (torch.randn(2, 4), torch.tensor([0])),
    (torch.randn(2, 4), torch.tensor([1])),
]

ARGS = {
    "batch": batch
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple — a tuple output has no array shape of its own; none is stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
collate_fn Ran
ran, honoured the contract we drafted
calgaryml/condensed-sparsity/src/rigl_torch/datasets/_coco.py
code served (permissive licence) · get_code("90fadec0aec03c1b")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned tuple. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

torch.manual_seed(0)

# The collate_fn function takes a batch parameter and unpacks it using zip(*batch)
# This is typically used with a DataLoader where batch is a list of samples
# Each sample should be a tuple/list of elements that can be zipped together

# Create a simple batch of data
# Each item in the batch is a tuple of (input, target)
batch = [
    (torch.randn(4, 3), torch.tensor([1, 0, 1, 0])),
    (torch.randn(4, 3), torch.tensor([0, 1, 0, 1])),
]

ARGS = {
    "batch": batch
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple — a tuple output has no array shape of its own; none is stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
forward_sparsity_single Ran
ran on a synthesized input
calgaryml/condensed-sparsity/src/condensed_sparsity/condensed_linear.py
code served (permissive licence) · get_code("f1cb6ce89b53ffe9")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Tensor, ndim 2, dtype family float, shape (2, 4) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

torch.manual_seed(0)

# Create a small input tensor with shape (batch=2, dim=4)
input_tensor = torch.randn(2, 4)

# Create weights tensor - will be used to multiply selected elements
# Should have the same shape as input[indices]
weights = torch.randn(2, 4)

# Create indices tensor that selects rows from input
# LongTensor with shape (2,) to select 2 rows
indices = torch.LongTensor([0, 1])

ARGS = {
    "input": input_tensor,
    "weights": weights,
    "indices": indices,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 2, dtype family float, shape (2, 4) — shape (2, 4) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
get_conv_output_size Ran
ran on a synthesized input
calgaryml/condensed-sparsity/src/micronet_challenge/counting.py
code served (permissive licence) · get_code("3654bf74d0f7f041")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned int, ndim 0, dtype family int, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np

ARGS = {
    'image_size': 32,
    'filter_size': 5,
    'padding': 'same',
    'stride': 1
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type int, ndim 0, dtype family int, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
get_flops_per_activation Ran
ran on a synthesized input
calgaryml/condensed-sparsity/src/micronet_challenge/counting.py
code served (permissive licence) · get_code("4b82fc73fa17da12")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple, ndim 1, dtype family int; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np

# The function get_flops_per_activation takes a single parameter: activation (str)
# It checks the activation type and returns a tuple of (n_muls, n_adds)
# No complex objects needed - just a string parameter

ARGS = {
    'activation': 'relu'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 1, dtype family int — a tuple output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
get_sparse_size Ran
ran on a synthesized input
calgaryml/condensed-sparsity/src/micronet_challenge/counting.py
code served (permissive licence) · get_code("2bcd7c08957f4644")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned float64, ndim 0, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np

ARGS = {
    "tensor_shape": [4, 3, 2],
    "param_bits": 8,
    "sparsity": 0.5
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type float64, ndim 0, dtype family float — no output shape is stated: observe_signature.py recorded float ndim 0, which disagrees with the fixture run
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
set_seed Ran
ran on a synthesized input
calgaryml/condensed-sparsity/train_rigl.py
code served (permissive licence) · get_code("3cdc178d93c08dbe")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned DictConfig. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import pytorch_lightning as pl
import random
import omegaconf
import logging
import torch

# Create a minimal OmegaConf DictConfig with the required structure
cfg = omegaconf.DictConfig({
    'training': {
        'seed': None
    }
})

ARGS = {
    'cfg': cfg
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
omegaconf, pytorch_lightning, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type DictConfig — a DictConfig output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a DictConfig output the recorded ndim 1 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
structured_condensed_conv2d_factory Ran
ran on a synthesized input
calgaryml/condensed-sparsity/src/condensed_sparsity/condensed_linear.py
code served (permissive licence) · get_code("6204181691c991bc")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Conv2d. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

torch.manual_seed(0)

# Create a small Conv2d module with some weights
# The function will filter out inactive neurons (those with all-zero weights)
module = nn.Conv2d(in_channels=3, out_channels=4, kernel_size=3, bias=True)

# Modify weights so some neurons are inactive (all zeros)
with torch.no_grad():
    module.weight[1] = 0  # Make neuron 1 inactive
    module.weight[3] = 0  # Make neuron 3 inactive
    module.bias[1] = 0
    module.bias[3] = 0

def custom_weight_getter(module: nn.Module, attr_name: str = 'weight') -> torch.Tensor:
    return getattr(module, attr_name)

ARGS = {
    'module': module,
    'weight_getter': custom_weight_getter,
    'dtype': torch.float32
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Conv2d — a Conv2d output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Conv2d output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
forward_sparsity_v Not yet run
unverified (harvested, no recorded run)
calgaryml/condensed-sparsity/src/condensed_sparsity/condensed_linear.py
code served (permissive licence) · get_code("a094e0de1437a438")
How it ran

no invocation recorded.

test Not yet run
unverified (harvested, no recorded run)
calgaryml/condensed-sparsity/train_rigl.py
code served (permissive licence) · get_code("e62b6d8b58cd26a5")
How it ran

no invocation recorded.

Also present in other papers' code

Of 10 samples lifted from this paper's linked repositories, 10 carry a function identity and 0 do not. Of the 10 distinct functions with an identity, 1 are also present in other papers whose code we hold (1 with at least one paper dated earlier, 0 the same month, 1 later) and 9 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

FunctionAlso present inEarliest-datedOthers named
collate_fn 7 other papers
4 dated earlier, 3 later
1405.0312 (2014-05)
Microsoft COCO: Common Objects in Context
1811.10200 (2018-11)
IDD: A Dataset for Exploring Problems of Autonomous Navigation in Unconstrained Environments
1901.07973 (2019-01)
DeepFashion2: A Versatile Benchmark for Detection, Pose Estimation, Segmentation and Re-Identification of Clothing Images
and 4 more not named here

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-23.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

Dynamic Sparse Training (DST) methods achieve state-of-the-art results in sparse neural network training, matching the generalization of dense models while enabling sparse training and inference. Although the resulting models are highly sparse and theoretically less computationally expensive, achieving speedups with unstructured sparsity on real-world hardware is challenging. In this work, we propose a sparse-to-sparse DST method, Structured RigL (SRigL), to learn a variant of fine-grained structured N:M sparsity by imposing a constant fan-in constraint. Using our empirical analysis of existing DST methods at high sparsity, we additionally employ a neuron ablation method which enables SRigL to achieve state-of-the-art sparse-to-sparse structured DST performance on a variety of Neural Network (NN) architectures. Using a 90% sparse linear layer, we demonstrate a real-world acceleration of 3.4×/2.5× on CPU for online inference and 1.7×/13.0× on GPU for inference with a batch size of 256 when compared to equivalent dense/unstructured (CSR) sparse layers, respectively.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2305.02299")
get_code_for_paper("2305.02299")
have("2305.02299")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2305.02299.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2305.02299.svg)](https://syntology.ai/paper/2305.02299)

Connect an agent — have() is free.