Skip to main content

Engineer-first training calibration: estimate VRAM fit, profile short runs, and pick GPU configs under real budget constraints.

Project description

alloc

Find and fix training bottlenecks. Zero code changes.

PyPI Python License

pip install alloc
alloc run python train.py
alloc v0.0.9 — Calibrate

 Run Summary
  Peak VRAM       31.2 GB / 40.0 GB (A100)
  VRAM used       78.0%
  Avg GPU util    72.3%
  Avg power       287 W
  Duration        24.1s (auto-stopped: metrics stable at 18.2s)
  Step time       148.5 ms (p50) / 152.1 ms (p90)
  Throughput      42.3 samples/sec

  Artifact: alloc_artifact.json.gz

That's it. No decorators, no config files, no code changes. Alloc wraps your command, profiles GPU usage, and tells you what's wrong.


What you get

alloc diagnose reads your training script and tells you exactly what to change:

alloc diagnose train.py
alloc diagnose — 3 findings in train.py

 CRITICAL  DL005 — DataLoader running in main thread
   train.py:47   num_workers=0 → num_workers=8
   num_workers=0 loads data in the main thread, blocking GPU computation entirely.
   Expected impact: ~30-50% faster training with parallel data loading

 WARNING   PREC002 — Using fp16, consider bf16
   train.py:56   dtype: float16 → dtype: bfloat16
   H100 supports bf16 natively — eliminates loss scaling overhead.
   Expected impact: ~5-10% speedup, eliminates GradScaler complexity

 INFO      THRU001 — cudnn.benchmark not enabled
   Add: torch.backends.cudnn.benchmark = True
   Expected impact: ~5-10% speedup for fixed-size inputs

Summary: 1 critical, 1 warning, 1 info
Run with --diff to generate patches | --json for CI output

alloc ghost estimates VRAM before you launch:

alloc ghost train.py --dtype bf16
 Ghost Scan — 7.0B params (bf16)

  Model weights       13.04 GB
  Gradients           13.04 GB
  Optimizer (Adam)    78.23 GB
  Activations (est.)   0.50 GB
  Buffer (10%)        10.48 GB

  Total VRAM         115.28 GB

alloc scan ranks GPU configs without a GPU:

alloc scan --model llama-3-70b --gpu H100-80GB --num-gpus 8

Works with everything

Alloc wraps your launch command. No framework-specific setup required.

alloc run python train.py
alloc run torchrun --nproc_per_node=4 train.py
alloc run accelerate launch train.py
alloc run srun python train.py           # Slurm
alloc run ray job submit -- python train.py

Multi-GPU detection is automatic (discovers all GPUs in the process tree).


Deeper signals (optional)

Add a one-line callback for step-level timing:

# HuggingFace
from alloc import HuggingFaceCallback
trainer = Trainer(..., callbacks=[HuggingFaceCallback()])

# Lightning
from alloc import LightningCallback
trainer = Trainer(..., callbacks=[LightningCallback()])

This unlocks step time p50/p90, throughput, and dataloader bottleneck detection.


All commands

Command What it does
alloc run <cmd> Profile a training run (auto-stops when stable)
alloc diagnose <script> AST analysis with specific fix suggestions
alloc ghost <script> Estimate VRAM before launching
alloc scan --model <name> Rank GPU configs remotely (no GPU needed)
alloc catalog list Browse 13 GPUs with specs and pricing
alloc init Configure GPU fleet and budget (.alloc.yaml)
alloc login Authenticate for dashboard + auto-upload

Every command supports --json for CI/CD integration.


Dashboard

Log in to get team visibility, budget tracking, and optimization proposals:

alloc login --browser
alloc run python train.py    # auto-uploads when logged in

Dashboard at alloclabs.com


Design principles

  1. Zero configalloc run python train.py works out of the box
  2. Never crash training — all Alloc failures are caught silently
  3. No monkey-patching — external monitoring only, deeper signals opt-in
  4. Local-first — works in air-gapped environments, no internet required

Links

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

alloc-0.0.16.tar.gz (173.7 kB view details)

Uploaded Source

Built Distribution

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

alloc-0.0.16-py3-none-any.whl (124.0 kB view details)

Uploaded Python 3

File details

Details for the file alloc-0.0.16.tar.gz.

File metadata

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

File hashes

Hashes for alloc-0.0.16.tar.gz
Algorithm Hash digest
SHA256 fe8354a4061f6c283c65ffe338f66e79d0b35612799dde55a5c8d77e640eb1ce
MD5 5bd0f2cb4f7ba95a9656570209d47142
BLAKE2b-256 a01e312f0a96c1c3e12b9ebb767aaa045b38fc4626ee695ad2b8f570b74339a7

See more details on using hashes here.

Provenance

The following attestation bundles were made for alloc-0.0.16.tar.gz:

Publisher: publish-pypi.yml on alloc-labs/platform

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

File details

Details for the file alloc-0.0.16-py3-none-any.whl.

File metadata

  • Download URL: alloc-0.0.16-py3-none-any.whl
  • Upload date:
  • Size: 124.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for alloc-0.0.16-py3-none-any.whl
Algorithm Hash digest
SHA256 f32990c0529622d89ab02989da6bc6ffcd7cd8ba43e1d7bcd4c3917d3d6ee657
MD5 5d0c3a53f36e2fe05be0f68df8548383
BLAKE2b-256 2064f2b65bb1478035b0b1f1f99c2dab12dea67ad606044f23b76138bf851e22

See more details on using hashes here.

Provenance

The following attestation bundles were made for alloc-0.0.16-py3-none-any.whl:

Publisher: publish-pypi.yml on alloc-labs/platform

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