Skip to main content

Lightweight distributed training for multi-dataset workflows on local hardware

Project description

hyrax

PyPI version Python 3.8+ License: MIT

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:

  1. Detects available GPUs and memory
  2. Schedules jobs to minimize resource contention
  3. Distributes datasets across workers
  4. Monitors training progress
  5. 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:

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 thats really cute

Project details


Download files

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

Source Distribution

hyrax_lib-0.2.1.tar.gz (11.6 kB view details)

Uploaded Source

Built Distribution

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

hyrax_lib-0.2.1-py3-none-any.whl (9.7 kB view details)

Uploaded Python 3

File details

Details for the file hyrax_lib-0.2.1.tar.gz.

File metadata

  • Download URL: hyrax_lib-0.2.1.tar.gz
  • Upload date:
  • Size: 11.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for hyrax_lib-0.2.1.tar.gz
Algorithm Hash digest
SHA256 c179a5dc9038a0692fa3574fccff189e7048ee28bc52268ffc9563db7a5ac9c2
MD5 6d7b886fe8f066bf0467c2255c37c287
BLAKE2b-256 cf7343586591351cafc2719ea5b9f37fc3959eddbc59b5571485b421b0df55e4

See more details on using hashes here.

Provenance

The following attestation bundles were made for hyrax_lib-0.2.1.tar.gz:

Publisher: publish.yml on BaljinderHothi/hyrax-lib

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

File details

Details for the file hyrax_lib-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: hyrax_lib-0.2.1-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

Hashes for hyrax_lib-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9926fe6b266517c6055c27416f820f9134baabf8d0cc93977affe650691b2a0d
MD5 0ef7a6a1919af42624c20f33ba926c6a
BLAKE2b-256 275224fddbb36d90fae7e864367d9638bb00e26b34a1c17271eab5214af20a7b

See more details on using hashes here.

Provenance

The following attestation bundles were made for hyrax_lib-0.2.1-py3-none-any.whl:

Publisher: publish.yml on BaljinderHothi/hyrax-lib

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

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page