SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2204.00595 · 2022

Monarch: Expressive Structured Matrices for Efficient and Accurate Training

arXiv · PDF · Open in the Atlas

Code that ran

15 of 15 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; 0 honoured the contract we drafted, 1 violated it and 13 have no contract verdict; 1 failure of our instrument; 0 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/2204.00595.json · badge: /api/ran/2204.00595.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
pascalcarrivain/ksmm community (classifier label)
classifier basis not recorded on the link
15 ran · 0 no recorded run
FunctionStatusWhere it lives
add_lines_to_instantiate_kernel_with_hp Ran
ran on a synthesized input
pascalcarrivain/ksmm/src/ksmm_py/layer/kronecker_sparse/kernel.py
code served (permissive licence) · get_code("28185b31217241b1")
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 list, ndim 1, 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)

lines_to_add = []
kernel_name = "matmul_kernel"
batch_size = 2
a = 4
b = 3
c = 5
d = 6
precision = "float"
TILEX = 32
TILEK = 16
TILEY = 16
TX = 4
TY = 4
VSIZE = 4

ARGS = {
    "lines_to_add": lines_to_add,
    "kernel_name": kernel_name,
    "batch_size": batch_size,
    "a": a,
    "b": b,
    "c": c,
    "d": d,
    "precision": precision,
    "TILEX": TILEX,
    "TILEK": TILEK,
    "TILEY": TILEY,
    "TX": TX,
    "TY": TY,
    "VSIZE": VSIZE,
}
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 list, ndim 1, dtype family float — a list 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
forward_bmm_bs_first Ran
ran on a synthesized input
pascalcarrivain/ksmm/src/ksmm_py/layer/bmm/forward_bmm.py
code served (permissive licence) · get_code("500510d20d2cda99")
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, 30) 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
import numpy as np

torch.manual_seed(0)

# Analyze the function to understand parameter requirements:
# - w_kron: shape (a*d, b, c) tensor
# - x: shape (..., a*c*d) tensor where last dim is a*c*d
# - pattern: tuple (a, b, c, d)

# Choose distinct dimensions for clarity
a, b, c, d = 2, 3, 4, 5

# Construct w_kron with shape (a*d, b, c) = (10, 3, 4)
w_kron = torch.randn(a * d, b, c)

# Construct x with batch shape and last dimension a*c*d = 40
# Use batch shape (2,) for small tensor
batch_shape = (2,)
x = torch.randn(*batch_shape, a * c * d)

# Construct pattern tuple
pattern = (a, b, c, d)

ARGS = {
    "w_kron": w_kron,
    "x": x,
    "pattern": pattern,
}
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 Tensor, ndim 2, dtype family float, shape (2, 30) — shape (2, 30) 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
forward_bmm_bs_last Ran
ran on a synthesized input
pascalcarrivain/ksmm/src/ksmm_py/layer/bmm/forward_bmm.py
code served (permissive licence) · get_code("59f540493105da3a")
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 (30, 2) 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
import numpy as np

torch.manual_seed(0)

# Analyze the function:
# - w_kron: shape (a*d, b, c) - used in bmm operation
# - x: shape (a*c*d, ...) where batch_shape is x.shape[1:]
# - pattern: tuple (a, b, c, d) unpacked and used for assertions

# The function performs:
# 1. Reshapes x from (a*c*d, ...) to (a, c, d, n) then transposes and reshapes to (a*d, c, n)
# 2. Does bmm(w_kron, x) -> (a*d, b, n)
# 3. Reshapes output to (a*b*d, ...)

# Choose small distinct values for a, b, c, d
a, b, c, d = 2, 3, 4, 5

# Create pattern
pattern = (a, b, c, d)

# w_kron shape: (a*d, b, c) = (10, 3, 4)
w_kron = torch.randn(a * d, b, c, dtype=torch.float32)

# x initial shape: (a*c*d, ...) = (40, ...)
# Let's add a batch dimension for the batch_shape part
# batch_shape = (2,) for simplicity
batch_shape = (2,)
x = torch.randn(a * c * d, *batch_shape, dtype=torch.float32)

ARGS = {
    "w_kron": w_kron,
    "x": x,
    "pattern": pattern
}
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 Tensor, ndim 2, dtype family float, shape (30, 2) — shape (30, 2) 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
forward_pass Ran
ran on a synthesized input
pascalcarrivain/ksmm/src/ksmm_py/benchmark/utils.py
code served (permissive licence) · get_code("64f5feef032ab239")
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, 3) 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
import torch.nn as nn

torch.manual_seed(0)

class SimpleModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 3)
    
    def forward(self, x):
        return self.linear(x)

model = SimpleModel()
x = torch.randn(2, 4)

ARGS = {
    "model": model,
    "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, 3) — shape (2, 3) 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
from_bmm_format_to_dense Ran
ran on a synthesized input
pascalcarrivain/ksmm/src/ksmm_py/layer/kronecker_sparse/interface.py
code served (permissive licence) · get_code("2248676f55f31017")
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 (30, 40) 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)

