What problem does it solve?
It solves the problem of reliably running multi-node, multi-GPU Megatron-LM (via torch.distributed.run) on SLURM without misconfigured environment variables, inconsistent filesystem paths, or hardware/parallelism-related runtime failures.
Core Features & Use Cases
- Minimal SLURM sbatch skeleton for distributed training: sets MASTER_ADDR, MASTER_PORT, NNODES, WORLD_SIZE, and launches a unified srun+distributed run across nodes.
- Hardware- and strategy-aware CUDA_DEVICE_MAX_CONNECTIONS guidance: prevents assertion failures and avoids incorrect settings for FSDP vs non-FSDP modes and Blackwell behavior.
- Operational readiness for real clusters: covers shared filesystem conventions, container execution considerations, monitoring/collection with squeue+sacct, and systematic per-rank failure diagnosis (OOM, shape errors, import errors, NCCL issues).
Quick Start
Write an sbatch script that exports MASTER_ADDR and MASTER_PORT, computes WORLD_SIZE from SLURM_NNODES and GPUs per node, and starts pretrain_gpt.py using uv run python -m torch.distributed.run with matching master address/port and node-rank across all ranks.