Quick start: GPU training
mainTo start training on GPUs, you first generate a configuration JSON file using create_config.py and then execute the training script using torchrun.
Prerequisites:
- A Hugging Face token to download models.
Workflow:
- Generate Config: Use
create_config.pyto define your experiment parameters (model name, parallelism degrees, sequence length, etc.). By default, this creates a JSON file in the specified--out_dir. - Run Training: Use
torchrunpointing to the generated config file.
Parallelism Options:
- Data Parallelism (DP): Controlled via
--dp. - 3D Parallelism: Combines Tensor Parallelism (
--tp), Pipeline Parallelism (--pp), and Data Parallelism (--dp). You can specify the pipeline engine using--pp_engine(e.g.,1f1b).
- Slurm: For cluster environments, use
submit_slurm_jobs.pyto submit the jobs defined in your config directory.