Monarch is a single-controller library for PyTorch, providing a centralized orchestration layer for distributed training. It simplifies multi-GPU and multi-node training by managing communication, checkpointing, and fault tolerance. Currently at version 0.5.0, it requires Python >=3.10 and is under active development.
pip install torchmonarchNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Initialize Monarch with a config, then train a simple linear model.
Update code to pass `num_gpus=torch.cuda.device_count()` (or an integer) to `MonarchConfig`.
Replace `monarch.run(...)` with `monarch.train(...)`.
Install PyTorch with CUDA support and ensure NCCL is installed.
Create the directory beforehand: `import os; os.makedirs(config.checkpoint_dir, exist_ok=True)`.