SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2303.09736 · AAAI · 2023

Dynamic Structure Pruning for Compressing CNNs

Junho Kim, Yeachan Kim, Jun-Hyung Park, Sangkeun Lee, Joon-Young Choi

arXiv · PDF · Open in the Atlas

Code that ran

7 of 8 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (2 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 1 violated it and 4 have no contract verdict; 2 failures of our instrument; 1 no recorded run), measured 2026-11-22; 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/2303.09736.json · badge: /api/ran/2303.09736.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
pytorch/examples canonical (classifier label)
classifier basis not recorded on the link
5 ran · 1 no recorded run
irishev/DSP community
Papers with Code archive
2 ran · 0 no recorded run
FunctionStatusWhere it lives
GroupWrapper Ran
ran on a synthesized input · constructed an object; no result was computed
irishev/DSP/dsp_module.py
code served (permissive licence) · get_code("3cf9a1367bf5bda7")
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 an instance of its own class, GroupWrapper: the run constructed the object and did not call it, so no result was computed. The image it ran in was not recorded. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is 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)

# Build a minimal model with Conv2d layers
class SimpleModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.conv1 = nn.Conv2d(3, 8, kernel_size=3, padding=1)
        self.conv2 = nn.Conv2d(8, 16, kernel_size=3, padding=1)
        self.downsample = nn.Conv2d(16, 16, kernel_size=1)
        self.conv3 = nn.Conv2d(16, 32, kernel_size=3, padding=1)
    
    def forward(self, x):
        x = self.conv1(x)
        x = self.conv2(x)
        x = self.conv3(x)
        return x

model = SimpleModel()

# Create optimizer
optimizer = torch.optim.SGD(model.parameters(), lr=0.01)

# Create criterion
criterion = nn.CrossEntropyLoss()

# Parameters for GroupWrapper
reg = 0.001
total_steps = 100
n_groups = 4
temp = 1.0
group_optimizer_lr = 0.001
rank = 0

ARGS = {
    'model': model,
    'optimizer': optimizer,
    'criterion': criterion,
    'reg': reg,
    'total_steps': total_steps,
    'n_groups': n_groups,
    'temp': temp,
    'group_optimizer_lr': group_optimizer_lr,
    'rank': rank
}
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 GroupWrapper — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a GroupWrapper 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
Hook Ran
ran on a synthesized input · constructed an object; no result was computed
irishev/DSP/dsp_module.py
code served (permissive licence) · get_code("56118d0018b611ed")
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 an instance of its own class, Hook: the run constructed the object and did not call it, so no result was computed. 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 simple convolutional module that the Hook will attach to
# The hook_fn expects:
# - module.weight with a .size() method
# - module.register_forward_hook method
# - output with .size(2) and .size(3) methods (spatial dimensions for conv output)
# - input[0] with .size() method

class SimpleConvModule(nn.Module):
    def __init__(self):
        super().__init__()
        # Create a small conv layer: in_channels=3, out_channels=4, kernel=3x3
        self.conv = nn.Conv2d(3, 4, kernel_size=3, padding=1)
    
    def forward(self, x):
        return self.conv(x)

# Instantiate the module
module = SimpleConvModule()

# Create a small input tensor: batch=2, channels=3, height=32, width=32
# This will produce output with spatial dims (32, 32) after the conv
input_tensor = torch.randn(2, 3, 32, 32)

# Test that the module works
_ = module(input_tensor)

ARGS = {
    "module": module
}
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 Hook — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a Hook 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
apply_rotary_emb Ran
ran; our contract draft was wrong, not the code
pytorch/examples/distributed/tensor_parallelism/llama2_model.py
code served (permissive licence) · get_code("468aaad299edb475")
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 5, 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 torch

torch.manual_seed(0)

# Construct tiny tensors for testing apply_rotary_emb
# xq and xk should have shape (batch, seq_len, head_dim) where head_dim is even
# freqs_cis should have shape (seq_len, head_dim//2)

batch_size = 2
seq_len = 3
head_dim = 4

# Query and key tensors: (batch, seq_len, head_dim)
xq = torch.randn(batch_size, seq_len, head_dim)
xk = torch.randn(batch_size, seq_len, head_dim)

# Frequency tensor for rotary embeddings: (seq_len, head_dim//2)
# This represents complex exponentials as real pairs
freqs_cis = torch.randn(seq_len, head_dim // 2, dtype=torch.complex64)

ARGS = {
    "xq": xq,
    "xk": xk,
    "freqs_cis": freqs_cis,
}
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, ndim 5, dtype family float — 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
assert_all_nodes_have_tags Ran
ran on a synthesized input
pytorch/examples/fx/custom_tracer.py
code served (permissive licence) · get_code("57154444b1a7a783")
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 bool, ndim 0, dtype family float, 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 torch
from torch.fx import Graph, Node

torch.manual_seed(0)

# Create a minimal Graph with nodes that have 'tag' attributes set to 'foo'
g = Graph()

# Add some nodes to the graph
node1 = g.create_node('placeholder', 'x')
node1.tag = 'foo'

node2 = g.create_node('call_function', torch.add, args=(node1, node1))
node2.tag = 'foo'

node3 = g.create_node('output', 'output', args=(node2,))
node3.tag = 'foo'

ARGS = {
    'g': g
}
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 bool, ndim 0, dtype family float, 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
f Ran
ran on a synthesized input
pytorch/examples/fx/invert.py
code served (permissive licence) · get_code("a2229a8c3bb45dd9")
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)

