Add multi-GPU distributed training launcher (torchrun / DeepSpeed) - #51
Add multi-GPU distributed training launcher (torchrun / DeepSpeed)#51iamdarshg wants to merge 4 commits into
Conversation
This commit adds support for multi-GPU and multi-node distributed training using torchrun and DeepSpeed ZeRO-3. Key changes: - Created `scripts/launch_distributed.sh` wrapper for torchrun. - Created `configs/deepspeed_zero3.json` for model sharding. - Created `configs/training_do_single_h100.yml` for single-GPU H100. - Integrated DeepSpeed into `EnhancedMoETrainer` and `CurriculumMCTSTrainer`. - Added logic to automatically resolve 'auto' values in DeepSpeed config. - Added `to_file` and `from_file` to `TrainingConfig` for YAML/JSON support. - Updated `ARCHITECTURE.md` with distributed training documentation. - Fixed several bugs related to DeepSpeed initialization and pickling. Co-authored-by: iamdarshg <54465508+iamdarshg@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
|
Reviewing this as the fix for #29: this is directionally the right set of files, but I don't think it satisfies the issue yet. It adds a launcher, a ZeRO-3 JSON, a nominal single-H100 config, and some docs, but the actual distributed training path is not complete enough to trust. Blocking issues:
What I would expect before this can close #29:
So: good skeleton, not a complete fix yet. I would request changes before merging. |
Thank you for the detailed review. I've addressed the blocking issues and nitpicks:
|
- Fully integrated DeepSpeed into CurriculumMCTSTrainer and GRPOTrainer. - Added DDP wrapping for distributed training without DeepSpeed. - Support loading both ModelConfig and TrainingConfig from a single YAML. - Updated launch script to use H100-safe config by default. - Implemented rank-aware data sharding for streaming datasets. - Expanded auto-resolution of DeepSpeed config values. - Cleaned up runtime artifacts and fixed test compatibility. Co-authored-by: iamdarshg <54465508+iamdarshg@users.noreply.github.com>
|
Follow-up after the new commit: this is definitely closer. The update fixes several of the earlier review points: the launcher now defaults to I still don't think this fully closes #29 yet. Remaining blockers / concerns:
model = DeepSeekModel(model_config, device=device)
model = model.to(device)
optimizer = torch.optim.AdamW(model.parameters(), ...)
trainer = EnhancedMoETrainer(...)DeepSpeed is only initialized inside the trainer, after the full model has already been constructed on the GPU and after a normal optimizer has been created. For the actual #29 problem — 5.72B params requiring more than one H100 — this can die before
So: meaningful progress, but still not merge-ready as a fix for #29. The skeleton is now much better, but the production-sized DeepSpeed path and the single-H100 acceptance path still need real runtime-safe wiring rather than just flags and docs. |
- Use `deepspeed.zero.Init()` for model construction to support massive models. - Ensure tokenizer embedding resize happens before DDP/DeepSpeed wrapping. - Fully integrate DeepSpeed into `CurriculumMCTSTrainer` and `GRPOTrainer`. - Implement rank-aware data sharding in `CurriculumDataLoader`. - Added `--config` flag to `scripts/launch_distributed.sh` and updated docs. - Improved DeepSpeed config auto-resolution (precision, optimizer, scheduler). - Gated logging, checkpointing, and reporting to master rank only. - Fixed DDP/DeepSpeed state_dict saving. - Cleaned up runtime artifacts and updated `.gitignore`. - Fixed test compatibility with improved mock handling. Co-authored-by: iamdarshg <54465508+iamdarshg@users.noreply.github.com>
- Implemented memory-safe model construction using `deepspeed.zero.Init()`. - Fixed initialization order: tokenizer setup and embedding resize now happen before distributed wrapping. - Fully integrated DeepSpeed into `CurriculumMCTSTrainer` and `GRPOTrainer`. - Added rank-aware sharding for curriculum-aware data loading. - Implemented rank-gated, engine-aware checkpointing and logging. - Added DDP wrapping for multi-GPU non-DeepSpeed paths. - Improved launcher script with robust `--config` support and summary printing. - Cleaned up repository hygiene and updated `.gitignore`. Co-authored-by: iamdarshg <54465508+iamdarshg@users.noreply.github.com>
Enabled multi-GPU and multi-node distributed training using
torchrunand DeepSpeed ZeRO-3. Included optimized configurations for DigitalOcean GPU Droplets and documented the setup in ARCHITECTURE.md. Integrated DeepSpeed support into both the main EnhancedMoETrainer and CurriculumMCTSTrainer.PR created automatically by Jules for task 14135534954625386593 started by @iamdarshg