What problem does it solve? Pretraining large language models from scratch requires coordinating complex distributed training strategies across hundreds of GPUs, and misconfiguring parallelism, checkpointing, or memory settings leads to out-of-memory failures and wasted compute. This Skill provides structured workflows for running PyTorch-native distributed pretraining with torchtitan, covering FSDP2, tensor, pipeline, and context parallelism. ## Core Features & Use Cases - 4D Parallelism Configuration: Compose FSDP2, tensor parallelism, pipeline parallelism, and context parallelism to train models from 8B to 405B+ parameters across 8 to 512+ GPUs. - Float8 and torch.compile Acceleration: Enable Float8 training with torchao on H100 GPUs for 30-50% speedups, with layer filtering and rowwise scaling recipes. - Distributed Checkpointing: Use PyTorch Distributed Checkpoint for fault-tolerant saves, async checkpointing, seed checkpoints for pipeline parallelism, and HuggingFace format conversion. - Use Case: A research team wants to pretrain a Llama 3.1 70B model on 256 GPUs across 32 SLURM-managed nodes. Use this Skill to configure FSDP plus tensor parallelism, generate the SLURM submission script, and set up automatic checkpoint resumption. ## Quick Start Ask the agent to configure and launch a torchtitan pretraining run for Llama 3.1 8B on 8 GPUs with a TOML config file and checkpointing enabled.