x = torch.randn(2, 4)

ARGS = {
    "x": x
}
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
precompute_freqs_cis Ran
ran, violated the contract we drafted
pytorch/examples/distributed/tensor_parallelism/llama2_model.py
code served (permissive licence) · get_code("ef236c5425b4e712")
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 (4, 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)

ARGS = {
    "dim": 8,
    "end": 4,
    "theta": 10000.0,
}
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 (4, 4) — shape (4, 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
reshape_for_broadcast Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
pytorch/examples/distributed/tensor_parallelism/llama2_model.py
code served (permissive licence) · get_code("42d4e74777fd43b2")
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 3, dtype family float, shape (1, 3, 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 freqs_cis tensor
# According to the assertion: freqs_cis.shape == (x.shape[1], x.shape[-1])
# Let's say x will have shape (batch=2, seq=3, ..., hidden=4)
# Then freqs_cis should have shape (3, 4)
freqs_cis = torch.randn(3, 4)

# Create x tensor
# x needs to be at least 3D (since ndim check asserts 0 <= 1 < ndim, so ndim > 1)
# Let's make it (batch=2, seq=3, hidden=4) - 3D tensor
# This satisfies: freqs_cis.shape == (x.shape[1], x.shape[-1]) == (3, 4)
x = torch.randn(2, 3, 4)

ARGS = {
    "freqs_cis": freqs_cis,
    "x": x,
}
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 3, dtype family float, shape (1, 3, 4) — shape (1, 3, 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
invert Not yet run
unverified (harvested, no recorded run)
pytorch/examples/fx/invert.py
code served (permissive licence) · get_code("f3f961a13bd98c4b")
How it ran

no invocation recorded.

Also present in other papers' code

Of 8 samples lifted from this paper's linked repositories, 8 carry a function identity and 0 do not. Of the 8 distinct functions with an identity, 3 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 3 later) and 5 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
reshape_for_broadcast 58 other papers
57 later, 1 same year, order not determinable · 2 only as an assembly brick
2023.emnlp-main.534 (2023 (year only))
Disentangling Transformer Language Models as Superposed Topic Models
2307.09288 (2023-07)
Llama 2: Open Foundation and Fine-Tuned Chat Models
2308.06595 (2023-08)
VisIT-Bench: A Benchmark for Vision-Language Instruction Following Inspired by Real-World Use
and 55 more not named here
apply_rotary_emb 55 other papers
54 later, 1 same year, order not determinable · 1 only as an assembly brick
2023.emnlp-main.534 (2023 (year only))
Disentangling Transformer Language Models as Superposed Topic Models
2307.09288 (2023-07)
Llama 2: Open Foundation and Fine-Tuned Chat Models
2308.06595 (2023-08)
VisIT-Bench: A Benchmark for Vision-Language Instruction Following Inspired by Real-World Use
and 52 more not named here
precompute_freqs_cis 47 other papers
46 later, 1 same year, order not determinable · 1 only as an assembly brick
2023.emnlp-main.534 (2023 (year only))
Disentangling Transformer Language Models as Superposed Topic Models
2307.09288 (2023-07)
Llama 2: Open Foundation and Fine-Tuned Chat Models
2308.06595 (2023-08)
VisIT-Bench: A Benchmark for Vision-Language Instruction Following Inspired by Real-World Use
and 44 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-22.

Repositories linked to this paper

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

Abstract

Structure pruning is an effective method to compress and accelerate neural networks. While filter and channel pruning are preferable to other structure pruning methods in terms of realistic acceleration and hardware compatibility, pruning methods with a finer granularity, such as intra-channel pruning, are expected to be capable of yielding more compact and computationally efficient networks. Typical intra-channel pruning methods utilize a static and hand-crafted pruning granularity due to a large search space, which leaves room for improvement in their pruning performance. In this work, we introduce a novel structure pruning method, termed as dynamic structure pruning, to identify optimal pruning granularities for intrachannel pruning. In contrast to existing intra-channel pruning methods, the proposed method automatically optimizes dynamic pruning granularities in each layer while training deep neural networks. To achieve this, we propose a differentiable group learning method designed to efficiently learn a pruning granularity based on gradient-based learning of filter groups. The experimental results show that dynamic structure pruning achieves state-of-the-art pruning performance and better realistic acceleration on a GPU compared with channel pruning. In particular, it reduces the FLOPs of ResNet50 by 71.85% without accuracy degradation on the ImageNet dataset. Our code is available at https://github.com/irishev/DSP.

For agents

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

get_harvested_code_for_paper("2303.09736")
get_code_for_paper("2303.09736")
have("2303.09736")

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

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

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

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

Connect an agent — have() is free.