Skip to main content

Navigate large model training and inference with confidence

Project description

Orion-ML

Navigate large model training and inference with confidence.

Diagnose bottlenecks. Get ranked optimization strategies. Understand cost-accuracy trade-offs. Works with PyTorch-centric stacks and common trainers. No infrastructure changes required.

Just as navigators used Orion to find their position and chart their course across open ocean, Orion-ML tells you where training or serving is bottlenecked and charts ranked strategies to improve throughput, memory, and cost.

  • PyPI: orion-ml
  • Tagline: Navigate large model training and inference with confidence
  • Users: ML engineers and platform teams training LLMs and VLMs on multi-GPU and multi-node clusters

Components

Component Import Purpose
orion-train orion.train Training pipeline metrics, bottleneck classification, parallelism advice, checkpointing, cost reasoning
orion-serve orion.serve Inference profiling, quantization guidance, serving and KV-cache analysis
orion-sight orion.sight Unified metrics, anomaly detection, rich/HTML/JSON/Markdown reporting, dashboards

Install

pip install orion-ml
# Optional: PyTorch, GPU telemetry, experiment trackers, HF Trainer, Lightning
pip install "orion-ml[torch,gpu,trackers,hf,lightning]"

Quick start: three lines in your training loop

from orion.train import TrainingTracker

tracker = TrainingTracker(job_name="my-run", output_dir="./orion_output")
with tracker.step():
    loss = model(inputs)
    loss.backward()
    optimizer.step()

Metrics are written to local SQLite first; optional W&B / MLflow export runs asynchronously and never blocks the step.

Hugging Face Trainer

from transformers import Trainer
from orion.train.callbacks import OrionTrainCallback

trainer = Trainer(..., callbacks=[OrionTrainCallback(job_name="hf-run", output_dir="./orion_output")])

Parallelism recommendation

from orion.train import ParallelismAdvisor, ParallelismConfig

advisor = ParallelismAdvisor()
rec = advisor.recommend(
    ParallelismConfig(
        model_params=7_000_000_000,
        gpu_memory_gb=80,
        num_gpus=8,
        num_nodes=1,
        interconnect="nvlink",
        precision="bf16",
        target_batch_size=64,
    )
)
print(rec.strategy, rec.reasoning)

Inference profiling

from orion.serve import InferenceProfiler

profiler = InferenceProfiler(model=model, tokenizer=tokenizer)
results = profiler.benchmark(prompts=test_prompts, max_new_tokens=256, batch_sizes=[1, 8, 32])
profiler.report()

Reports

from orion.sight import Reporter

reporter = Reporter(tracker)
reporter.report()  # terminal (rich)
reporter.report(format="html", output_path="report.html")
reporter.report(format="json", output_path="report.json")

Repository layout

orion/
├── orion/           # Python package
├── docs/            # Guides and API reference
├── examples/        # Runnable demos (may require torch/GPU)
└── tests/           # unit / integration / benchmarks

Output: sheetal@Sheetal-MBP project-orion % python gate3_real_bottleneck.py

================================================== GATE 3: REAL BOTTLENECK DETECTION

[1/2] Creating real data loader bottleneck... [transformers] Disabling PyTorch because PyTorch >= 2.4 is required but found 2.2.2 [transformers] PyTorch was not found. Models won't be available and only tokenizers, configuration and file/data utilities can be used. [Orion-ML] Warning: PyTorch < 2.4 detected; some packages recommend torch>=2.4. Core TrainingTracker metrics are unchanged. ╭────── Orion-ML Training summary ──────╮ │ Primary bottleneck: DATA_LOADER_BOUND │ │ Efficiency score: 25/100 │ │ Anomalies flagged: 0 │ ╰───────────────────────────────────────╯ Top recommendations
┏━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━┓ ┃ Rank ┃ Strategy ┃ Accuracy risk ┃ ┡━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━┩ │ 1 │ increase_num_workers │ NONE │ │ 2 │ pin_memory │ NONE │ │ 3 │ prefetch_factor │ NONE │ │ 4 │ streaming_dataset_or_dali │ LOW │ └──────┴───────────────────────────┴───────────────┘ Data loader overhead: 92.0% ✅ Real data loader bottleneck correctly detected

[2/2] Creating real gradient explosion... [Orion-ML] Warning: PyTorch < 2.4 detected; some packages recommend torch>=2.4. Core TrainingTracker metrics are unchanged. ╭────── Orion-ML Training summary ──────╮ │ Primary bottleneck: DATA_LOADER_BOUND │ │ Efficiency score: 25/100 │ │ Anomalies flagged: 1 │ ╰───────────────────────────────────────╯ Top recommendations
┏━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━┓ ┃ Rank ┃ Strategy ┃ Accuracy risk ┃ ┡━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━┩ │ 1 │ increase_num_workers │ NONE │ │ 2 │ pin_memory │ NONE │ │ 3 │ prefetch_factor │ NONE │ │ 4 │ streaming_dataset_or_dali │ LOW │ └──────┴───────────────────────────┴───────────────┘ Anomalies
┏━━━━━━━━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ ┃ Type ┃ Severity ┃ Message ┃ ┡━━━━━━━━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩ │ LOSS_DIVERGENCE │ CRITICAL │ Loss increased for 3+ consecutive steps — check │ │ │ │ LR, batch, or bad data. │ └─────────────────┴──────────┴─────────────────────────────────────────────────┘ Anomalies detected: ['LOSS_DIVERGENCE'] ✅ Loss divergence detected (same root cause — acceptable)

================================================== GATE 3: ✅ ALL PASSED — Ready for Lambda GPU demo

License

Apache 2.0 — see LICENSE.

Contributing

See CONTRIBUTING.md.

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

theorion_ai-0.1.0.tar.gz (44.3 kB view details)

Uploaded Source

Built Distribution

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

theorion_ai-0.1.0-py3-none-any.whl (50.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: theorion_ai-0.1.0.tar.gz
  • Upload date:
  • Size: 44.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.7

File hashes

Hashes for theorion_ai-0.1.0.tar.gz
Algorithm Hash digest
SHA256 78faa3c4d56cc06c2757f9af298a2cf832c317355877437bdd02095338b2238d
MD5 59b28a9b6c291b7fc60d28596d7df927
BLAKE2b-256 cf46ac3dca56496441505caa554499501fb487511abcbfa858847fc8af2162fb

See more details on using hashes here.

File details

Details for the file theorion_ai-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: theorion_ai-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 50.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.7

File hashes

Hashes for theorion_ai-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e209181ea1ade456922d11f93f80be5fb69e1ee13a45a957cf474f2f49e8fdd7
MD5 ac8772e155686f0e0fded8dead43808a
BLAKE2b-256 e90888000fa7391e55c32414880694568949feb9a1430d6e4a6ea9c98ea5d38a

See more details on using hashes here.

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