Skip to main content

echo

CI Docs PyPI Python

A very fast distributed replay buffer for reinforcement learning. The core is a lockfree, pre-allocated Rust ring buffer. Batches come back to Python as zero-copy numpy views, with the GIL released while you wait for the next batch.

Install

pip install id-echo

What it does

Distributed RL training pipelines typically have many hundreds or even thousands of rollout workers producing samples and a small number of learners consuming batches of them. echo exists because I found that data transfer and stacking was often the bottleneck of these systems. echo receives individual samples, assembles them into fixed-size batches, and serves those batches with minimal copying and no Python-side contention.

The core is a lockfree ring buffer written in Rust. Clients push samples into queues over the network, a pool of drainers moves data into the ring buffer, and the consumer pulls full batches out. Pytrees are flattened with optree on the client and unflattened on the python server. Rust itself is pytree-agnostic.

Features

  • Lockfree ring buffer, pre-allocated (no copies after ingress)
  • Extensible transports, ships with a custom TCP protocol (extendible to RDMA, gRPC, etc)
  • Pytree-shaped samples (nested dicts/tuples of numpy arrays) via optree
  • Zero-copy batches: sample() returns numpy views into Rust-owned memory
  • GIL released while waiting for batches
  • FIFO sampling (with more strategies planned)
  • Detailed metrics exposed per batch
  • Optional CUDA host-memory pinning so H2D copies are real DMA transfers, not driver-staged

Example

A typical setup runs the server on the learner node and clients on rollout workers (separate processes or machines). See more detailed examples in the documentation.

Learner side (one process):

import numpy as np
from echo import Server, TcpTransport

example = {
    "obs": np.zeros((4,), dtype=np.float32),
    "reward": np.zeros((1,), dtype=np.float32),
}

server = Server(example, batch_size=32, transport=TcpTransport(port=50051))
server.start()

for sample in server.dataset_iter():
    batch = sample.batch  # {"obs": (32, 4), "reward": (32, 1)}
    # ... feed to training step

Rollout worker side (one or many processes):

import numpy as np
from echo import TcpClient

example = {
    "obs": np.zeros((4,), dtype=np.float32),
    "reward": np.zeros((1,), dtype=np.float32),
}

client = TcpClient("localhost", 50051, example)
for _ in range(1000):
    client.send({
        "obs": np.random.randn(4).astype(np.float32),
        "reward": np.array([1.0], dtype=np.float32),
    })
client.close()

For in-process use (tests, benchmarks), omit the transport and call server.submit(data) directly.

Development

cargo test                       # Rust tests
uv run pytest python/tests/ -v   # Python tests
just bench                       # Benchmarks
just                             # List all commands

Name

The name is a nod to Reverb, DeepMind's RL replay buffer that inspired this project, an echo being a faster, simpler kind of reverberation.

Metadata

Release files for id-echo 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for id-echo 0.2.1
File Size Uploaded
id_echo-0.2.1.tar.gz 230.4 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for id-echo 0.2.1
File
id_echo-0.2.1-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.10 abi3 Linux glibc 2.17+ x86-64 Details
id_echo-0.2.1-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.10 abi3 Linux glibc 2.17+ ARM64 Details
id_echo-0.2.1-cp310-abi3-macosx_11_0_arm64.whl CPython 3.10 abi3 macOS 11.0+ ARM64 Details
id_echo-0.2.1-cp310-abi3-macosx_10_12_x86_64.whl CPython 3.10 abi3 macOS 10.12+ x86-64 Details

Total release size: 2.3 MB

Release files / id_echo-0.2.1.tar.gz

Download URL id_echo-0.2.1.tar.gz
Size 230.4 kB
Tags Source
SHA-256 checksum
How to use checksums
44ae5848f1f531c08540fad27b60ef180afe1b1408982da347587a5c33c08da9
BLAKE2b-256 checksum
How to use checksums
a9fb03bd793e9d5add97c788cf4db77aa8e384a3edeb07a5335ba6c3eae0a426
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 29, 2026.

Transparency log

Release files / id_echo-0.2.1-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL id_echo-0.2.1-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 541.0 kB
Tags CPython 3.10 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
307561d9ad5b4c6620100216e5b134a1062f73e39a6bc6852bb034101b0c1d8b
BLAKE2b-256 checksum
How to use checksums
14116e05a8707bfc794004b10ad82e2e00ec1fd17857740de775c1fb3c15a500
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 29, 2026.

Transparency log

Release files / id_echo-0.2.1-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL id_echo-0.2.1-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 533.9 kB
Tags CPython 3.10 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
aa06bdd13ea7953b6ce00d7a224ab669074ea3e6030cb7c1c6625844a3aaa0c3
BLAKE2b-256 checksum
How to use checksums
6b66f183fcff57622c2806c6009fef8fd167ba0fd6c48916ef90965b837ec90a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 29, 2026.

Transparency log

Release files / id_echo-0.2.1-cp310-abi3-macosx_11_0_arm64.whl

Download URL id_echo-0.2.1-cp310-abi3-macosx_11_0_arm64.whl
Size 474.1 kB
Tags CPython 3.10 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
a7170ad153a156a449bda1a21f38af8b692ff504d5bfc28112a29231e68c34b5
BLAKE2b-256 checksum
How to use checksums
8fb4c822f6471f08730d5c07e4fe5668ba12bf673dd3d2920b134569914d1e34
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 29, 2026.

Transparency log

Release files / id_echo-0.2.1-cp310-abi3-macosx_10_12_x86_64.whl

Download URL id_echo-0.2.1-cp310-abi3-macosx_10_12_x86_64.whl
Size 478.7 kB
Tags CPython 3.10 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
70d5fc6055d2c3e02592a9ad8a2e5d2d03336400ffc98b85a9749b7f62579a6f
BLAKE2b-256 checksum
How to use checksums
250c8a30efe5274694222fd249ead2ee600495c75ca5c477bff689d85f6f3363
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 29, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.2.1 This release

5 release files

0.2.0

5 release files

0.1.1

5 release files

0.1.0

5 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page