Lightweight distributed training for multi-dataset workflows on local hardware
Project description
hyrax
Lightweight distributed training for multi-dataset workflows on local hardware.
_
| |__ _ _ _ __ __ ___ __
| '_ \| | | | '__/ _` \ \/ /
| | | | |_| | | | (_| |> <
|_| |_|\__, |_| \__,_/_/\_\
|___/
Overview
Hyrax enables concurrent training of models across multiple datasets on local multi-GPU setups without the complexity of Kubernetes or distributed computing frameworks. It automatically detects available hardware, intelligently schedules jobs, and monitors training progress.
Key features:
- Automatic GPU detection and allocation (CUDA, MPS, CPU)
- Intelligent job scheduling with bin-packing optimization
- Real-time training monitoring via TensorBoard
- Dataset-agnostic interface (Minari, HDF5, pickle, custom loaders)
- Zero-configuration deployment for local machines
- Offline-first design
Installation
pip install hyrax-lib
Requirements:
- Python 3.8+
- PyTorch 2.0+
- CUDA-capable GPU (optional, CPU and Apple Silicon supported)
Quick Start
Train a behavioral cloning model on three MuJoCo datasets concurrently:
from hyrax import DistributedTrainer
import minari
trainer = DistributedTrainer(
model=BehavioralCloningModel,
datasets=[
"mujoco/humanoid/expert-v0",
"mujoco/halfcheetah/expert-v0",
"mujoco/hopper/expert-v0"
],
dataset_loader=minari.load_dataset,
)
results = trainer.train(epochs=200)
Hyrax automatically:
- Detects available GPUs and memory
- Schedules jobs to minimize resource contention
- Distributes datasets across workers
- Monitors training progress
- Returns aggregated results
Usage
Basic Usage
from hyrax import DistributedTrainer
trainer = DistributedTrainer(
model=YourModel,
datasets=["dataset1", "dataset2", "dataset3"]
)
results = trainer.train(epochs=100)
Custom Dataset Loaders
def load_custom_data(path):
# your loading logic
return dataset
trainer = DistributedTrainer(
model=YourModel,
datasets=["path/to/data1", "path/to/data2"],
dataset_loader=load_custom_data
)
Pre-loaded Datasets
datasets = [load_data(x) for x in paths]
trainer = DistributedTrainer(
model=YourModel,
datasets=datasets # already loaded
)
Memory Estimation
Provide memory estimates for better scheduling:
trainer = DistributedTrainer(
model=YourModel,
datasets=datasets,
job_size_estimates=[2*1024**3, 3*1024**3, 2*1024**3] # bytes
)
Monitoring
Hyrax automatically logs training metrics to TensorBoard:
tensorboard --logdir=runs
Navigate to http://localhost:6006 to view real-time training progress across all workers.
Architecture
Hyrax consists of four main components:
- ResourceManager: Detects GPUs, CPUs, and available memory
- LoadBalancer: Schedules jobs using bin-packing optimization
- TrainingWorker: Executes training on assigned hardware
- TrainingMonitor: Logs metrics and progress via TensorBoard
Supported Backends
- CUDA: NVIDIA GPUs
- MPS: Apple Silicon (M1/M2/M3)
- CPU: Fallback for systems without GPUs
When to Use Hyrax
Good for:
- Training the same model on multiple datasets simultaneously
- Local multi-GPU workstations
- Offline training environments
- Rapid prototyping and experimentation
Not suitable for:
- Multi-node distributed training (use Ray, DeepSpeed, or Kubernetes)
- Model parallelism across GPUs
- Production inference serving
Examples
See examples/ for complete working examples:
mujoco_example.py: Behavioral cloning with Minari datasetscustom_dataset_example.py: Using custom data loadersbasic_usage.py: Minimal example
Documentation
Contributing
Contributions welcome! Please feel free to submit a Pull Request.
License
MIT License - see LICENSE for details.
Citation
If you use Hyrax in your research, please cite:
@software{hyrax2026,
author = {Hothi, Baljinder},
title = {Hyrax: Lightweight Distributed Training for Local Hardware},
year = {2026},
url = {https://github.com/BaljinderHothi/hyrax-lib}
}
Acknowledgments
Named after the rock hyrax, a small mammal that resembles a rodent but is actually most closely related to elephants - like this library, small and simple but capable of heavy lifting.
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 hyrax_lib-0.2.0.tar.gz.
File metadata
- Download URL: hyrax_lib-0.2.0.tar.gz
- Upload date:
- Size: 11.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b0c5a66e4df0a2d968dd7b9b9a0441c144806fb7c50f8b3ba28678e6345c0019
|
|
| MD5 |
f8d1220844943d49ddc5387cae934724
|
|
| BLAKE2b-256 |
24bc0a519db356038b906b734e30a0aae49b39c46f738656f8ec3ed1b4b67d40
|
Provenance
The following attestation bundles were made for hyrax_lib-0.2.0.tar.gz:
Publisher:
publish.yml on BaljinderHothi/hyrax-lib
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
hyrax_lib-0.2.0.tar.gz -
Subject digest:
b0c5a66e4df0a2d968dd7b9b9a0441c144806fb7c50f8b3ba28678e6345c0019 - Sigstore transparency entry: 854409639
- Sigstore integration time:
-
Permalink:
BaljinderHothi/hyrax-lib@c588b2ab6c0181ed0560b3caa0c11b8fc41fe350 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/BaljinderHothi
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@c588b2ab6c0181ed0560b3caa0c11b8fc41fe350 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file hyrax_lib-0.2.0-py3-none-any.whl.
File metadata
- Download URL: hyrax_lib-0.2.0-py3-none-any.whl
- Upload date:
- Size: 9.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ed05e289379e3b1453f3a8fa542562a0b0ac8a5b9fa80603b1d43b587eb280c9
|
|
| MD5 |
abb31080e27436171cef0272ef1fbaf7
|
|
| BLAKE2b-256 |
17c6c67301875172652e0e20843cacd98d511fb09f5c2a59a323010c44b0c1ac
|
Provenance
The following attestation bundles were made for hyrax_lib-0.2.0-py3-none-any.whl:
Publisher:
publish.yml on BaljinderHothi/hyrax-lib
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
hyrax_lib-0.2.0-py3-none-any.whl -
Subject digest:
ed05e289379e3b1453f3a8fa542562a0b0ac8a5b9fa80603b1d43b587eb280c9 - Sigstore transparency entry: 854409641
- Sigstore integration time:
-
Permalink:
BaljinderHothi/hyrax-lib@c588b2ab6c0181ed0560b3caa0c11b8fc41fe350 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/BaljinderHothi
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@c588b2ab6c0181ed0560b3caa0c11b8fc41fe350 -
Trigger Event:
workflow_dispatch
-
Statement type: