SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2305.04684 · 2023

ASDL: A Unified Interface for Gradient Preconditioning in PyTorch

arXiv · PDF · Open in the Atlas

Code that ran

7 of 11 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, 0 violated it and 7 have no contract verdict; 0 failures of our instrument; 4 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/2305.04684.json · badge: /api/ran/2305.04684.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
kazukiosawa/asdfghjkl community (classifier label)
classifier basis not recorded on the link
7 ran · 4 no recorded run
FunctionStatusWhere it lives
data_loader_gradient Ran
ran on a synthesized input
kazukiosawa/asdfghjkl/asdl/gradient.py
code served (permissive licence) · get_code("ab495f0a55df1c5e")
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 float, 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 torch.nn as nn
import torch.distributed as dist
from torch.utils.data import DataLoader, TensorDataset

torch.manual_seed(0)

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

# Create model instance
model = SimpleModel()

# Create a loss function
loss_fn = nn.MSELoss()

# Create a simple data loader with tiny tensors
inputs = torch.randn(2, 4)  # batch_size=2, input_dim=4
targets = torch.randn(2, 3)  # batch_size=2, output_dim=3
dataset = TensorDataset(inputs, targets)
data_loader = DataLoader(dataset, batch_size=2)

# Build ARGS dict with all parameters
ARGS = {
    "model": model,
    "loss_fn": loss_fn,
    "data_loader": data_loader,
    "is_distributed": False,
    "all_reduce": False,
    "is_master": True,
    "data_average": True,
}
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 float, 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
get_n_cols_by_tril Ran
ran on a synthesized input
kazukiosawa/asdfghjkl/asdl/symmatrix.py
code served (permissive licence) · get_code("57afc790c255271a")
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
import numpy as np

torch.manual_seed(0)

# The function expects a 1D tensor representing the lower triangular part of a matrix
# For a matrix with n columns, the lower triangular part has n*(n+1)/2 elements
# Let's create a valid lower triangular tensor with 10 elements
# This corresponds to a 4x4 matrix since 4*5/2 = 10

tril_tensor = torch.randn(10)

ARGS = {
    "tril": tril_tensor
}
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 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
im2col_2d Ran
ran on a synthesized input
kazukiosawa/asdfghjkl/asdl/utils.py
code served (permissive licence) · get_code("81ebbd081c0756f2")
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 (2, 36, 64) 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 import nn

torch.manual_seed(0)

# Create a small input tensor: (batch=2, channels=4, height=8, width=8)
x = torch.randn(2, 4, 8, 8)

# Create a Conv2d module with specific parameters
# kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), dilation=(1, 1)
conv2d = nn.Conv2d(
    in_channels=4,
    out_channels=16,
    kernel_size=(3, 3),
    stride=(1, 1),
    padding=(1, 1),
    dilation=(1, 1)
)

ARGS = {
    'x': x,
    'conv2d': conv2d
}
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 (2, 36, 64) — shape (2, 36, 64) 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
im2col_2d_slow Ran
ran on a synthesized input
kazukiosawa/asdfghjkl/asdl/utils.py
code served (permissive licence) · get_code("73326303496c3144")
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 (2, 27, 20) 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 import nn

torch.manual_seed(0)

# Create a small input tensor: batch=2, channels=3, height=4, width=5
x = torch.randn(2, 3, 4, 5)

# Create a Conv2d module with specific parameters
conv2d = nn.Conv2d(
    in_channels=3,
    out_channels=8,
    kernel_size=(3, 3),
    stride=1,
    padding=1,
    dilation=1
)

ARGS = {
    'x': x,
    'conv2d': conv2d
}
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 (2, 27, 20) — shape (2, 27, 20) 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
matrix_to_tril Ran
ran on a synthesized input
kazukiosawa/asdfghjkl/asdl/symmatrix.py
code served (permissive licence) · get_code("75827a0fc45e1c0f")
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 1, dtype family float, shape (9,) 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 2D tensor to test matrix_to_tril
# Using distinct dimensions (4x3) for clarity
mat = torch.tensor([
    [1.0, 2.0, 3.0],
    [4.0, 5.0, 6.0],
    [7.0, 8.0, 9.0],
    [10.0, 11.0, 12.0]
], dtype=torch.float32)

ARGS = {
    "mat": mat
}
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 1, dtype family float, shape (9,) — shape (9,) 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
original_requires_grad Ran
ran on a synthesized input
kazukiosawa/asdfghjkl/asdl/utils.py
code served (permissive licence) · get_code("e918e426cd1158c2")
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 torch.nn as nn

torch.manual_seed(0)

# Create a simple module with a parameter
class SimpleModule(nn.Module):
    def __init__(self):
        super().__init__()
        self.weight = nn.Parameter(torch.randn(4, 3))

module = SimpleModule()

# Set the _original_requires_grad attribute on the parameter
param = module.weight
param._original_requires_grad = True

# Create a standalone parameter for testing the param argument
standalone_param = nn.Parameter(torch.randn(2, 2))
standalone_param._original_requires_grad = False

ARGS = {
    'module': module,
    'param_name': 'weight',
    'param': None
}
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
tril_to_matrix Ran
ran on a synthesized input
kazukiosawa/asdfghjkl/asdl/symmatrix.py
code served (permissive licence) · get_code("9b09609412fc50ba")
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 (3, 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 numpy as np

torch.manual_seed(0)

# Create a valid lower triangular tensor (1D)
# For a 3x3 matrix, the lower triangular has 6 elements (3+2+1)
# So we create a tensor with 6 elements
tril_tensor = torch.tensor([1.0, 2.0, 3.0, 4.0, 5.0, 6.0])

ARGS = {
    "tril": tril_tensor
}
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 (3, 3) — shape (3, 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
batch Not yet run
unverified (harvested, no recorded run)
kazukiosawa/asdfghjkl/asdl/kernel.py
code served (permissive licence) · get_code("5b6026671740e023")
How it ran

no invocation recorded.

batch_gradient Not yet run
unverified (harvested, no recorded run)
kazukiosawa/asdfghjkl/asdl/gradient.py
code served (permissive licence) · get_code("d69412bb02bf97db")
How it ran

no invocation recorded.

empirical_direct_ntk Not yet run
unverified (harvested, no recorded run)
kazukiosawa/asdfghjkl/asdl/kernel.py
code served (permissive licence) · get_code("e44e55f6487cc4a6")
How it ran

no invocation recorded.

save_batch_gradient Not yet run
unverified (harvested, no recorded run)
kazukiosawa/asdfghjkl/asdl/gradient.py
code served (permissive licence) · get_code("ba2c2aeacd748837")
How it ran

no invocation recorded.

Also present in other papers' code

Of 11 samples lifted from this paper's linked repositories, 11 carry a function identity and 0 do not. Of the 11 distinct functions with an identity, 0 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 0 later) and 11 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.

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

Gradient preconditioning is a key technique to integrate the second-order information into gradients for improving and extending gradient-based learning algorithms. In deep learning, stochasticity, nonconvexity, and high dimensionality lead to a wide variety of gradient preconditioning methods, with implementation complexity and inconsistent performance and feasibility. We propose the Automatic Second-order Differentiation Library (ASDL), an extension library for PyTorch, which offers various implementations and a plug-and-play unified interface for gradient preconditioning. ASDL enables the study and structured comparison of a range of gradient preconditioning methods.

For agents

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

get_harvested_code_for_paper("2305.04684")
get_code_for_paper("2305.04684")
have("2305.04684")

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

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

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

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

Connect an agent — have() is free.