Skip to main content

tinyray

A minimal, actor-only Ray for ML experiments. Rust core, Python API.

import tinyray as tr

@tr.remote(num_gpus=1, max_restarts=3)
class Rollout:
    def __init__(self, cfg):
        self.env = make_env(cfg)
    def step(self):
        return self.env.rollout()          # ~10 MB

rollouts = tr.create_actors(Rollout, cfg, count=32)   # atomic, all or nothing
refs = [r.step.remote() for r in rollouts]            # returns immediately
ready, stragglers = tr.wait(refs, num_returns=24)
learner.update.remote(ready)                          # data goes rollout -> learner

What it is, and is not

Built for one workload: RL rollouts and hyperparameter sweeps, ~32 actors, ~10 MB payloads, ~200 ms per call.

  • Actors only. No stateless tasks. ML workers hold models and CUDA contexts.
  • HTTP for control and results. At 200 ms per call a ~200 µs round trip is 0.1% overhead, and every message is inspectable with ordinary tools.
  • No object store. A result stays in the actor that produced it; consumers fetch it directly. No plasma, no spilling, no distributed refcounting.
  • NCCL for weights. tinyray implements no collective transport at all. It assigns ranks and manages the epoch state machine; torch.distributed moves the bytes.

Design notes, measurements and the decisions the implementation forced us to revise are kept with the source rather than published here.

Why Rust

An actor running a 200 ms training step holds the GIL. If the data path were Python, it could not serve result fetches during that time, and 32 actors fetching from each other would degrade to serial. The Rust core removes that coupling entirely:

10 MB decode idle 4 GIL-bound threads slowdown
native thread (the real serving path) 0.37 ms 0.38 ms 1.04x
initiated from Python 0.75 ms 36.7 ms 49x

Which also yields an architectural rule: the serving path must be driven by tokio, never by a Python-side loop. Work initiated from Python inherits GIL scheduling latency no matter how little of it runs in the interpreter, so /task/fetch never enters the interpreter at all.

Install

pip install tinyray

Wheels are built per interpreter version (3.9-3.13) for Linux and macOS on both x86_64 and aarch64. There is no abi3 build: the buffer protocol that makes results zero-copy is absent from the limited API on older interpreters, and version-specific wheels are a cheap price for it.

The package ships py.typed and hand-written stubs for the Rust extension, so type checkers see the full API.

From source

Requires a Rust toolchain.

python -m venv .venv
.venv/bin/pip install -e ".[dev]"
.venv/bin/maturin develop --release
pre-commit install

Tests

./scripts/test.sh                    # everything
cargo test --workspace               # 120 Rust tests
pytest tests/ -q                     # 216 Python tests
pytest benchmarks/ -q -s -m bench
python scripts/mutate.py             # 19 mutants: do the tests actually work?

Testing the tests

A green suite proves nothing about the tests. Two mechanisms keep them honest:

  • tests/test_suite_quality.py -- structural checks encoding the six blind spots that let real bugs through: unwired modules, timing constants that only ever run at their production value, options accepted but ignored, collapsed error taxonomies, untested lock branches, and design claims with no test.
  • scripts/mutate.py -- deliberately breaks 19 invariants and reports which ones the suite catches. It has already found two tests that passed while the behaviour they claimed to check was disabled.

Each check exists because a real bug got through in that exact shape.

Development

pre-commit install wires up the gates that CI also runs:

hook what it guards
ruff check / ruff format Python lint and formatting
cargo fmt / cargo clippy -D warnings Rust formatting and lint
mypy the public API's annotations, checked against the stubs

Releases are cut by pushing a v* tag; .github/workflows/release.yml runs the full suite, builds the wheel matrix and an sdist, and publishes to PyPI through a trusted publisher. workflow_dispatch targets TestPyPI by default so a dry run cannot reach the real index by accident.

Operations

tinyray status 127.0.0.1:41234 127.0.0.1:41235   # what is each actor doing?
tinyray introspect 127.0.0.1:41234               # raw report
tinyray health 127.0.0.1:41234

