SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 1710.03740 · 2017

Mixed Precision Training

arXiv · PDF · Open in the Atlas

Code that ran

8 of 8 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 0 have no contract verdict; 7 failures of our instrument; 0 no recorded run), measured 2026-11-23; 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/1710.03740.json · badge: /api/ran/1710.03740.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
deepmind/jmp community (classifier label)
classifier basis not recorded on the link
5 ran · 0 no recorded run
NVIDIA/DeepRecommender community (classifier label)
classifier basis not recorded on the link
3 ran · 0 no recorded run
FunctionStatusWhere it lives
MSEloss Ran
ran; our contract draft was wrong, not the code
NVIDIA/DeepRecommender/reco_encoder/model/model.py
code served (permissive licence) · get_code("b8a83ff3f54df1bf")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple, ndim 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
from torch.autograd import Variable

torch.manual_seed(0)

# Create small tensors for inputs and targets
# inputs: predictions from model (batch_size=2, features=4)
inputs = torch.randn(2, 4)

# targets: ground truth with some zeros (to test masking)
# Create targets where some values are 0 (will be masked out)
targets = torch.tensor([
    [1.5, 0.0, 2.3, 0.0],
    [0.0, 1.2, 3.1, 2.8]
], dtype=torch.float32)

ARGS = {
    'inputs': inputs,
    'targets': targets,
    'size_average': False
}
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
activation Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
NVIDIA/DeepRecommender/reco_encoder/model/model.py
code served (permissive licence) · get_code("509cf6cb6046a956")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Tensor, ndim 2, dtype family float, shape (2, 4) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn.functional as F

torch.manual_seed(0)

# Create a small tensor for the input
input_tensor = torch.randn(2, 4)

# Test with one of the activation function kinds
kind = 'relu'

ARGS = {
    'input': input_tensor,
    'kind': kind
}
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
all_finite Ran
ran, violated the contract we drafted
deepmind/jmp/jmp/_src/loss_scale.py
code served (permissive licence) · get_code("0e1cadfd6ea7a4b9")
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 ArrayImpl, 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 jax
import jax.numpy as jnp
import numpy as np

# The function accepts a tree (PyTree structure) and checks if all leaves are finite
# We need to construct various PyTree structures to test the function

# Test case 1: Simple array
simple_array = jnp.array([1.0, 2.0, 3.0, 4.0])

# Test case 2: Nested structure with multiple arrays
nested_tree = {
    'a': jnp.array([1.0, 2.0]),
    'b': jnp.array([[3.0, 4.0], [5.0, 6.0]]),
    'c': {
        'd': jnp.array([7.0, 8.0, 9.0])
    }
}

# Test case 3: List of arrays
list_tree = [jnp.array([1.0, 2.0, 3.0]), jnp.array([4.0, 5.0])]

# Test case 4: Mixed finite and infinite values (to test the logic)
mixed_tree = jnp.array([1.0, 2.0, jnp.inf, 4.0])

# Test case 5: Array with NaN
nan_tree = jnp.array([1.0, jnp.nan, 3.0, 4.0])

# Test case 6: Empty tree (edge case - should return True based on code)
empty_tree = {}

# Test case 7: Tuple structure
tuple_tree = (jnp.array([1.0, 2.0]), jnp.array([3.0, 4.0, 5.0, 6.0]))

