| accuracy |
Ran ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT) |
cerebrasresearch/sift/ComputerVision/ImageNet/utils/imagenet_utils.py pointer only (licence: Apache-2.0); the stored copy get_code serves, from talalwasim/textguidedresilience, is pointer only (licence: NONE) · get_code("0d95e28fac98427f") How it ranThe body of this sample is withheld: this paper's link allows the body inline (Apache-2.0), but get_code serves the stored copy, first harvested from talalwasim/textguidedresilience, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded. |
| add_drop_connect_specific_args |
Ran ran on a synthesized input |
CerebrasResearch/Sparse-IFT/cbsparse/sparse/dropconnect/utils.py code served (permissive licence) · get_code("8e0b681246bf0f5c") How it ranRan 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 ArgumentParser. 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 argparse
import torch
import torch.nn as nn
torch.manual_seed(0)
# Create a minimal parent parser to pass as argument
parent_parser = argparse.ArgumentParser(add_help=False)
parent_parser.add_argument('--some_parent_arg', type=str, default='parent_value')
# Define the arguments dictionary with all parameters needed
ARGS = {
'parent_parser': parent_parser,
}
- 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 ArgumentParser — a ArgumentParser output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a ArgumentParser 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
|
| add_mask_optimizer_specific_args |
Ran ran on a synthesized input |
CerebrasResearch/Sparse-IFT/cbsparse/sparse/utils/argparse_utils.py code served (permissive licence) · get_code("3d8211706172e297") How it ranRan 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 ArgumentParser. 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 argparse
def add_mask_optimizer_specific_args(parent_parser):
parser = argparse.ArgumentParser(parents=[parent_parser], add_help=False)
parser.add_argument('--maskopt_sparsity', default=0.0, help='Final sparsity level. Either a float between (0,1) or str("from_weights")')
parser.add_argument('--maskopt_start_sparsity', type=float, default=None, help='Starting sparsity level. 0=None')
parser.add_argument('--maskopt_sparsity_sched', type=str, default='constant', help='Mask sparsity schedule. (default: constant) (options: constant, linear, cosine)')
parser.add_argument('--maskopt_sparsity_sched_start_itr', type=int, default=0, metavar='N', help='Itr at which to start sparsity sched. (default: 0)')
parser.add_argument('--maskopt_sparsity_sched_end_itr', type=int, default=None, metavar='N', help='Itr at which to end sparsity sched. (default: None = maskopt_end_iteration)')
parser.add_argument('--maskopt_begin_iteration', type=int, default=0, metavar='N', help='Itr at which to start mask updates. (default: 0)')
parser.add_argument('--maskopt_end_iteration', type=float, default=None, metavar='N', help='Itr at which to end mask updates. (default: None = 0.8 * epochs)')
parser.add_argument('--maskopt_frequency', type=int, default=100, metavar='N', help='frequency at which mask updates are made. (default: 100)')
parser.add_argument('--maskopt_drop_fraction', type=float, default=0.3, help='fraction of params to drop during mask update. (default: 0.3)')
parser.add_argument('--maskopt_drop_fraction_anneal', type=str, default='cosine', help='aneal method for maskopt_drop_fraction (default: cosine). Options are: constant, cosine, exponential_EX)')
parser.add_argument('--maskopt_mask_distribution', type=str, default='uniform', help='sparsity mask distribution. (default: erk) (options: uniform, erk, er, from_weights)')
parser.add_argument('--maskopt_mask_init_method', type=str, default='random', help='mask initialization method. (default: random) (options: random, dense, zeros, lamp, topk, from_weights)')
parser.add_argument('--maskopt_erk_power_scale', type=float, default=1.0, help='maskopt erk power scale. (default: 1.0)')
parser.add_argument('--maskopt_mask_metrics', action='store_true', default=False, help='compute mask opt running metrics. (default: False)')
parser.add_argument('--maskopt_verbose', action='store_true', default=False, help='print maskopt running information. (default: False)')
parser.add_argument('--no_resume_mask_opt', action='store_true', default=False, help='prevent resume of mask optimizer state')
parser.add_argument('--maskopt_adjust_sparsity', action='store_true', default=False, help='adjust sparsity according to skipped layers')
parser.add_argument('--maskopt_fused_bn_updates', action='store_true', default=False, help='use fused batch norm during updates')
return parser
base_parser = argparse.ArgumentParser(add_help=False)
ARGS = {
'parent_parser': base_parser
}
- 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 ArgumentParser — a ArgumentParser output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a ArgumentParser 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
|
| add_mask_optimizer_specific_args_cv |
Ran ran on a synthesized input |
CerebrasResearch/Sparse-IFT/cbsparse/sparse/utils/argparse_utils.py code served (permissive licence) · get_code("b77615413ecbb1c6") How it ranRan 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 ArgumentParser. 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 argparse
import torch
torch.manual_seed(0)
# Create a minimal parent parser to pass to the functions
parent_parser = argparse.ArgumentParser(add_help=False)
parent_parser.add_argument('--learning_rate', type=float, default=0.001)
# Define all arguments for add_mask_optimizer_specific_args_cv
ARGS = {
'parent_parser': parent_parser,
}
- 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 ArgumentParser — a ArgumentParser output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a ArgumentParser 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
|
| calc_sparsity |
Ran ran on a synthesized input |
CerebrasResearch/Sparse-IFT/cbsparse/sparse/optimizers/utils.py code served (permissive licence) · get_code("428bfab7ca67279f") How it ranRan 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
torch.manual_seed(0)
# Create a small tensor with a mix of zero and non-zero elements
# This tensor will have some sparsity to demonstrate the function
tensor = torch.tensor([
[1.0, 0.0, 2.5, 0.0],
[0.0, 3.2, 0.0, 0.0]
], dtype=torch.float32)
ARGS = {
"tensor": tensor
}
- 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
|
| count_to_string |
Ran ran on a synthesized input |
CerebrasResearch/Sparse-IFT/cbsparse/sparse/utils/profiler_utils.py code served (permissive licence) · get_code("3aa3c043ad3d461f") How it ranRan 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. 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.
from collections import OrderedDict
# Initialize the unit_dict that the function uses
unit_dict = OrderedDict()
unit_dict['K'] = 3
unit_dict['M'] = 6
unit_dict['B'] = 9
# Define arguments for count_to_string
ARGS = {
'count': 5000000,
'units': None,
'precision': 4
}
- 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 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
|
| create_run_command |
Ran ran on a synthesized input |
cerebrasresearch/sift/ComputerVision/launch_utils/prepare_job_commands.py code served (permissive licence) · get_code("60ad7d8d0303d9a5") How it ranRan 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. 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 os
# Create a minimal args object
class Args:
def __init__(self, run_cifar=True):
self.run_cifar = run_cifar
# Set up paths (these don't need to actually exist for this function)
code_source_dir = "/home/user/ml_project"
exp_dir = "/tmp/experiment_001"
# Create the args object
args = Args(run_cifar=True)
# Define ARGS dict with all parameters
ARGS = {
"args": args,
"code_source_dir": code_source_dir,
"exp_dir": exp_dir
}
- 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
|
| extract_number |
Ran ran on a synthesized input |
CerebrasResearch/Sparse-IFT/cbsparse/sparse/optimizers/utils.py code served (permissive licence) · get_code("9ac3b31a2048c5ee") How it ranRan 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 re
def extract_number(token):
"""Strips the number from the end of the token if it exists.
Args:
token: str, s or s_d where d is a number: a float or int.
`foo_.5`, `foo_foo.5`, `foo_0.5`, `foo_4` are all valid strings.
Returns:
float, d if exists otherwise 1.
"""
regexp = re.compile('.*_(\\d*\\.?\\d*)$')
if regexp.search(token):
return float(regexp.search(token).group(1))
else:
return 1.0
ARGS = {
"token": "foo_0.5"
}
- 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 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
|
| generic_cv_should_dropconnect |
Ran ran on a synthesized input |
CerebrasResearch/Sparse-IFT/cbsparse/sparse/dropconnect/utils.py code served (permissive licence) · get_code("411a869a5eb7061b") How it ranRan 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 args object with required attributes
class Args:
def __init__(self):
self.input_size = [4] # First dimension of input
self.num_classes = 10
args = Args()
# Create a simple model with Linear and Conv2d layers
class SimpleModel(nn.Module):
def __init__(self):
super().__init__()
self.linear1 = nn.Linear(4, 8)
self.linear2 = nn.Linear(8, 10)
self.conv1 = nn.Conv2d(3, 16, kernel_size=3)
self.norm1 = nn.BatchNorm2d(16)
self.cls_token = nn.Parameter(torch.randn(1, 1, 8))
self.pos_embed = nn.Parameter(torch.randn(1, 10, 8))
model = SimpleModel()
# Get a module and its name for testing
n = "linear1"
m = model.linear1
# Define the desc parameter with module type mappings
desc = {
torch.nn.Linear: 'weight',
torch.nn.Conv2d: 'weight'
}
ARGS = {
'n': n,
'm': m,
'args': args,
'desc': desc
}
- 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
|
| generic_cv_should_sparsify |
Ran ran on a synthesized input |
CerebrasResearch/Sparse-IFT/cbsparse/sparse/utils/should_sparsify_utils.py code served (permissive licence) · get_code("7ece5276bcdc838d") How it ranRan 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 minimal args class with all required attributes
class Args:
def __init__(self):
self.maskopt = True
self.input_size = (3, 224, 224) # (channels, height, width)
self.num_classes = 1000
self.maskopt_sparsity_stem = True
self.maskopt_sparsity_head = True
self.maskopt_sparsity_norm = True
# Create test parameters
# Case 1: stem parameter - should check stem sparsity
stem_param = torch.randn(64, 3, 7, 7) # Conv layer with input_size[0]=3 channels
# Case 2: head parameter - should check head sparsity
head_param = torch.randn(1000, 512) # Linear layer with 1000 num_classes
# Case 3: norm parameter - should check norm sparsity
norm_param = torch.randn(512) # Norm layer
# Case 4: cls_token or pos_embed - should return False
cls_token_param = torch.randn(1, 768)
# Case 5: regular parameter - should return True (len > 1)
regular_param = torch.randn(512, 256)
# Case 6: 1D parameter - should return False (len == 1)
bias_param = torch.randn(512)
# Create argument combinations for testing
args = Args()
# Test case: stem parameter
n_stem = "stem_conv"
p_stem = stem_param
# Test case: head parameter
n_head = "head_fc"
p_head = head_param
# Test case: norm parameter
n_norm = "norm_layer"
p_norm = norm_param
# Test case: cls_token
n_cls = "cls_token"
p_cls = cls_token_param
# Test case: regular 2D parameter
n_regular = "conv_layer"
p_regular = regular_param
# Test case: bias (1D)
n_bias = "bias"
p_bias = bias_param
ARGS = {
"n": n_regular,
"p": p_regular,
"args": args
}
- 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
|
| get_named_parameters |
Ran ran on a synthesized input |
CerebrasResearch/Sparse-IFT/cbsparse/sparse/optimizers/utils.py code served (permissive licence) · get_code("777b63f2b109a22a") How it ranRan 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 dict. 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)
class SimpleModel(nn.Module):
def __init__(self):
super().__init__()
self.linear1 = nn.Linear(4, 3)
self.linear2 = nn.Linear(3, 2)
self.frozen_param = nn.Parameter(torch.randn(2))
def forward(self, x):
x = self.linear1(x)
x = self.linear2(x)
return x
model = SimpleModel()
# Freeze one parameter to test the requires_grad check
model.frozen_param.requires_grad = False
ARGS = {
"model": model
}
- 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 dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict 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
|
| get_optimizer_and_lr_scheduler |
Ran ran on a synthesized input |
cerebrasresearch/sift/ComputerVision/ImageNet/utils/optim_utils.py code served (permissive licence) · get_code("9cda89ca5488aa19") How it ranRan 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 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
import torch.nn as nn
import torch.optim as optim
torch.manual_seed(0)
class SimpleModel(nn.Module):
def __init__(self):
super().__init__()
self.fc1 = nn.Linear(4, 8)
self.fc2 = nn.Linear(8, 3)
self.bn = nn.BatchNorm1d(8)
def forward(self, x):
x = self.fc1(x)
x = self.bn(x)
x = self.fc2(x)
return x
def no_weight_decay(self):
return {'bn.weight', 'bn.bias'}
class Args:
def __init__(self):
self.filter_norm_and_bias = True
self.weight_decay = 0.0001
self.optimizer = 'adam'
self.lr = 0.001
self.momentum = 0.9
self.nesterov = True
self.lr_scheduler = 'cosineannealing'
self.epochs = 100
self.lr_warmup_epochs = 5
self.lr_min = 1e-6
self.lr_step_size = 10
self.lr_gamma = 0.1
self.lr_milestones = [30, 60]
self.lr_warmup_method = 'linear'
self.lr_warmup_decay = 0.1
model = SimpleModel()
args = Args()
ARGS = {
'args': args,
'model': model
}
- 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 1, 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
|
| get_required_args |
Ran ran on a synthesized input |
CerebrasResearch/Sparse-IFT/cbsparse/sparse/utils/maskopt_utils.py code served (permissive licence) · get_code("acaa35365153c4be") How it ranRan 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
import torch.nn as nn
torch.manual_seed(0)
# Build a minimal model with trainable parameters
class SimpleModel(nn.Module):
def __init__(self):
super().__init__()
self.linear1 = nn.Linear(4, 3)
self.linear2 = nn.Linear(3, 2)
def forward(self, x):
x = self.linear1(x)
x = self.linear2(x)
return x
model = SimpleModel()
# Define should_sparsify function
def should_sparsify(name, param):
# Sparsify weight parameters but not biases
return 'weight' in name and param.numel() > 5
# Build a mock dense_train_profiler
class MockProfiler:
def __init__(self):
self.complexity_profile = {
'flops': 1000.0,
'profiler_dict': {}
}
# Add profiling data for each module
for name, module in model.named_modules():
if isinstance(module, nn.Linear):
self.complexity_profile['profiler_dict'][module] = {
'op1': {
'adds': 10.0,
'multiplies': 20.0,
'logical': 5.0,
'other': 2.0
}
}
dense_train_profiler = MockProfiler()
ARGS = {
'model': model,
'should_sparsify': should_sparsify,
'dense_train_profiler': dense_train_profiler
}
- 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
|
| get_run_name |
Ran ran on a synthesized input |
cerebrasresearch/sift/ComputerVision/launch_utils/prepare_job_commands.py code served (permissive licence) · get_code("0415b1caa3cae4d4") How it ranRan 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. 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 hashlib
def get_run_name(exp_params):
_exp_name = []
for key, value in exp_params.items():
if key == 'pretrain_artifact_dir':
main_val = value.split('/')[-1]
hex_string = hashlib.md5(main_val.encode()).hexdigest()[:5]
_exp_name.append(f'checkpoint_{hex_string}')
elif key == 'model':
continue
elif key == 'sift_scaling':
continue
elif key == 'sift_family':
_exp_name.append(f'sift_family_{value}')
elif key == 'block_name':
continue
elif key == 'maskopt':
_exp_name.append(f'{value}')
elif key == 'maskopt_sparsity':
_exp_name.append(f'sparse_{value}')
elif key == 'maskopt_mask_distribution':
_exp_name.append(f'distri_{value}')
elif key == 'maskopt_mask_init_method':
_exp_name.append(f'init_{value}')
elif key == 'maskopt_end_iteration':
_exp_name.append(f'end_{value}')
elif key == 'maskopt_frequency':
_exp_name.append(f'freq_{value}')
elif key == 'maskopt_drop_fraction':
_exp_name.append(f'df_{value}')
elif key == 'maskopt_drop_fraction_anneal':
_exp_name.append(f'anneal_{value}')
else:
_exp_name.append(f'{key}_{value}')
_exp_name = '_'.join(_exp_name)
return _exp_name
ARGS = {
'exp_params': {
'pretrain_artifact_dir': '/path/to/my_checkpoint_dir',
'model': 'some_model_object',
'sift_scaling': 1.0,
'sift_family': 'sift_v1',
'block_name': 'block_1',
'maskopt': 'enabled',
'maskopt_sparsity': 0.9,
'maskopt_mask_distribution': 'uniform',
'maskopt_mask_init_method': 'random',
'maskopt_end_iteration': 1000,
'maskopt_frequency': 10,
'maskopt_drop_fraction': 0.1,
'maskopt_drop_fraction_anneal': 'linear',
'learning_rate': 0.001,
}
}
- 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 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
|
| get_should_sparsify |
Ran ran on a synthesized input |
CerebrasResearch/Sparse-IFT/cbsparse/sparse/utils/should_sparsify_utils.py code served (permissive licence) · get_code("6ea58b7d199dffa7") How it ranRan 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 partial. 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
from functools import partial
torch.manual_seed(0)
# Create a minimal model class that doesn't implement should_sparsify
class SimpleModel(nn.Module):
def __init__(self):
super().__init__()
self.conv1 = nn.Conv2d(3, 16, 3)
self.bn1 = nn.BatchNorm2d(16)
self.fc = nn.Linear(16, 10)
def forward(self, x):
return x
# Create a ResNet-style model
class ResNetStyleModel(nn.Module):
def __init__(self):
super().__init__()
self.conv1 = nn.Conv2d(3, 16, 3)
self.bn1 = nn.BatchNorm2d(16)
self.fc = nn.Linear(16, 10)
def forward(self, x):
return x
# Create a model with should_sparsify method
class CustomModel(nn.Module):
def __init__(self):
super().__init__()
self.layer = nn.Linear(4, 8)
def forward(self, x):
return self.layer(x)
def should_sparsify(self, n, p):
return len(p.shape) > 1
# Create args object with all required attributes
class Args:
def __init__(self):
self.maskopt = True
self.input_size = (3, 32, 32)
self.num_classes = 10
self.model = "resnet50"
self.maskopt_sparsity_stem = True
self.maskopt_sparsity_head = True
self.maskopt_sparsity_norm = False
ARGS = {
"args": Args(),
"model": SimpleModel()
}
- 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 partial — a partial output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a partial 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
|
| initializations |
Ran ran on a synthesized input |
cerebrasresearch/sift/ComputerVision/CIFAR/models/initializers.py code served (permissive licence) · get_code("a13e346300ba99cf") How it ranRan 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 function. 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 math
import torch
import torch.nn as nn
torch.manual_seed(0)
# Test the function with different init_type and density values
init_type = 'scaled_kaiming_normal'
density = 0.5
ARGS = {
'init_type': init_type,
'density': density
}
- 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 function — a function output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a function 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
|
| load_data |
Ran ran on a synthesized input |
cerebrasresearch/sift/ComputerVision/ImageNet/utils/data_utils.py code served (permissive licence) · get_code("a18d31a26dcd11fd") How it ranRan 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 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
import torch.utils.data
import torchvision
from torchvision.transforms.functional import InterpolationMode
from PIL import Image
import tempfile
import os
torch.manual_seed(0)
# Create temporary directories with minimal ImageFolder structure
temp_train_dir = tempfile.mkdtemp()
temp_val_dir = tempfile.mkdtemp()
# Create class subdirectories
os.makedirs(os.path.join(temp_train_dir, "class0"), exist_ok=True)
os.makedirs(os.path.join(temp_train_dir, "class1"), exist_ok=True)
os.makedirs(os.path.join(temp_val_dir, "class0"), exist_ok=True)
os.makedirs(os.path.join(temp_val_dir, "class1"), exist_ok=True)
# Create minimal dummy images
def create_dummy_image(path):
img = Image.new('RGB', (256, 256), color='red')
img.save(path)
create_dummy_image(os.path.join(temp_train_dir, "class0", "img1.jpg"))
create_dummy_image(os.path.join(temp_train_dir, "class1", "img2.jpg"))
create_dummy_image(os.path.join(temp_val_dir, "class0", "img3.jpg"))
create_dummy_image(os.path.join(temp_val_dir, "class1", "img4.jpg"))
# Create args object with all required attributes
class Args:
def __init__(self):
self.val_resize_size = 256
self.val_crop_size = 224
self.train_crop_size = 224
self.interpolation = "bilinear"
self.distributed = False
self.batch_size = 2
self.workers = 0
self.num_classes = None # Will be set by load_data
args_obj = Args()
ARGS = {
"traindir": temp_train_dir,
"valdir": temp_val_dir,
"args": args_obj
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- PIL, torch, torchvision — 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 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
|
| num_model_parameters |
Ran ran on a synthesized input |
cerebrasresearch/sift/ComputerVision/ImageNet/utils/common_utils.py code served (permissive licence) · get_code("eb8c569a7f3c60ce") How it ranRan 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 torch.nn as nn
torch.manual_seed(0)
# Create a simple model with trainable parameters
class SimpleModel(nn.Module):
def __init__(self):
super().__init__()
self.linear1 = nn.Linear(4, 3)
self.linear2 = nn.Linear(3, 2)
def forward(self, x):
x = self.linear1(x)
x = self.linear2(x)
return x
model = SimpleModel()
# Ensure all parameters require gradients (which is default)
for param in model.parameters():
param.requires_grad = True
ARGS = {
"model": model
}
- 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
|
| reduce_across_processes |
Ran ran, honoured the contract we drafted |
cerebrasresearch/sift/ComputerVision/ImageNet/utils/imagenet_utils.py code served (permissive licence) · get_code("4283f68f4165ad0a") How it ranRan 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 0, dtype family float, shape () as a later run recorded it. 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, 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.distributed as dist
torch.manual_seed(0)
# The function reduce_across_processes takes a single parameter 'val'
# which is converted to a torch.tensor in the non-distributed case.
# We need to provide a value that can be converted to a tensor.
# Test with a simple scalar value
val = 5.0
ARGS = {
"val": val
}
- 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 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
|
| resnet_should_sparsify |
Ran ran on a synthesized input |
CerebrasResearch/Sparse-IFT/cbsparse/sparse/utils/should_sparsify_utils.py code served (permissive licence) · get_code("4100493b55e06307") How it ranRan 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)
class Args:
def __init__(self):
self.maskopt = True
self.maskopt_sparsity_stem = True
self.maskopt_sparsity_head = True
self.maskopt_sparsity_norm = True
# Create a simple parameter tensor
param = torch.randn(4, 3)
# Create a parameter name
param_name = "layer1.0.weight"
# Create args object
args = Args()
ARGS = {
"n": param_name,
"p": param,
"args": args
}
- 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
|
| set_weight_decay |
Ran ran on a synthesized input |
cerebrasresearch/sift/ComputerVision/ImageNet/utils/optim_utils.py code served (permissive licence) · get_code("87e81f47b5aefd7c") How it ranRan 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
import torch.nn as nn
torch.manual_seed(0)
# Build a small model with parameters of different dimensions
class SimpleModel(nn.Module):
def __init__(self):
super().__init__()
# 2D weight (will be in decay list)
self.linear1 = nn.Linear(4, 3)
# 1D bias (will be in no_decay list - ndim=1)
self.bias_param = nn.Parameter(torch.randn(2))
# Another 2D weight
self.linear2 = nn.Linear(3, 2)
def forward(self, x):
return self.linear2(self.linear1(x))
model = SimpleModel()
# Parameters to pass to set_weight_decay
weight_decay = 0.01
no_weight_decay_list = ('bias_param',)
ARGS = {
'model': model,
'weight_decay': weight_decay,
'no_weight_decay_list': no_weight_decay_list,
}
- 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
|
| get_model_complexity_info |
Not yet run unverified (harvested, no recorded run) |
CerebrasResearch/Sparse-IFT/cbsparse/sparse/utils/profiler_utils.py code served (permissive licence) · get_code("f131b1b13ef74337") How it ran |
| print_model_with_flops |
Not yet run unverified (harvested, no recorded run) |
CerebrasResearch/Sparse-IFT/cbsparse/sparse/utils/profiler_utils.py code served (permissive licence) · get_code("adcedda264ea96b0") How it ran |
| str_to_class |
Not yet run unverified (harvested, no recorded run) |
cerebrasresearch/sift/ComputerVision/CIFAR/models/cifar_resnet18.py pointer only (licence: Apache-2.0); the stored copy get_code serves, from mfinzi/constrained-hamiltonian-neural-networks, is pointer only (licence: NONE) · get_code("24f161565d6a4013") How it ranThe body of this sample is withheld: this paper's link allows the body inline (Apache-2.0), but get_code serves the stored copy, first harvested from mfinzi/constrained-hamiltonian-neural-networks, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. No invocation recorded. |