Skip to main content

Distributed training for your local machine

Project description

hyrax-lib

Distributed training for your local machine. No Kubernetes, no cloud, all offline locally

 _                            
| |__  _   _ _ __ __ ___  __ 
| '_ \| | | | '__/ _` \ \/ / 
| | | | |_| | | | (_| |>  <  
|_| |_|\__, |_|  \__,_/_/\_\ 
       |___/

What this is

I kept launching multiple training jobs manually across my GPUs and thought "why isn't there something simple for this?" Ray and Kubernetes(Kuberay) felt like overkill for a single machine.

So I built hyrax, it takes one model and multiple datasets, finds your GPU(s), and trains everything concurrently.

Install

Work in progress to make it a library

pip install hyrax

Example usage

from hyrax import DistributedTrainer
import minari

# train behavioral cloning model on 3 MuJoCo datasets
trainer = DistributedTrainer(
    model=BehavioralCloningModel,
    datasets=[
        "mujoco/humanoid/expert-v0",
        "mujoco/halfcheetah/expert-v0",
        "mujoco/hopper/expert-v0"
    ],
    dataset_loader=minari.load_dataset,
    auto_balance=True
)

results = trainer.train(epochs=200)

Hyrax detects your hardware, distributes the work, and trains all three concurrently.

Additionally there is also flexible dataset loading for different use cases

# Option 1: let hyrax load datasets
trainer = DistributedTrainer(
    model=MyModel,
    datasets=["dataset1", "dataset2", "dataset3"],
    dataset_loader=minari.load_dataset
)

# Option 2: pass pre-loaded datasets
datasets = [load_my_data(x) for x in ["a", "b", "c"]]
trainer = DistributedTrainer(
    model=MyModel,
    datasets=datasets
)

# Option 3: custom config
trainer = DistributedTrainer(
    model=MyModel,
    dataset_config={
        'source': 'minari',
        'names': ['mujoco/humanoid/expert-v0', ...],
        'download': True
    }
) 

Works with minari, pickle files, HDF5, custom loaders, anything.

why hyrax

Rock hyrax look super cute and cuddly

Features

  • auto GPU detection and allocation
  • resource checking before training starts
  • concurrent training across datasets
  • progress monitoring for all workers
  • works completely offline
  • dataset agnostic (minari, pickle, HDF5, custom)

NOT GOOD FOR

  • Multi-machine clusters
  • Distributed inference
  • Full MLOps pipelines

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.1.0.tar.gz (8.5 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.1.0-py3-none-any.whl (8.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: hyrax_lib-0.1.0.tar.gz
  • Upload date:
  • Size: 8.5 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.1.0.tar.gz
Algorithm Hash digest
SHA256 1826db31ed4b0a6cda2a71674efd8f88c95c9fa0821f89cc0ba1bcc7f6a5a6ae
MD5 dfc766f64232c545db4dfbf5a4f0e659
BLAKE2b-256 9a084fc300d0c9858075c0c86cb1f651fa8baa7436a4fe130346a9a1eb8f20de

See more details on using hashes here.

Provenance

The following attestation bundles were made for hyrax_lib-0.1.0.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.1.0-py3-none-any.whl.

File metadata

  • Download URL: hyrax_lib-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 8.3 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.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0b0ffed7c2727557e362277d221f6418e3d051d6495bbf2b3a69cf90b6b7c982
MD5 56fa043fc63f3d77a1e5c4310f701767
BLAKE2b-256 834565678aeaf4aa7326cfa52d83ff3a61f7fd078c88196b4d71e7a2143ae994

See more details on using hashes here.

Provenance

The following attestation bundles were made for hyrax_lib-0.1.0-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