SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2006.15704 · 2020

PyTorch Distributed: Experiences on Accelerating Data Parallel Training

arXiv · PDF · Open in the Atlas

Code that ran

8 of 12 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 8 have no contract verdict; 0 failures of our instrument; 4 no recorded run), measured 2026-11-22; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2006.15704.json · badge: /api/ran/2006.15704.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
lancelee82/necklace community (classifier label)
classifier basis not recorded on the link
8 ran · 1 no recorded run
copy not recorded community
not in the paper's declared repositories
0 ran · 3 no recorded run
FunctionStatusWhere it lives
build_pg_cfg Ran
ran on a synthesized input
lancelee82/necklace/necklace/cuda/ncclgrp.py
code served (permissive licence) · get_code("d8a9a401597da397")
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 torch

torch.manual_seed(0)

ARGS = {
    'pg_rank': 0,
    'pg_ranks': [0, 1, 2]
}
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
cuda_devarr_c_void_p Ran
ran on a synthesized input
lancelee82/necklace/necklace/cuda/nbutils.py
code served (permissive licence) · get_code("d50063f8f0205b33")
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 c_void_p. 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 ctypes as ctp

torch.manual_seed(0)

# The function expects d_arr to have a device_ctypes_pointer attribute
# On CPU tensors, we need to create a mock object that has this attribute
class MockCUDAArray:
    def __init__(self):
        # Create a mock device_ctypes_pointer with a value attribute
        self.device_ctypes_pointer = ctp.c_void_p(12345)

d_arr = MockCUDAArray()

ARGS = {
    "d_arr": d_arr
}
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 c_void_p — a c_void_p 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
make_pg_by_nc Ran
ran on a synthesized input
lancelee82/necklace/necklace/cuda/ncclgrp.py
code served (permissive licence) · get_code("08ce48d5e737dfa1")
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 NcclProcessGroup. 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


class MockStream:
    """Mock stream that can be synchronized"""
    def synchronize(self):
        pass


class MockNK:
    """Mock NK object with required nk attribute and get_stream method"""
    def __init__(self):
        self.nk = self
    
    def get_stream(self):
        return MockStream()


class MockNC:
    """Mock NC object with required nk and comm_i attributes"""
    def __init__(self):
        self.nk = MockNK()
        self.comm_i = "mock_comm_i"


# Create mock objects
nc = MockNC()
pg_rank = 0
pg_ranks = [0, 1, 2]

ARGS = {
    'nc': nc,
    'pg_rank': pg_rank,
    'pg_ranks': pg_ranks
}
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 NcclProcessGroup — a NcclProcessGroup output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a NcclProcessGroup 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
make_pg_by_nk Ran
ran on a synthesized input
lancelee82/necklace/necklace/cuda/ncclgrp.py
code served (permissive licence) · get_code("c4e23fd5a2524f0e")
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 NcclProcessGroup. 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)

# Create a minimal stand-in for the `nk` object
# Based on the code, it needs:
# - an `nk` attribute (for NcclProcessGroup to access)
# - a `get_stream()` method that returns something with `synchronize()`
class MockStream:
    def synchronize(self):
        pass

class MockNK:
    def __init__(self):
        self.nk = self  # self-reference for the nk attribute
    
    def get_stream(self):
        return MockStream()

# Create instances for the arguments
nk = MockNK()
comm_i = None  # Can be None based on the init signature
pg_rank = 0
pg_ranks = [0, 1, 2]

ARGS = {
    'nk': nk,
    'comm_i': comm_i,
    'pg_rank': pg_rank,
    'pg_ranks': pg_ranks
}
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 NcclProcessGroup — a NcclProcessGroup output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a NcclProcessGroup 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
nccl_out_all_gather Ran
ran on a synthesized input
lancelee82/necklace/necklace/cuda/ncclutils.py
code served (permissive licence) · get_code("91f1d429fa12a8c1")
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 MockTensor. 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 numpy as np

torch.manual_seed(0)

class MockNCCL:
    """Mock NCCL communicator with required methods"""
    def do_all_gather(self, out_data_p, outs_data_p, sz):
        """Mock all-gather operation"""
        pass
    
    def stream_sync(self):
        """Mock stream synchronization"""
        pass

class MockNDArray:
    """Mock ndarray with required methods"""
    def waitall(self):
        """Mock wait all operation"""
        pass

class MockTensor:
    """Mock tensor object with required attributes and methods"""
    def __init__(self, data):
        self.data = data
        self.size = data.size
    
    def get_data_p(self):
        """Return data pointer (mock)"""
        return self.data.data_ptr()

# Create mock objects
out_tensor = MockTensor(torch.randn(2, 4))
outs_tensor = MockTensor(torch.randn(2, 4))
nc = MockNCCL()
ndarray = MockNDArray()

ARGS = {
    'out': out_tensor,
    'outs': outs_tensor,
    'nc': nc,
    'kn': None,
    'ndarray': ndarray
}
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 MockTensor — a MockTensor output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a MockTensor 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
nk_comm_init_rank Ran
ran on a synthesized input
lancelee82/necklace/necklace/cuda/ncclfns.py
code served (permissive licence) · get_code("23734df31fcbe461")
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 CommInfo. 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 numpy as np
from ctypes import POINTER, c_void_p, Structure, byref

torch.manual_seed(0)

# Create a mock nk object that implements comm_init_rank
class MockNK:
    def comm_init_rank(self, comm_i_ptr, world_size, nuid, rank):
        # Mock implementation that returns 0 (success)
        # Sets some dummy value to the comm_i pointer
        return 0

# Create a simple comm_i structure
class CommInfo(Structure):
    _fields_ = [("handle", c_void_p)]

# Instantiate objects
nk = MockNK()
comm_i = CommInfo()
world_size = 4
nuid = np.uint64(12345)
rank = 0

ARGS = {
    "nk": nk,
    "comm_i": comm_i,
    "world_size": world_size,
    "nuid": nuid,
    "rank": rank
}
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 CommInfo — a CommInfo 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
seg_cb_nccl_ar Ran
ran on a synthesized input
lancelee82/necklace/necklace/cuda/ncclutils.py
code served (permissive licence) · get_code("d00d171c543f55b4")
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 OutputGrad. 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 numpy as np

torch.manual_seed(0)

# Stand-in class for og (output grad) parameter
# The function calls: og.size, og.get_data_p()
class OutputGrad:
    def __init__(self):
        self.data = np.array([1.0, 2.0, 3.0, 4.0], dtype=np.float32)
        self.size = len(self.data)
    
    def get_data_p(self):
        """Return pointer/reference to data"""
        return self.data.ctypes.data
    
    def waitall(self):
        pass

# Stand-in class for nc (nccl communicator) parameter
# The function calls: nc.do_all_reduce(), nc.stream_sync()
class NCCLComm:
    def do_all_reduce(self, send_ptr, recv_ptr, size):
        """Perform all-reduce operation"""
        pass
    
    def stream_sync(self):
        """Synchronize stream"""
        pass

# Stand-in class for ndarray parameter
# The function calls: ndarray.waitall()
class NDArray:
    def waitall(self):
        """Wait for all pending operations"""
        pass

# Construct valid arguments
og = OutputGrad()
nc = NCCLComm()
kn = None  # Not used in function body
ndarray = NDArray()

ARGS = {
    "og": og,
    "nc": nc,
    "kn": kn,
    "ndarray": ndarray
}
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 OutputGrad — a OutputGrad output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a OutputGrad 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
tensor_data_ptr Ran
ran on a synthesized input
lancelee82/necklace/necklace/cuda/ncclutils.py
code served (permissive licence) · get_code("c65797c72e9f5d34")
How it ran

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

import torch
import numpy as np

torch.manual_seed(0)

# Create a simple class with get_data_p method
class CustomTensorA:
    def get_data_p(self):
        return 12345

# Create a simple class with data_ptr method (like a torch tensor)
class CustomTensorB:
    def data_ptr(self):
        return 67890

# Create a simple class with device_ctypes_pointer attribute
class CustomTensorC:
    def __init__(self):
        self.device_ctypes_pointer = 11111

# Create a simple class with none of the above (returns None)
class CustomTensorD:
    pass

# Test with actual torch tensor which has data_ptr
torch_tensor = torch.randn(2, 4)

# Create instances to test
obj_with_get_data_p = CustomTensorA()
obj_with_data_ptr = CustomTensorB()
obj_with_device_ctypes_pointer = CustomTensorC()
obj_with_nothing = CustomTensorD()