status calls out stalled callers, evictions, backpressure and stragglers, because "which actor is stuck, and on what?" is the question that dominates distributed ML debugging.

Layout

crates/tinyray-core/      wire protocol, framing, identifiers
crates/tinyray-runtime/   store, ordered queue, transport, cluster, collective, shm
crates/tinyray-py/        PyO3 bindings (all unsafe lives in buffers.rs)
python/tinyray/           API, serde, launcher, head, collective, pool, CLI

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tinyray-0.0.1.tar.gz (104.8 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

tinyray-0.0.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

tinyray-0.0.1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.1 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ ARM64

tinyray-0.0.1-cp313-cp313-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl (2.0 MB view details)

Uploaded CPython 3.13macOS 10.12+ universal2 (ARM64, x86-64)macOS 10.12+ x86-64macOS 11.0+ ARM64

tinyray-0.0.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

tinyray-0.0.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.1 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ ARM64

tinyray-0.0.1-cp312-cp312-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl (2.0 MB view details)

Uploaded CPython 3.12macOS 10.12+ universal2 (ARM64, x86-64)macOS 10.12+ x86-64macOS 11.0+ ARM64

tinyray-0.0.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

tinyray-0.0.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.1 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ ARM64

tinyray-0.0.1-cp311-cp311-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl (2.0 MB view details)

Uploaded CPython 3.11macOS 10.12+ universal2 (ARM64, x86-64)macOS 10.12+ x86-64macOS 11.0+ ARM64

tinyray-0.0.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

tinyray-0.0.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.1 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ ARM64

tinyray-0.0.1-cp310-cp310-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl (2.0 MB view details)

Uploaded CPython 3.10macOS 10.12+ universal2 (ARM64, x86-64)macOS 10.12+ x86-64macOS 11.0+ ARM64

tinyray-0.0.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64

tinyray-0.0.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.1 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ ARM64

tinyray-0.0.1-cp39-cp39-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl (2.0 MB view details)

Uploaded CPython 3.9macOS 10.12+ universal2 (ARM64, x86-64)macOS 10.12+ x86-64macOS 11.0+ ARM64

File details

Details for the file tinyray-0.0.1.tar.gz.

File metadata

  • Download URL: tinyray-0.0.1.tar.gz
  • Upload date:
  • Size: 104.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for tinyray-0.0.1.tar.gz
Algorithm Hash digest
SHA256 10f7eb60d1dbd1c2af372e55c1132e26e7b59f955eb5ac7fe43b6069b78d1cf2
MD5 de5987fb3396948efa4bf943b60f8b08
BLAKE2b-256 4df047b72001ec2889518a8855044b0af94a08306ddff34e9c6ad77a32f2d72c

See more details on using hashes here.

Provenance

The following attestation bundles were made for tinyray-0.0.1.tar.gz:

Publisher: release.yml on HSPK/tinyray

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file tinyray-0.0.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for tinyray-0.0.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 e982ee01517e014a9c595510fce8e70c9d0501e479e68f40b558c1efbbc94979
MD5 f22a94c44232c411bba661f5f8d0156c
BLAKE2b-256 bfa8848acda763c32cfad8a4ac818c3b2c44a6ea2a3f76d3559c34d9d70d0202

See more details on using hashes here.

Provenance

The following attestation bundles were made for tinyray-0.0.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: release.yml on HSPK/tinyray

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file tinyray-0.0.1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for tinyray-0.0.1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 fa3e67dcbb0ec91dddd78495dcbd88976069083e8ab7c065a6fcc51db14afed3
MD5 624efeb4709baed3bc543c844392ec35
BLAKE2b-256 1b3f72d95f7c19af380022cac4699b943e88aaaa06ac08aec2963538c49f6ed3

See more details on using hashes here.

Provenance

The following attestation bundles were made for tinyray-0.0.1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: release.yml on HSPK/tinyray

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file tinyray-0.0.1-cp313-cp313-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl.

File metadata

File hashes

Hashes for tinyray-0.0.1-cp313-cp313-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm Hash digest
SHA256 62aef15852a3440f3741fdfeadfd6326ee961f776dad8face728631d053eb725
MD5 6a8854886be9e6420aaba47b445995d8
BLAKE2b-256 600e32b499880dfade9eadceed65c19de53f8ba78b1c7d3c84606ad10023ade3

See more details on using hashes here.

Provenance

The following attestation bundles were made for tinyray-0.0.1-cp313-cp313-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl:

Publisher: release.yml on HSPK/tinyray

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file tinyray-0.0.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for tinyray-0.0.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 d1420b97ede93a9c887879be1c7d4376bf255bf41a108320534787d8d90657e9
MD5 c99cc1a977805031bb1b32c9ef570b46
BLAKE2b-256 d1c68b3cad9a7fe2ea69c7166c150522e73ae5a635bc57eb4a463226345bb0dd

See more details on using hashes here.

Provenance

The following attestation bundles were made for tinyray-0.0.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: release.yml on HSPK/tinyray

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file tinyray-0.0.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for tinyray-0.0.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 9d097c6277a23dd968870adff6d6c82a1c02ace3370c8a0b07e317f3f46f7a58
MD5 0c38a1974769a811e8a07a36df66de56
BLAKE2b-256 2d1407f37ce0401f1d7c08483cd5fbcdae317cacd3dd4014dd24b79c1f826c90

See more details on using hashes here.

Provenance

The following attestation bundles were made for tinyray-0.0.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: release.yml on HSPK/tinyray

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file tinyray-0.0.1-cp312-cp312-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl.

File metadata

File hashes

Hashes for tinyray-0.0.1-cp312-cp312-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm Hash digest
SHA256 524a8b68871dbbd984c036a521f6cbd47d09bbd199e13953fa546e8fd6c8f42e
MD5 6de4af3ef1022d4e5a7ac8d1aa341e7e
BLAKE2b-256 e6f4440d985919e1c1cfdb61dcd2eb5805ceb2cb59e85f6a18ed1f77865ad656

See more details on using hashes here.

Provenance

The following attestation bundles were made for tinyray-0.0.1-cp312-cp312-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl:

Publisher: release.yml on HSPK/tinyray

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file tinyray-0.0.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for tinyray-0.0.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 f5c08ff621aaaddf0f7edddf3df813445190bc446502289b56b99bf0f8f89a37
MD5 9a2aff1ee78bd748ab8c0bcff4e1dd4a
BLAKE2b-256 af63003dc413d1bbfd5ead1f19c99323b7cc9caf99006fc84ac6486ce89c95db

See more details on using hashes here.

Provenance

The following attestation bundles were made for tinyray-0.0.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: release.yml on HSPK/tinyray

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file tinyray-0.0.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for tinyray-0.0.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 632fc676a61639d300a339d26dd85260af33c7ac34d30492c551575cbecd26d3
MD5 b740e2b29d4dc7d5cca0bbfdc168566b
BLAKE2b-256 b9f811f32934b31b56fc9be90cd6a4c125d6d8c57870063fa8805dee150c269d

See more details on using hashes here.

Provenance

The following attestation bundles were made for tinyray-0.0.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: release.yml on HSPK/tinyray

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file tinyray-0.0.1-cp311-cp311-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl.

File metadata

File hashes

Hashes for tinyray-0.0.1-cp311-cp311-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm Hash digest
SHA256 21d019493c06fe008f4ffc923437857f836997fc610e5997d6d58df5e80fa6f4
MD5 b2499d936f9582c90e2959a1bd432c30
BLAKE2b-256 5eb31f07cee83d8bcfb33280a57cc2bd52c66b2e8d3810c1aee4b064cbf1c8ae

See more details on using hashes here.

Provenance

The following attestation bundles were made for tinyray-0.0.1-cp311-cp311-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl:

Publisher: release.yml on HSPK/tinyray

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file tinyray-0.0.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for tinyray-0.0.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 05bca7c9592aac7b48723db87ae7138718b72ab572b258728c6f482753ed8200
MD5 077f45ae2862946dc3e8ceb302d39a51
BLAKE2b-256 adc83687ddc684593084dc9d2bc8103503fafd92324434f6e0db82b6cd43075d

See more details on using hashes here.

Provenance

The following attestation bundles were made for tinyray-0.0.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: release.yml on HSPK/tinyray

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file tinyray-0.0.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for tinyray-0.0.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 76f76df7c8b84ac7f8b74a247efb82fca974fcda361cf8112934f0d0f96346bb
MD5 c82febf0bfddb81a9b8bca68a3fa00df
BLAKE2b-256 11295094788aaadae3da01b3750f95e51e6fbc5fb0269f8d38967f65d6a51306

See more details on using hashes here.

Provenance

The following attestation bundles were made for tinyray-0.0.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: release.yml on HSPK/tinyray

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file tinyray-0.0.1-cp310-cp310-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl.

File metadata

File hashes

Hashes for tinyray-0.0.1-cp310-cp310-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm Hash digest
SHA256 b11abfe8eb4e797cff2917647603effb4960ac005382abd4b778c2e7e0d07750
MD5 2d96f71aa7690a3b02398d214ebb4dac
BLAKE2b-256 ec63b481dd60ec82308717e2381de5d5e290fcb8c1bb81226db1f1c4a2488f4d

See more details on using hashes here.

Provenance

The following attestation bundles were made for tinyray-0.0.1-cp310-cp310-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl:

Publisher: release.yml on HSPK/tinyray

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file tinyray-0.0.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for tinyray-0.0.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 a4316c6b805c3d86cd1705528a550ae8d82830a6e576e108fb3358e116cf9128
MD5 324367cc0c7418917b9b299457d1f71e
BLAKE2b-256 2270d10a26580d8d53380b1c45892531d8e2c2fe523cbf53f996a6d63216b5a4

See more details on using hashes here.

Provenance

The following attestation bundles were made for tinyray-0.0.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: release.yml on HSPK/tinyray

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file tinyray-0.0.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for tinyray-0.0.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 37ac32f75739248c6c3d66c4cca44cec5244e378658b1d546b590ff56a602b7a
MD5 4ba84e7cabb17a4c812997a650e39585
BLAKE2b-256 0e1a62c85aa4934fa5b8d43285654aa0f06aac75ed6628ce3a756015e5a1e544

See more details on using hashes here.

Provenance

The following attestation bundles were made for tinyray-0.0.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: release.yml on HSPK/tinyray

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file tinyray-0.0.1-cp39-cp39-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl.

File metadata

File hashes

Hashes for tinyray-0.0.1-cp39-cp39-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm Hash digest
SHA256 14cfe8db616889d40dabce75bfaf47c873764547dd2d8f362406b150ca0752f0
MD5 9aeea16a87f819967a67116b3c20b5d9
BLAKE2b-256 4cd0b820b592f5ee6115b112174e5418beb08f7d1f5db7b2e828d8d058a27b9f

See more details on using hashes here.

Provenance

The following attestation bundles were made for tinyray-0.0.1-cp39-cp39-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl:

Publisher: release.yml on HSPK/tinyray

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

0.13.0

13 files

0.12.0

13 files

0.11.0

13 files

0.10.0

13 files

0.9.1

13 files

0.9.0

13 files

0.8.1

13 files

0.7.1

13 files

0.6.1

13 files

0.6.0

13 files

0.5.0

13 files

0.4.1

13 files

0.4.0

13 files

0.3.0

13 files

0.2.1

16 files

0.2.0

16 files

0.1.0

16 files

0.0.3

16 files

0.0.2

16 files

This release

0.0.1 This release

16 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