A zero-RAM, multi-modal, sharded binary dataset manager
Project description
Roxxel 🚀
Zero-RAM, JAX-Centric Dataloading, Streaming, and Asynchronous Checkpointing & Logging Toolkit
Roxxel is an ultra-lightweight, zero-bloat, high-performance toolkit designed specifically for large-scale JAX & Flax NNX deep learning training pipelines (such as State Space Models, Transformers, and SSMs like Xenron).
By combining POSIX memory-mapped dataset sharding, high-performance async logging, and Flax NNX topology-agnostic asynchronous checkpointing, Roxxel provides a unified, framework-native pipeline that does away with heavy, over-engineered training frameworks.
🌟 The Four Pillars of Roxxel
1. Zero-RAM Sharded Block Dataloader (roxxel.Roxxel)
- OS-Level Memory Mapping: Maps multi-terabyte datasets directly into virtual memory via the operating system's kernel page cache using
numpy.memmap. Consumes exactly 0 bytes of Python RAM for storage. - Dynamic Dtype Auto-Detection: Automatically detects the data representation (e.g.
int32token IDs,float32arrays, oruint8bytes) on compilation and stores it in a backward-compatible 32-byte footer (ROXXEL02format). - Precise O(1) Fast-Forwarding: Instantly resumes streaming from any checkpointed step in under 1 millisecond using exact byte offsets—completely skipping the need to execute dummy fast-forward loops.
2. JAX-Native Streaming (dataset.stream())
- Zero Double-Copy Overhead: Automatically chunks, shuffles, and places batches directly onto JAX device layouts (
jax.device_put) using your Named Sharding Mesh. Avoids JAX default-device materialization bottlenecks and GPU/TPU OOM spikes. - Dynamic Step Calculation: The stream returns a custom
RoxxelStreamobject which natively exposeslen(stream)—enabling you to instantly align learning rate schedules and progress bars.
3. Asynchronous Model Checkpointing (roxxel.checkpoint.Checkpointer)
- Zero-Latency Async Storage: Offloads state serialization to background threads using Orbax Checkpoint Manager, allowing your GPU/TPU accelerators to keep training without waiting for disk writes.
- NNX Topology Agnostic: Restores state PyTrees natively using abstract template evaluation, decoupling model architecture updates from saved weights.
- Best-Loss Tracking: Automatically monitors metric payloads and preserves the checkpoint achieving the lowest training loss (
best_mode='min').
4. Asynchronous JAX-Aware Logging (roxxel.Logger)
- Zero-Overhead Async Execution: Spawns a background thread queue (
QueueListener) to process writes to standard output and disk files asynchronously. Zero interference with critical GPU/TPU execution. - Multi-Host TPU/GPU Pod Safety: Automatically detects JAX rank and restricts logging to Rank 0, completely avoiding log corruption and process conflicts across multi-node pre-training clusters.
- Atomic Exception Traceback Capture: Implements robust context-manager (
withstatement) logic. If a TPU OOMs, crashes, or is forcefully interrupted, the queue instantly flushes to the log file and records the exact stack trace before bubbling the error up.
📦 Installation
Roxxel can be installed via pip directly from PyPI.
To install the core dataloader and async logging engine only:
pip install roxxel
To install the JAX-native asynchronous checkpointing extensions:
pip install roxxel[checkpoint]
🚀 End-to-End JAX/Flax NNX Training Cookbook
For a complete, real-world cookbook showing how Roxxel integrates data compilation, sharded streaming, asynchronous system logging, JAX Named Sharding, and Orbax NNX checkpointing into a single training pipeline, please refer to the Roxxel Tutorial Documentation.
🔄 API Evolution: The Old Way vs. The New Fused Way
Roxxel has been completely re-engineered to provide unified, non-blocking logs alongside zero-copy sharding, memory mapping, and background Orbax checkpointing for distributed deep learning.
| Feature | The Old Way (v0.1.0) | The New Fused Way (v0.5.x) |
|---|---|---|
| Block Compilation | Required wrapping writers in a separate external compiler class (RoxxelBlockCompiler) to manually group and pad inputs. |
100% Fused & Native: The rox.write() API consumes arbitrary string/byte/numpy generators, automatically chunks them, handles padding, and writes to disk in one call. |
| Data Types on Disk | Restricted entirely to byte-level representations (uint8). Multi-byte dtypes (like tokenized int32 IDs) were corrupted/split. |
Dynamic Dtype Metadata: Automatically detects the datatype (e.g. int32, float32) on write, stores it in a 32B footer (ROXXEL02), and decodes perfectly on read. |
| Shard Management | Users had to write manual file rotation loops, file naming schemes, and offset tables to handle large datasets. | Zero-Config Sharding: Specify a glob path (e.g., wiki_*.rox) and max_shard_bytes. Roxxel handles shard rotation and virtualizes them into one contiguous list view. |
| DL / JAX Streaming | Required writing custom shuffling code, buffer management, and tedious boilerplate jax.device_put pipelines. |
Unified Causal Streaming: The dataset.stream() API handles globally shuffled batching, O(1) step resumption, and automatic JAX sharded device placement with zero double-copy overhead. |
| Model Checkpointing | Standard training loops required manual pickle, custom JSON savers, or synchronous JAX disk blocks. |
Asynchronous Orbax (Checkpointer): Flax NNX model weights/optimizers are serialized concurrently in background threads with auto-computed best-loss tracking. |
| Distributed System Logging | Standard print statements caused GPU pipeline bottlenecks and multi-host log overlapping. | Asynchronous Logger (Logger): Queue-based async writing offloaded to background threads with multi-host rank-zero filters and atomic exception traceback capturing. |
⚖️ License
MIT License. Feel free to use, modify, and distribute.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file roxxel-0.7.1.tar.gz.
File metadata
- Download URL: roxxel-0.7.1.tar.gz
- Upload date:
- Size: 242.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cf50832c74e3b86dd2d7cdabdc31093a7efeb0d0eb26744653c6c52f737fec63
|
|
| MD5 |
8fc9b3ccc7b235fcb597780176376473
|
|
| BLAKE2b-256 |
6057fcda70abfe6d4e1f42a234e2ed3c939b5795298540229075148a29d8880a
|
Provenance
The following attestation bundles were made for roxxel-0.7.1.tar.gz:
Publisher:
publish.yml on anon160/Roxxel
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
roxxel-0.7.1.tar.gz -
Subject digest:
cf50832c74e3b86dd2d7cdabdc31093a7efeb0d0eb26744653c6c52f737fec63 - Sigstore transparency entry: 1756165551
- Sigstore integration time:
-
Permalink:
anon160/Roxxel@b48e3507c7f812b0ee9f41126d8e8f552cd05e98 -
Branch / Tag:
refs/tags/v0.7.1 - Owner: https://github.com/anon160
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@b48e3507c7f812b0ee9f41126d8e8f552cd05e98 -
Trigger Event:
push
-
Statement type:
File details
Details for the file roxxel-0.7.1-py3-none-any.whl.
File metadata
- Download URL: roxxel-0.7.1-py3-none-any.whl
- Upload date:
- Size: 21.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
349bfedb8cf771a8751a60b782224c4f0fddbc1b4a67057d737c51d414a2961c
|
|
| MD5 |
f0fe41e56217734402fb6c8a2fec67f4
|
|
| BLAKE2b-256 |
77636a44158d7e7db9ba8216c8b256169ab96452524ba1599004e08f65a14f17
|
Provenance
The following attestation bundles were made for roxxel-0.7.1-py3-none-any.whl:
Publisher:
publish.yml on anon160/Roxxel
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
roxxel-0.7.1-py3-none-any.whl -
Subject digest:
349bfedb8cf771a8751a60b782224c4f0fddbc1b4a67057d737c51d414a2961c - Sigstore transparency entry: 1756165593
- Sigstore integration time:
-
Permalink:
anon160/Roxxel@b48e3507c7f812b0ee9f41126d8e8f552cd05e98 -
Branch / Tag:
refs/tags/v0.7.1 - Owner: https://github.com/anon160
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@b48e3507c7f812b0ee9f41126d8e8f552cd05e98 -
Trigger Event:
push
-
Statement type: