SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2108.13976 · 2021

WarpDrive: Extremely Fast End-to-End Deep Multi-Agent Reinforcement Learning on a GPU

arXiv · PDF · Open in the Atlas

Code that ran

7 of 7 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 7 have no contract verdict; 0 failures of our instrument; 0 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/2108.13976.json · badge: /api/ran/2108.13976.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
salesforce/ai-economist canonical (classifier label)
classifier basis: census
5 ran · 0 no recorded run
salesforce/warp-drive canonical (classifier label)
classifier basis: census
2 ran · 0 no recorded run
FunctionStatusWhere it lives
cfg_dict_from_yaml Ran
ran on a synthesized input
salesforce/ai-economist/ai_economist/real_business_cycle/experiment_utils.py
code served (permissive licence) · get_code("d8a1bc0618312f77")
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 hashlib
import json
import struct
from copy import deepcopy
from pathlib import Path
import yaml
import tempfile
import os

def _bigint_from_bytes(num_bytes):
    """
    See https://github.com/openai/gym/blob/master/gym/utils/seeding.py.
    """
    sizeof_int = 4
    padding = sizeof_int - len(num_bytes) % sizeof_int
    num_bytes += b'\x00' * padding
    int_count = int(len(num_bytes) / sizeof_int)
    unpacked = struct.unpack('{}I'.format(int_count), num_bytes)
    accum = 0
    for i, val in enumerate(unpacked):
        accum += 2 ** (sizeof_int * 8 * i) * val
    return accum

def seed_from_base_seed(base_seed):
    """
    Hash base seed to reduce correlation.
    """
    max_bytes = 4
    hash_func = hashlib.sha512(str(base_seed).encode('utf8')).digest()
    return _bigint_from_bytes(hash_func[:max_bytes])

def hash_from_dict(d):
    d_copy = deepcopy(d)
    del d_copy['train']['base_seed']
    d_string = json.dumps(d_copy, sort_keys=True)
    return int(hashlib.sha256(d_string.encode('utf8')).hexdigest()[:8], 16)

# Create a temporary YAML file with the required structure
temp_dir = tempfile.mkdtemp()
yaml_path = Path(temp_dir) / "test_hparams.yaml"

yaml_content = {
    'metadata': {
        'group_name': None,
        'hparamhash': 0
    },
    'agents': {
        'consumer_consumption_actions_array': None,
        'consumer_work_actions_array': None,
        'firm_actions_array': None,
        'government_actions_array': None
    },
    'train': {
        'base_seed': 42,
        'save_dir': None,
        'seed': None
    }
}

with open(yaml_path, 'w') as f:
    yaml.dump(yaml_content, f)

# Create simple numpy arrays for the action spaces
import numpy as np

consumption_choices = np.array([0.1, 0.5, 1.0, 2.0])
work_choices = np.array([0.0, 0.5, 1.0])
price_and_wage = np.array([0.8, 0.9, 1.0, 1.1, 1.2])
tax_choices = np.array([0.0, 0.1, 0.2, 0.3])