# Analyze the function:
# - factor: 4D tensor with shape (a, d, b, c)
# - pattern: tuple/list of 4 integers (a, b, c, d)
# The function uses factor.shape, factor.dtype, factor.device
# It iterates over factor and accesses block[:, i, j]
# It creates diagonal matrices and concatenates them

# Set distinct dimensions for clarity
a = 2
b = 3
c = 4
d = 5

# Create factor tensor with shape (a, d, b, c) = (2, 5, 3, 4)
factor = torch.randn(a, d, b, c, dtype=torch.float32)

# Create pattern tuple
pattern = (a, b, c, d)

ARGS = {
    "factor": factor,
    "pattern": pattern,
}
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 (30, 40) — shape (30, 40) 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
from_kernel_format_to_dense Ran
ran on a synthesized input
pascalcarrivain/ksmm/src/ksmm_py/layer/kronecker_sparse/interface.py
code served (permissive licence) · get_code("5889d0ad88e0d5f5")
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 (30, 40) 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)

# Analyze the function:
# - factor: a tensor that gets reshaped to (a, d, c, b) and permuted
# - pattern: a tuple (a, b, c, d) used for reshaping and indexing
# The factor tensor must have total elements = a * b * c * d
# The output dense tensor has shape (a * b * d, a * c * d)

# Let's use small distinct values:
# a=2, b=3, c=4, d=5
a, b, c, d = 2, 3, 4, 5

# factor must have a*b*c*d elements
total_elements = a * b * c * d  # 2*3*4*5 = 120
factor = torch.randn(total_elements, dtype=torch.float32)

# pattern is a tuple (a, b, c, d)
pattern = (a, b, c, d)

ARGS = {
    "factor": factor,
    "pattern": pattern,
}
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 (30, 40) — shape (30, 40) 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
generate_factor Ran
ran on a synthesized input
pascalcarrivain/ksmm/src/ksmm_py/layer/kronecker_sparse/interface.py
code served (permissive licence) · get_code("d43163d9a5d6f145")
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 (30, 40) 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
import math

torch.manual_seed(0)

ARGS = {
    'a': 2,
    'b': 3,
    'c': 4,
    'd': 5,
    'algo': 'dense',
    'weights': None,
    'dtype': torch.float16,
    'device': 'cpu',
}
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 (30, 40) — shape (30, 40) 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_input_size Ran
ran on a synthesized input
pascalcarrivain/ksmm/src/ksmm_cu/long_run.py
code served (permissive licence) · get_code("49146715588712c1")
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 torch

torch.manual_seed(0)

ARGS = {
    "a": 2,
    "b": 3,
    "c": 4,
    "d": 5,
}
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 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
is_gpu_available Ran
ran on a synthesized input
pascalcarrivain/ksmm/src/ksmm_cu/long_run.py
code served (permissive licence) · get_code("90795aa963bed427")
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
import subprocess

# The function checks if a gpu_name string is present in the output of nvidia-smi
# It takes a single parameter: gpu_name (a string)

ARGS = {
    "gpu_name": "NVIDIA GeForce RTX 3090"
}
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
is_valid_configuration_sanity_check Ran
ran on a synthesized input
pascalcarrivain/ksmm/src/ksmm_cu/long_run.py
code served (permissive licence) · get_code("f201b7609964135d")
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.

