A record-based data runtime, focused on delivering extreme throughput and low latency
Project description
Loaderx
A compact and high-performance single-machine data loader designed for JAX/Flax.
Only Linux_amd64
Design Philosophy
loaderx is built around several core principles:
- A pragmatic approach that prioritizes minimal memory overhead and minimal dependencies.
- A strong focus on single-machine training workflows.
- We implement based on NumPy semantics, supporting Blosc2 backends.
- An immortal (endless) step-based data loader, rather than the traditional epoch-based design—better aligned with modern ML training practices.
Zsampler
Index Generator: a high-performance sampler implemented in Zig
- Sequential generation: indices are produced by traversing the index space in order.
- Sliding traversal: indices are obtained using a fixed-size sliding window. Note that in this case, the index space is treated as a circular queue to avoid truncation at the tail.
- Random generation: indices are sampled randomly from the index space.
- Global random: a set of samples is drawn randomly from the entire index space.
Convert a NumPy tensor to Blosc2
import blosc2
import numpy as np
np_arr = np.load('arr.npy',mmap_mode='r')
b2_arr = blosc2.asarray(np_arr, urlpath="arr.b2nd", mode="w")
Then, you can use b2_arr or load as b2_arr = blosc2.open("arr.b2nd")
Current Limitations
Currently, loaderx only supports single-host environments and does not yet support multi-host training.
Quick Start
from loaderx import Dataset, DataLoader
dataset = Dataset('train_data.b2nd')
labelset = Dataset('train_label.b2nd')
loader = DataLoader(dataset, labelset)
for i, batch in enumerate(loader):
if i >= 256:
break
print(batch['data'].shape)
print(batch['label'].shape)
Integrating with JAX/Flax
For practical integration examples, please refer to the Data2Latent repository
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 loaderx-0.4.1.tar.gz.
File metadata
- Download URL: loaderx-0.4.1.tar.gz
- Upload date:
- Size: 248.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cd4a9f6d286e03fe6a56aa80eac61eb94a56a308fd62976783ae3f28b91cb127
|
|
| MD5 |
a530687e68e8fa71563a46ecb6f87f60
|
|
| BLAKE2b-256 |
735173f0ca93d4bc48af5d007fca49ba89852a5a70d41194f431b98cf9d13d59
|
File details
Details for the file loaderx-0.4.1-py3-none-any.whl.
File metadata
- Download URL: loaderx-0.4.1-py3-none-any.whl
- Upload date:
- Size: 251.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
18d3ff397c8f2df7b9cd11b8528dbb1c212ef735626e21c247952ba0cad1fffd
|
|
| MD5 |
a1eaa73aca507964556caa8cf216c741
|
|
| BLAKE2b-256 |
e10db2e7d5f51e7fe0cecf7c0564764c93d9f8cba2b8614990858a53ad2134c2
|