ARGS = {
    'hparams_path': yaml_path,
    'consumption_choices': consumption_choices,
    'work_choices': work_choices,
    'price_and_wage': price_and_wage,
    'tax_choices': tax_choices,
    'group_name': 'test_group'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, yaml — 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
check_if_ep_str_policy_exists Ran
ran on a synthesized input
salesforce/ai-economist/ai_economist/real_business_cycle/train_bestresponse.py
code served (permissive licence) · get_code("6a2b7a164a3d1480")
How it ran

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

from pathlib import Path
import tempfile
import os

# Create a temporary directory structure to simulate the rollout path
temp_dir = tempfile.mkdtemp()
rollout_path = Path(temp_dir)

# Create the directory structure that the function expects
saved_models_dir = rollout_path / 'saved_models'
saved_models_dir.mkdir(parents=True, exist_ok=True)

# Create a sample policy file to make the check return True
ep_str = "episode_100"
policy_file = saved_models_dir / f'consumer_policy_{ep_str}.pt'
policy_file.touch()

ARGS = {
    'rollout_path': rollout_path,
    'ep_str': ep_str
}
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 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
dynamic_import Ran
ran on a synthesized input
salesforce/warp-drive/warp_drive/training/models/factory.py
code served (permissive licence) · get_code("9c61b6cc4b60d9af")
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 type. 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 importlib
import sys
from types import ModuleType

torch = __import__('torch')
torch.manual_seed(0)

# Create a mock module structure for testing
mock_module = ModuleType('warp_drive.training.models.fully_connected')

# Define a simple model class in the mock module
class FullyConnected:
    def __init__(self):
        self.name = "FullyConnected"

# Add the class to the mock module
mock_module.FullyConnected = FullyConnected

# Register the mock module in sys.modules
sys.modules['warp_drive.training.models.fully_connected'] = mock_module
sys.modules['warp_drive'] = ModuleType('warp_drive')
sys.modules['warp_drive.training'] = ModuleType('warp_drive.training')
sys.modules['warp_drive.training.models'] = ModuleType('warp_drive.training.models')

# Create the model_pool dictionary with valid entries
model_pool = {
    'fully_connected': 'warp_drive.training.models.fully_connected:FullyConnected',
    'another_model': 'warp_drive.training.models.fully_connected:FullyConnected'
}

# Create ARGS dictionary with all parameters
ARGS = {
    'model_name': 'fully_connected',
    'model_pool': model_pool
}
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 type — a type output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a type 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
generate_random_actions Ran
ran on a synthesized input
salesforce/warp-drive/warp_drive/env_cpu_gpu_consistency_checker.py
code served (permissive licence) · get_code("443d55b2bf005c50")
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 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 numpy as np
from gym.spaces import Discrete, MultiDiscrete, Box

class MockEnv:
    def __init__(self):
        self.action_space = {
            "agent_0": Discrete(n=5),
            "agent_1": MultiDiscrete(nvec=[3, 4]),
            "agent_2": Box(low=np.array([-1.0, -2.0]), high=np.array([1.0, 2.0]), dtype=np.float32)
        }

env = MockEnv()
num_envs = 2
seed = 42

ARGS = {
    "env": env,
    "num_envs": num_envs,
    "seed": seed
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
gym, numpy — 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
hash_from_dict Ran
ran on a synthesized input
salesforce/ai-economist/ai_economist/real_business_cycle/experiment_utils.py
code served (permissive licence) · get_code("580e9b27b830eb25")
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 hashlib
import json
from copy import deepcopy

def hash_from_dict(d):
    d_copy = deepcopy(d)
    del d_copy['train']['base_seed']
    d_string = json.dumps(d_copy, sort_keys=True)
    return int(hashlib.sha256(d_string.encode('utf8')).hexdigest()[:8], 16)

ARGS = {
    'd': {
        'train': {
            'base_seed': 42,
            'learning_rate': 0.001,
            'epochs': 10,
            'batch_size': 32
        },
        'model': {
            'hidden_dim': 128,
            'num_layers': 2,
            'dropout': 0.1
        },
        'dataset': {
            'name': 'cifar10',
            'split': 'train'
        }
    }
}
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 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
recursive_obs_dict_to_spaces_dict Ran
ran on a synthesized input
salesforce/ai-economist/ai_economist/foundation/env_wrapper.py
code served (permissive licence) · get_code("a5f97a16853000a0")
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 numpy as np
from gym.spaces import Box, Dict, Discrete, MultiDiscrete

# Create a simple observation dictionary with various types of values
obs = {
    "agent_0": {
        "position": np.array([1.5, 2.3, 3.1]),
        "velocity": [0.1, 0.2],
        "scalar": 5.0,
        "int_val": 42
    },
    "agent_1": {
        "state": np.array([[1.0, 2.0], [3.0, 4.0]]),
        "info": 3.14
    },
    "shared": [1, 2, 3, 4]
}

ARGS = {
    "obs": obs
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
gym, 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 1 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
seed_from_base_seed Ran
ran on a synthesized input
salesforce/ai-economist/ai_economist/real_business_cycle/experiment_utils.py
code served (permissive licence) · get_code("799c662498b9093c")
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 hashlib
import struct

def _bigint_from_bytes(num_bytes):
    """
    See https://github.com/openai/gym/blob/master/gym/utils/seeding.py.
    """
    sizeof_int = 4
    padding = sizeof_int - len(num_bytes) % sizeof_int
    num_bytes += b'\x00' * padding
    int_count = int(len(num_bytes) / sizeof_int)
    unpacked = struct.unpack('{}I'.format(int_count), num_bytes)
    accum = 0
    for i, val in enumerate(unpacked):
        accum += 2 ** (sizeof_int * 8 * i) * val
    return accum

def seed_from_base_seed(base_seed):
    """
    Hash base seed to reduce correlation.
    """
    max_bytes = 4
    hash_func = hashlib.sha512(str(base_seed).encode('utf8')).digest()
    return _bigint_from_bytes(hash_func[:max_bytes])


ARGS = {
    "base_seed": 42
}
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 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

Also present in other papers' code

Of 7 samples lifted from this paper's linked repositories, 7 carry a function identity and 0 do not. Of the 7 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 7 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

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

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

Repositories linked to this paper

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

Abstract

Deep reinforcement learning (RL) is a powerful framework to train decision-making models in complex environments. However, RL can be slow as it requires repeated interaction with a simulation of the environment. In particular, there are key system engineering bottlenecks when using RL in complex environments that feature multiple agents with high-dimensional state, observation, or action spaces. We present WarpDrive, a flexible, lightweight, and easy-to-use open-source RL framework that implements end-to-end deep multi-agent RL on a single GPU (Graphics Processing Unit), built on PyCUDA and PyTorch. Using the extreme parallelization capability of GPUs, WarpDrive enables orders-of-magnitude faster RL compared to common implementations that blend CPU simulations and GPU models. Our design runs simulations and the agents in each simulation in parallel. It eliminates data copying between CPU and GPU. It also uses a single simulation data store on the GPU that is safely updated in-place. WarpDrive provides a lightweight Python interface and flexible environment wrappers that are easy to use and extend. Together, this allows the user to easily run thousands of concurrent multi-agent simulations and train on extremely large batches of experience. Through extensive experiments, we verify that WarpDrive provides high-throughput and scales almost linearly to many agents and parallel environments. For example, WarpDrive yields 2.9 million environment steps/second with 2000 environments and 1000 agents (at least 100x higher throughput compared to a CPU implementation) in a benchmark Tag simulation. As such, WarpDrive is a fast and extensible multi-agent RL platform to significantly accelerate research and development.

For agents

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

get_harvested_code_for_paper("2108.13976")
get_code_for_paper("2108.13976")
have("2108.13976")

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

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

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

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

Connect an agent — have() is free.