๐ Ready-to-go Examplesโ๏ธ
This section contains ready-to-run examples demonstrating various features of
the ezpz library.
New to ezpz? Start with ezpz.examples.test for a minimal
DDP training loop, then move to ezpz.examples.fsdp when you're
ready to shard model parameters. The remaining examples layer on additional
features โ Vision Transformers, tensor parallelism, Hugging Face integration โ
so pick whichever matches your workload.
Prerequisitesโ๏ธ
- ezpz installed:
pip install ezpzorpip install git+https://github.com/saforem2/ezpz - PyTorch (auto-detected at runtime)
- MPI for multi-GPU training (
mpi4py+ MPICH or OpenMPI). Single-GPU and CPU work without MPI.
Running Examplesโ๏ธ
All examples use the same launch pattern:
For example, to run the test example:
On a laptop this uses a local mpirun; inside a PBS or SLURM job, the
scheduler is auto-detected.
Picking an Exampleโ๏ธ
Fine-tuning or training an LLM?
See the Fine-Tuning & Training LLMs
guide for a task-oriented walkthrough of the three paths (hf_trainer,
hf, fsdp_tp) โ which to pick, larger-model targets, resource
requirements, and how to scale.
Model size ladderโ๏ธ
All 5 training examples (test, fsdp, vit, diffusion, fsdp_tp)
expose the same --model {debug,s,m,l,xl,xxl,xxxl} preset ladder
targeting consistent parameter counts. Architectures differ; the
ladder positions are aligned.
| Preset | Target | test |
fsdp |
vit |
diffusion |
fsdp_tp |
|---|---|---|---|---|---|---|
debug |
smoke | ~110K | ~10K | ~50K | ~50K | ~10K |
s (small) |
~100M | 107M | 76M | 87M | 101M | 125M |
m (medium) |
~250M | 248M | 227M | 204M | 274M | 246M |
l (large) |
~500M | 449M | 605M | 632M | 500M | 495M |
xl |
~1B | 858M | 1.21B | 1.21B | 939M | 1.21B |
xxl |
~5B | 3.43B | 4.84B | 5.44B | 5.50B | 5.93B |
xxxl |
~10B | 9.88B | 9.68B | 9.67B | 11.4B | 11.34B |
Long-form aliases (small, medium, large, xlarge, extra-large,
xxlarge, extra-extra-large, xxxlarge, extra-extra-extra-large)
map onto the same short-name canonical presets.
Breaking change as of this release:
--model small(and other long-form aliases) now resolve to the production-scale ladder above. Old toy-scalesmall/medium/large(~250Kโ1M params) are gone. Use--model debugfor the laptop-runnable smoke-test path.
For Llama-specific configs, fsdp_tp additionally exposes the
torchtitan-flavored agpt-2b (1.99B params) and agpt-20b (20.74B
params) presets, which reproduce the AuroraGPT registry exactly.