ARGS = {
    "TILEY": 24,
    "b": 48,
    "c": 3,
    "TILEX": 24,
    "TILEK": 16,
    "TX": 4,
    "TY": 8,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — 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
pair Ran
ran, violated the contract we drafted
pascalcarrivain/ksmm/src/ksmm_py/model/vit.py
code served (permissive licence) · get_code("6ba8cee9f5daea41")
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, 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

torch.manual_seed(0)

# The function 'pair' takes a single parameter 't' and returns it as a tuple if it isn't already one
# We need to test both cases: when t is a tuple and when it's not

# Case 1: t is not a tuple (e.g., an integer, string, tensor, etc.)
t_not_tuple = 5

# Case 2: t is already a tuple
t_is_tuple = (3, 7)

# We'll use the non-tuple case as the primary test
ARGS = {
    "t": t_not_tuple
}
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, 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
pattern_is_dense Ran
ran on a synthesized input
pascalcarrivain/ksmm/src/ksmm_py/benchmark/utils.py
code served (permissive licence) · get_code("8358b5b9e35e1a5f")
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
import numpy as np

torch.manual_seed(0)

# The function accesses pattern[0] and pattern[3]
# So pattern must be indexable and have at least 4 elements
# The function checks if they equal 1, so they should be numeric

# Create a pattern as a list/array with at least 4 elements
# where pattern[0] == 1 and pattern[3] == 1 for a dense pattern
pattern = [1, 0, 0, 1, 0]

ARGS = {
    "pattern": pattern
}
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 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
posemb_sincos_2d Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
pascalcarrivain/ksmm/src/ksmm_py/model/vit.py
code served (permissive licence) · get_code("17f6d223949a7e58")
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 Tensor, ndim 2, dtype family float, shape (12, 8) 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 patches tensor
# Shape: (batch, height, width, dim)
# The function unpacks this as: _, h, w, dim, device, dtype = (*patches.shape, patches.device, patches.dtype)
patches = torch.randn(2, 3, 4, 8, dtype=torch.float32)

ARGS = {
    "patches": patches,
    "temperature": 10000,
    "dtype": torch.float32,
}
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 Tensor, ndim 2, dtype family float, shape (12, 8) — shape (12, 8) 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
posemb_sincos_2d_bsl Ran
ran on a synthesized input
pascalcarrivain/ksmm/src/ksmm_py/model/vit.py
code served (permissive licence) · get_code("a076f484cbf3ed79")
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 (4, 6, 1) 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 patches tensor
# Shape: (dim, h, w, batch_size) based on how the function unpacks it
# dim must be multiple of 4, so use 4
# Use distinct sizes: 4 (dim), 3 (height), 2 (width), 1 (batch)
patchs = torch.randn(4, 3, 2, 1, dtype=torch.float32)

ARGS = {
    'patchs': patchs,
    'temperature': 10000,
    '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 Tensor, ndim 3, dtype family float, shape (4, 6, 1) — shape (4, 6, 1) 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
set_device_and_get_device_name Ran
ran on a synthesized input
pascalcarrivain/ksmm/src/ksmm_py/benchmark/utils.py
code served (permissive licence) · get_code("ab4fa31231627e50")
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 str. 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.backends.cuda

torch.manual_seed(0)

# The function uses device_id to check against torch.cuda.device_count()
# and conditionally sets CUDA device or uses CPU.
# It takes a device string ('cuda' or 'cpu') and returns a device name string.

# Since we're CPU-only, we'll use device='cpu' to avoid CUDA calls.
# device_id should be a valid integer (0 or greater).

ARGS = {
    'device_id': 0,
    'device': 'cpu'
}
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 str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str 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

Also present in other papers' code

Of 15 samples lifted from this paper's linked repositories, 15 carry a function identity and 0 do not. Of the 15 distinct functions with an identity, 2 are also present in other papers whose code we hold (2 with at least one paper dated earlier, 0 the same month, 2 later) and 13 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
pair 90 other papers
15 dated earlier, 74 later, 1 undated · 8 only as an assembly brick
2004.13649 (2020-04)
Image Augmentation Is All You Need: Regularizing Deep Reinforcement Learning from Pixels
2010.11929 (2020-10)
An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
2103.15691 (2021-03)
ViViT: A Video Vision Transformer
and 87 more not named here
posemb_sincos_2d 5 other papers
1 dated earlier, 4 later
2110.09057 (2021-10)
Training Deep Neural Networks with Adaptive Momentum Inspired by the Quadratic Optimization
2205.03990 (2022-05)
Multi-resolution partial differential equations preserved learning framework for spatiotemporal dynamics
2304.06446 (2023-04)
SpectFormer: Frequency and Attention is what you need in a Vision Transformer
and 2 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

Large neural networks excel in many domains, but they are expensive to train and fine-tune. A popular approach to reduce their compute or memory requirements is to replace dense weight matrices with structured ones (e.g., sparse, low-rank, Fourier transform). These methods have not seen widespread adoption (1) in end-to-end training due to unfavorable efficiency--quality tradeoffs, and (2) in dense-to-sparse fine-tuning due to lack of tractable algorithms to approximate a given dense weight matrix. To address these issues, we propose a class of matrices (Monarch) that is hardware-efficient (they are parameterized as products of two block-diagonal matrices for better hardware utilization) and expressive (they can represent many commonly used transforms). Surprisingly, the problem of approximating a dense weight matrix with a Monarch matrix, though nonconvex, has an analytical optimal solution. These properties of Monarch matrices unlock new ways to train and fine-tune sparse and dense models. We empirically validate that Monarch can achieve favorable accuracy-efficiency tradeoffs in several end-to-end sparse training applications: speeding up ViT and GPT-2 training on ImageNet classification and Wikitext-103 language modeling by 2x with comparable model quality, and reducing the error on PDE solving and MRI reconstruction tasks by 40%. In sparse-to-dense training, with a simple technique called "reverse sparsification," Monarch matrices serve as a useful intermediate representation to speed up GPT-2 pretraining on OpenWebText by 2x without quality drop. The same technique brings 23% faster BERT pretraining than even the very optimized implementation from Nvidia that set the MLPerf 1.1 record. In dense-to-sparse fine-tuning, as a proof-of-concept, our Monarch approximation algorithm speeds up BERT fine-tuning on GLUE by 1.7x with comparable accuracy.

For agents

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

get_harvested_code_for_paper("2204.00595")
get_code_for_paper("2204.00595")
have("2204.00595")

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

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

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

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

Connect an agent — have() is free.