Skip to content

Add DeepSeek V4 Flash CUDA training and context parallelism - #32

Merged
kaiwenKevinn merged 4 commits into
mainfrom
feat/deepseek-v4-flash
Nov 23, 2026
Merged

kaiwenKevinn merged 4 commits into
mainfrom
feat/deepseek-v4-flash

Conversation

@kaiwenKevinn

Copy link
Copy Markdown
Collaborator

Summary

  • Add an opt-in DeepSeek V4 Flash CUDA training backend using native Megatron Bridge and Megatron-Core, with pipeline parallelism and configurable train_cp_size.
  • Shard packed sequences across CP ranks, preserve next-token targets at shard boundaries, and reconstruct policy logprobs for Libra's GRPO update. Report each trajectory once in training metrics.
  • Document the pinned runtime dependencies, valid parallel layouts, the 32-GPU training gate, and an optional Megatron-Core patch for reducing initialization memory.
  • Ignore local build and coverage artifacts and per-rank validation receipts.

Validation

  • On 32 H20 GPUs, the official DeepSeek V4 Flash checkpoint passed the 1,024-token training gate with TP1 / PP4 / CP2 / DP4 / EP8. All 32 rank receipts confirmed one optimizer update and 16 global samples. Reconstructed logprob digests matched across all 16 CP pairs. Peak PyTorch CUDA allocation was 50.85 GiB per rank.
  • 37 targeted tests passed, covering DeepSeek V4 CUDA, Megatron configuration, loss and attention. Configuration coverage includes CP 1, 2, 3, 4, 6 and 12 on a 48-GPU topology. Packed-logprob and gradient checks cover CP 2, 3 and 4.
  • The optional memory patch passes git apply --check against the pinned Megatron-Core revision.
  • Python compilation and git diff --check passed.

Scope

This PR covers static CUDA training for DeepSeek V4 Flash. End-to-end rollout weight publication and native Elastic Hybrid Pool integration require separate validation.

@kaiwenKevinn
kaiwenKevinn marked this pull request as ready for review November 23, 2026 03:56
@kaiwenKevinn
kaiwenKevinn merged commit 3b36203 into main Nov 23, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants