| Parameter |
Ran ran; our contract draft was wrong, not the code · constructed an object; no result was computed |
graphcore-research/unit-scaling/unit_scaling/parameter.py code served (permissive licence) · get_code("8d7406030299bc46") 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 an instance of its own class, Parameter: the run constructed the object and did not call it, so no result was computed. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import torch
from torch import nn
torch.manual_seed(0)
# Create a small tensor for the parameter
data = torch.randn(4, 3)
# Set up the arguments dictionary
ARGS = {
'data': data,
'mup_type': 'weight',
'mup_scaling_depth': 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 Parameter — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a Parameter output the recorded ndim 2 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
|
| format_to_tuple |
Ran ran, honoured the contract we drafted |
graphcore-research/unit-scaling/unit_scaling/formats.py code served (permissive licence) · get_code("070a400b0ece5434") 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 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
from dataclasses import dataclass
@dataclass
class FPFormat:
"""Generic representation of a floating-point number format."""
exponent_bits: int
mantissa_bits: int
rounding: str = 'stochastic'
srbits: int = 0
def __post_init__(self) -> None:
assert self.exponent_bits >= 2, 'FPFormat requires at least 2 exponent bits'
assert self.srbits == 0 or self.rounding == 'stochastic', 'Nonzero srbits for non-stochastic rounding'
if self.srbits == 0 and self.rounding == 'stochastic':
self.srbits = 23 - self.mantissa_bits
@property
def bits(self) -> int:
"""The number of bits used by the format."""
return 1 + self.exponent_bits + self.mantissa_bits
def __str__(self) -> str:
return f'E{self.exponent_bits}M{self.mantissa_bits}-' + dict(stochastic='SR', nearest='RN')[self.rounding]
@property
def max_absolute_value(self) -> float:
"""The maximum absolute value representable by the format."""
max_exponent = 2 ** (self.exponent_bits - 1) - 1
return float(2 ** max_exponent * (2 - 2 ** (-self.mantissa_bits)))
@property
def min_absolute_normal(self) -> float:
"""The minimum absolute normal value representable by the format."""
min_exponent = 1 - 2 ** (self.exponent_bits - 1)
return float(2 ** min_exponent)
@property
def min_absolute_subnormal(self) -> float:
"""The minimum absolute subnormal value representable by the format."""
return self.min_absolute_normal * 2.0 ** (-self.mantissa_bits)
torch.manual_seed(0)
# Create a valid FPFormat instance with exponent_bits >= 2 and mantissa_bits > 0
fp_format = FPFormat(exponent_bits=5, mantissa_bits=10, rounding='stochastic')
ARGS = {
'format': fp_format
}
- 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 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
|
| generate__all__ |
Ran ran, honoured the contract we drafted |
graphcore-research/unit-scaling/unit_scaling/_internal_utils.py code served (permissive licence) · get_code("de8aa1c681baa450") 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 sys
import inspect
# Create a minimal test module to work with
import types
# Create a test module with some public and private members
test_module = types.ModuleType('test_module')
# Add some public items
def public_function():
pass
class PublicClass:
pass
def _private_function():
pass
class _PrivateClass:
pass
# Add members to the test module
test_module.public_function = public_function
test_module.PublicClass = PublicClass
test_module._private_function = _private_function
test_module._PrivateClass = _PrivateClass
# Register the module in sys.modules
sys.modules['test_module'] = test_module
# Create arguments for the function
ARGS = {
'module_name': 'test_module',
'include_imports': False
}
- 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 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
|
| has_parameter_data |
Ran ran, violated the contract we drafted |
graphcore-research/unit-scaling/unit_scaling/parameter.py code served (permissive licence) · get_code("d19cc5ff648afebd") 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
from torch import nn
torch.manual_seed(0)
# Create a parameter with the required ParameterData protocol attributes
parameter = nn.Parameter(torch.randn(4, 3))
parameter.mup_type = 'weight'
parameter.mup_scaling_depth = 2
ARGS = {
'parameter': parameter
}
- 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
|
| logarithmic_interpolation |
Ran ran, honoured the contract we drafted |
graphcore-research/unit-scaling/unit_scaling/core/functional.py code served (permissive licence) · get_code("e0c95afd064e25ed") 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 math
# Construct valid arguments for logarithmic_interpolation
ARGS = {
"alpha": 0.5,
"lower": 1/1000,
"upper": 1/10
}
- 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
|
| mult_docstring |
Ran ran; our contract draft was wrong, not the code |
graphcore-research/unit-scaling/unit_scaling/docs.py code served (permissive licence) · get_code("a1e2fc6500a07813") 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
def mult_docstring(name: str='mult') -> str:
return f"{name} (float, optional): a multiplier to be applied to change the shape of a nonlinear function. Typically, high multipliers (> 1) correspond to a 'sharper' (low temperature) function, while low multipliers (< 1) correspond to a 'flatter' (high temperature) function."
ARGS = {
'name': 'mult'
}
- 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
|
| rms |
Ran ran; our contract draft was wrong, not the code |
graphcore-research/unit-scaling/unit_scaling/core/functional.py code served (permissive licence) · get_code("7f174b2d78b36837") 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 1, dtype family float, shape (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 torch.nn as nn
torch.manual_seed(0)
# Create a small tensor for testing
x = torch.randn(2, 4, dtype=torch.float32)
# Define arguments for the rms function
ARGS = {
'x': x,
'dims': (1,),
'keepdim': False,
'eps': 1e-8
}
- 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 (2,) — shape (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
|
| scale_bwd |
Ran ran; our contract draft was wrong, not the code |
graphcore-research/unit-scaling/unit_scaling/scale.py code served (permissive licence) · get_code("af14bc3abf24163b") 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 2, dtype family float, shape (2, 4) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import torch
torch.manual_seed(0)
# Create a small tensor for testing
input_tensor = torch.randn(2, 4, requires_grad=True)
# Define the scale factor
scale_factor = 2.0
# Create the ARGS dictionary with all parameters
ARGS = {
"input": input_tensor,
"scale": scale_factor,
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- torch — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type Tensor, ndim 2, dtype family float, shape (2, 4) — shape (2, 4) as a later run recorded it
- dtype family
- int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| scale_fwd |
Ran ran; our contract draft was wrong, not the code |
graphcore-research/unit-scaling/unit_scaling/scale.py code served (permissive licence) · get_code("99e5d990030cdf9a") 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 2, dtype family float, shape (2, 4) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import torch
torch.manual_seed(0)
# Create a small tensor for testing
input_tensor = torch.randn(2, 4, requires_grad=True)
# Define the scale factor
scale_factor = 2.5
ARGS = {
"input": input_tensor,
"scale": scale_factor,
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- torch — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type Tensor, ndim 2, dtype family float, shape (2, 4) — shape (2, 4) as a later run recorded it
- dtype family
- int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| to_grad_input_scale |
Ran ran, honoured the contract we drafted |
graphcore-research/unit-scaling/unit_scaling/constraints.py code served (permissive licence) · get_code("311ddf75624e8833") 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
import numpy as np
torch.manual_seed(0)
ARGS = {
"output_scale": 2.5,
"grad_input_scale": 1.7,
}
- 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 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
|
| to_left_grad_scale |
Ran ran, honoured the contract we drafted |
graphcore-research/unit-scaling/unit_scaling/constraints.py code served (permissive licence) · get_code("e57d5ac2fdb91999") 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
import numpy as np
torch.manual_seed(0)
ARGS = {
"output_scale": 1.5,
"left_grad_scale": 2.5,
"right_grad_scale": 3.5,
}
- 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 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
|
| tuple_to_format |
Ran ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT) |
graphcore-research/unit-scaling/unit_scaling/formats.py code served (permissive licence) · get_code("07ba3009b696a3c2") 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 FPFormat. 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
from dataclasses import dataclass
from typing import Tuple
torch.manual_seed(0)
@dataclass
class FPFormat:
"""Generic representation of a floating-point number format."""
exponent_bits: int
mantissa_bits: int
rounding: str = 'stochastic'
srbits: int = 0
def __post_init__(self) -> None:
assert self.exponent_bits >= 2, 'FPFormat requires at least 2 exponent bits'
assert self.srbits == 0 or self.rounding == 'stochastic', 'Nonzero srbits for non-stochastic rounding'
if self.srbits == 0 and self.rounding == 'stochastic':
self.srbits = 23 - self.mantissa_bits
@property
def bits(self) -> int:
"""The number of bits used by the format."""
return 1 + self.exponent_bits + self.mantissa_bits
def __str__(self) -> str:
return f'E{self.exponent_bits}M{self.mantissa_bits}-' + dict(stochastic='SR', nearest='RN')[self.rounding]
@property
def max_absolute_value(self) -> float:
"""The maximum absolute value representable by the format."""
max_exponent = 2 ** (self.exponent_bits - 1) - 1
return float(2 ** max_exponent * (2 - 2 ** (-self.mantissa_bits)))
@property
def min_absolute_normal(self) -> float:
"""The minimum absolute normal value representable by the format."""
min_exponent = 1 - 2 ** (self.exponent_bits - 1)
return float(2 ** min_exponent)
@property
def min_absolute_subnormal(self) -> float:
"""The minimum absolute subnormal value representable by the format."""
return self.min_absolute_normal * 2.0 ** (-self.mantissa_bits)
def quantise(self, x: torch.Tensor) -> torch.Tensor:
"""Non-differentiably quantise the given tensor in this format."""
absmax = self.max_absolute_value
downscale = 2.0 ** (127 - 2 ** (self.exponent_bits - 1))
mask = torch.tensor(2 ** (23 - self.mantissa_bits) - 1, device=x.device)
if self.rounding == 'stochastic':
srbitsbar = 23 - self.mantissa_bits - self.srbits
offset = torch.randint(0, 2 ** self.srbits, x.shape, dtype=torch.int32, device=x.device) << srbitsbar
if srbitsbar > 0:
offset += 1 << (srbitsbar - 1)
elif self.rounding == 'nearest':
offset = mask // 2
else:
raise ValueError(f'Unexpected FPFormat(rounding="{self.rounding}"), expected "stochastic" or "nearest"')
q = x.to(torch.float32)
q = torch.clip(q, -absmax, absmax)
q /= downscale
q = (q.view(torch.int32) + offset & ~mask).view(torch.float32)
q *= downscale
return q.to(x.dtype)
def quantise_fwd(self, x: torch.Tensor) -> torch.Tensor:
"""Quantise the given tensor in the forward pass only."""
class QuantiseForward(torch.autograd.Function):
@staticmethod
def forward(ctx: torch.autograd.function.FunctionCtx, x: torch.Tensor) -> torch.Tensor:
return self.quantise(x)
@staticmethod
def backward(ctx: torch.autograd.function.FunctionCtx, grad_y: torch.Tensor) -> torch.Tensor:
return grad_y
return QuantiseForward.apply(x)
def quantise_bwd(self, x: torch.Tensor) -> torch.Tensor:
"""Quantise the given tensor in the backward pass only."""
class QuantiseBackward(torch.autograd.Function):
@staticmethod
def forward(ctx: torch.autograd.function.FunctionCtx, x: torch.Tensor) -> torch.Tensor:
return x
@staticmethod
def backward(ctx: torch.autograd.function.FunctionCtx, grad_y: torch.Tensor) -> torch.Tensor:
return self.quantise(grad_y)
return QuantiseBackward.apply(x)
def tuple_to_format(t: Tuple[int, int]) -> FPFormat:
"""Given a tuple of `(exponent_bits, mantissa_bits)` returns the corresponding
:class:`FPFormat`"""
return FPFormat(*t)
ARGS = {
"t": (5, 10)
}
- 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 FPFormat — a FPFormat output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a FPFormat 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
|
| to_output_scale |
Not yet run unverified (harvested, no recorded run) |
graphcore-research/unit-scaling/unit_scaling/constraints.py code served (permissive licence) · get_code("873f0a22bcd0444f") How it ran |