# Use the simple finite array as the primary test case
ARGS = {
    'tree': nested_tree
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
jax, numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ArrayImpl, 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
cast_to_full Ran
ran; our contract draft was wrong, not the code
deepmind/jmp/jmp/_src/policy.py
code served (permissive licence) · get_code("3fb1fcab480a4e22")
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 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 jax
import jax.numpy as jnp
import numpy as np

# Create test data with different floating point types and structures
# The function processes trees (nested structures) and casts floating point arrays to f32

# Create a simple tree with various floating point arrays
float64_array = np.array([1.0, 2.0, 3.0, 4.0], dtype=np.float64)
float32_array = np.array([5.0, 6.0, 7.0], dtype=np.float32)
jax_float_array = jnp.array([8.0, 9.0, 10.0, 11.0], dtype=jnp.float32)
int_array = np.array([1, 2, 3, 4], dtype=np.int32)

# Create a nested tree structure (dict of arrays, list of arrays, etc.)
tree = {
    'floats_np64': float64_array,
    'floats_np32': float32_array,
    'floats_jax': jax_float_array,
    'ints': int_array,
    'nested': {
        'more_floats': np.array([[1.5, 2.5, 3.5], [4.5, 5.5, 6.5]], dtype=np.float64),
        'list_of_arrays': [
            np.array([0.1, 0.2], dtype=np.float64),
            np.array([0.3, 0.4], dtype=np.float32),
        ]
    }
}

ARGS = {
    'tree': tree
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
jax, numpy — 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
cast_to_half Ran
ran; our contract draft was wrong, not the code
deepmind/jmp/jmp/_src/policy.py
code served (permissive licence) · get_code("695694e8d73aca88")
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 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 jax
import jax.numpy as jnp
import numpy as np

# Create test data structures for the cast_to_half function
# The function takes a tree (nested structure) and casts floating point arrays to half precision

# Test case 1: Simple numpy array
numpy_array = np.array([[1.0, 2.0, 3.0, 4.0],
                        [5.0, 6.0, 7.0, 8.0]], dtype=np.float32)

# Test case 2: JAX array
jax_array = jnp.array([[1.5, 2.5, 3.5, 4.5],
                       [5.5, 6.5, 7.5, 8.5]], dtype=jnp.float32)

# Test case 3: Nested structure (dict with mixed types)
nested_tree = {
    'numpy_data': numpy_array,
    'jax_data': jax_array,
    'int_data': np.array([1, 2, 3, 4], dtype=np.int32),
    'nested': {
        'float_array': np.array([[1.1, 2.2], [3.3, 4.4]], dtype=np.float64),
        'scalar': 42
    },
    'list_data': [
        np.array([1.0, 2.0, 3.0], dtype=np.float32),
        jnp.array([4.0, 5.0, 6.0], dtype=jnp.float32)
    ]
}

# The function parameter is 'tree', which can be any nested structure
# We'll test with the nested tree structure
ARGS = {
    'tree': nested_tree
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
jax, numpy — 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
create_NETFLIX_data_timesplit Ran
ran; our contract draft was wrong, not the code
NVIDIA/DeepRecommender/data_utils/netflix_data_convert.py
code served (permissive licence) · get_code("2aea58b608cb15bf")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple, ndim 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 random
import time
import datetime

random.seed(0)

# Create sample Netflix-like data
# Structure: all_data[userId] = [(movieId, rating, timestamp), ...]
all_data = {
    'user1': [
        (101, 5, time.mktime(datetime.datetime.strptime('2020-01-15', '%Y-%m-%d').timetuple())),
        (102, 4, time.mktime(datetime.datetime.strptime('2020-02-10', '%Y-%m-%d').timetuple())),
        (103, 3, time.mktime(datetime.datetime.strptime('2020-06-20', '%Y-%m-%d').timetuple())),
        (104, 5, time.mktime(datetime.datetime.strptime('2020-07-05', '%Y-%m-%d').timetuple())),
    ],
    'user2': [
        (101, 4, time.mktime(datetime.datetime.strptime('2020-01-20', '%Y-%m-%d').timetuple())),
        (105, 2, time.mktime(datetime.datetime.strptime('2020-02-25', '%Y-%m-%d').timetuple())),
        (102, 5, time.mktime(datetime.datetime.strptime('2020-06-10', '%Y-%m-%d').timetuple())),
        (106, 4, time.mktime(datetime.datetime.strptime('2020-07-15', '%Y-%m-%d').timetuple())),
    ],
    'user3': [
        (102, 3, time.mktime(datetime.datetime.strptime('2020-01-25', '%Y-%m-%d').timetuple())),
        (103, 5, time.mktime(datetime.datetime.strptime('2020-02-15', '%Y-%m-%d').timetuple())),
        (104, 2, time.mktime(datetime.datetime.strptime('2020-06-30', '%Y-%m-%d').timetuple())),
        (107, 4, time.mktime(datetime.datetime.strptime('2020-07-20', '%Y-%m-%d').timetuple())),
    ],
}

train_min = '2020-01-01'
train_max = '2020-03-31'
test_min = '2020-06-01'
test_max = '2020-07-31'

ARGS = {
    'all_data': all_data,
    'train_min': train_min,
    'train_max': train_max,
    'test_min': test_min,
    'test_max': test_max,
}
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 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_policy Ran
ran; our contract draft was wrong, not the code
deepmind/jmp/jmp/_src/policy.py
code served (permissive licence) · get_code("6fcfc8688017b242")
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 Policy. 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 jax
import jax.numpy as jnp

ARGS = {
    "policy_name": "p=float32,c=float32,o=float32"
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
jax, numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Policy — a Policy output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Policy 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
select_tree Ran
ran; our contract draft was wrong, not the code
deepmind/jmp/jmp/_src/loss_scale.py
code served (permissive licence) · get_code("6c5df50b2e425ef5")
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 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 functools
from typing import Tuple, TypeVar, Union
import jax
import jax.numpy as jnp

T = TypeVar('T')

def select_tree(pred: jnp.ndarray, a: T, b: T) -> T:
    """Selects a pytree based on the given predicate."""
    assert pred.ndim == 0 and pred.dtype == jnp.bool_, 'expected boolean scalar'
    return jax.tree_util.tree_map(functools.partial(jax.lax.select, pred), a, b)


# Create a boolean scalar predicate
pred = jnp.array(True, dtype=jnp.bool_)

# Create two pytrees to select between
# Using simple nested structures with arrays
a = {
    'x': jnp.array([1.0, 2.0, 3.0, 4.0]),
    'y': jnp.array([[1.0, 2.0], [3.0, 4.0]])
}

b = {
    'x': jnp.array([5.0, 6.0, 7.0, 8.0]),
    'y': jnp.array([[5.0, 6.0], [7.0, 8.0]])
}

ARGS = {
    'pred': pred,
    'a': a,
    'b': b
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
jax — 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

Also present in other papers' code

Of 8 samples lifted from this paper's linked repositories, 8 carry a function identity and 0 do not. Of the 8 distinct functions with an identity, 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 8 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-23.

Repositories linked to this paper

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

Abstract

Deep neural networks have enabled progress in a wide variety of applications. Growing the size of the neural network typically results in improved accuracy. As model sizes grow, the memory and compute requirements for training these models also increases. We introduce a technique to train deep neural networks using half precision floating point numbers. In our technique, weights, activations and gradients are stored in IEEE half-precision format. Half-precision floating numbers have limited numerical range compared to single-precision numbers. We propose two techniques to handle this loss of information. Firstly, we recommend maintaining a single-precision copy of the weights that accumulates the gradients after each optimizer step. This single-precision copy is rounded to half-precision format during training. Secondly, we propose scaling the loss appropriately to handle the loss of information with half-precision gradients. We demonstrate that this approach works for a wide variety of models including convolution neural networks, recurrent neural networks and generative adversarial networks. This technique works for large scale models with more than 100 million parameters trained on large datasets. Using this approach, we can reduce the memory consumption of deep learning models by nearly 2x. In future processors, we can also expect a significant computation speedup using half-precision hardware units.

For agents

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

get_harvested_code_for_paper("1710.03740")
get_code_for_paper("1710.03740")
have("1710.03740")

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

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

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

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

Connect an agent — have() is free.