# The function takes a single parameter 'a'
# We'll test it with a torch tensor which has data_ptr method
ARGS = {
    'a': torch_tensor
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type int, ndim 0, dtype family int, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
cuda_to_device Not yet run
unverified (harvested, no recorded run)
lancelee82/necklace/necklace/cuda/nbutils.py
code served (permissive licence) · get_code("3c44fe34338a17fa")
How it ran

no invocation recorded.

register_module_buffer_registration_hook Not yet run
unverified (harvested, no recorded run)
this paper's copy was not recorded; identical code first harvested from pytorch/pytorch
pointer only; the stored copy get_code serves, from pytorch/pytorch, is pointer only (licence: NOASSERTION) · get_code("358905d8834f7cfa")
How it ran

The body of this sample is withheld: this paper's copy of the code was not recorded (its link names no repository or source path), so no licence was read for it. 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.

register_module_module_registration_hook Not yet run
unverified (harvested, no recorded run)
this paper's copy was not recorded; identical code first harvested from pytorch/pytorch
pointer only; the stored copy get_code serves, from pytorch/pytorch, is pointer only (licence: NOASSERTION) · get_code("2e8b412bf625c913")
How it ran

The body of this sample is withheld: this paper's copy of the code was not recorded (its link names no repository or source path), so no licence was read for it. 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.

register_module_parameter_registration_hook Not yet run
unverified (harvested, no recorded run)
this paper's copy was not recorded; identical code first harvested from pytorch/pytorch
pointer only; the stored copy get_code serves, from pytorch/pytorch, is pointer only (licence: NOASSERTION) · get_code("0a1bb6fa560c4b8d")
How it ran

The body of this sample is withheld: this paper's copy of the code was not recorded (its link names no repository or source path), so no licence was read for it. 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.

Also present in other papers' code

Of 12 samples lifted from this paper's linked repositories, 12 carry a function identity and 0 do not. Of the 12 distinct functions with an identity, 3 are also present in other papers whose code we hold (3 with at least one paper dated earlier, 0 the same month, 3 later) and 9 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

FunctionAlso present inEarliest-datedOthers named
register_module_buffer_registration_hook 2 other papers
1 dated earlier, 1 later
1912.01703 (2019-12)
PyTorch: An Imperative Style, High-Performance Deep Learning Library
2304.11277 (2023-04)
PyTorch FSDP: Experiences on Scaling Fully Sharded Data Parallel
register_module_module_registration_hook 2 other papers
1 dated earlier, 1 later
1912.01703 (2019-12)
PyTorch: An Imperative Style, High-Performance Deep Learning Library
2304.11277 (2023-04)
PyTorch FSDP: Experiences on Scaling Fully Sharded Data Parallel
register_module_parameter_registration_hook 2 other papers
1 dated earlier, 1 later
1912.01703 (2019-12)
PyTorch: An Imperative Style, High-Performance Deep Learning Library
2304.11277 (2023-04)
PyTorch FSDP: Experiences on Scaling Fully Sharded Data Parallel

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-22.

Repositories linked to this paper

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

Abstract

This paper presents the design, implementation, and evaluation of the PyTorch distributed data parallel module. PyTorch is a widely-adopted scientific computing package used in deep learning research and applications. Recent advances in deep learning argue for the value of large datasets and large models, which necessitates the ability to scale out model training to more computational resources. Data parallelism has emerged as a popular solution for distributed training thanks to its straightforward principle and broad applicability. In general, the technique of distributed data parallelism replicates the model on every computational resource to generate gradients independently and then communicates those gradients at each iteration to keep model replicas consistent. Despite the conceptual simplicity of the technique, the subtle dependencies between computation and communication make it non-trivial to optimize the distributed training efficiency. As of v1.5, PyTorch natively provides several techniques to accelerate distributed data parallel, including bucketing gradients, overlapping computation with communication, and skipping gradient synchronization. Evaluations show that, when configured appropriately, the PyTorch distributed data parallel module attains near-linear scalability using 256 GPUs.

For agents

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

get_harvested_code_for_paper("2006.15704")
get_code_for_paper("2006.15704")
have("2006.15704")

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

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

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

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

Connect an agent — have() is free.