Skip to content

[megatron,doc] feat: support DeepseekV4, GLM5, KimiK2.5 via Megatron Lite - #6791

Merged
wuxibin89 merged 7 commits into
verl-project:mainfrom
ISEEKYAN:main
Jun 18, 2026
Merged

wuxibin89 merged 7 commits into
verl-project:mainfrom
ISEEKYAN:main

Conversation

@ISEEKYAN

Copy link
Copy Markdown
Collaborator

What does this PR do?

Add Megatron Lite backend documentation and example launchers for multiple mlite training paths:

  • docs/advance/megatron_lite_backend.rst explains mlite as Megatron's experimental, agent-friendly path, how it plugs into verl through external megatron.lite / verl_mlite, and where to put custom extensions. It also links to a long-sequence MoE RL tuning write-up: https://iseekyan.github.io/posts/qwen35-long-sequence-moe-rl/.
  • examples/sft/gsm8k/run_deepseek_v4_megatron.sh runs GSM8K SFT with engine=mlite and supports DeepSeek-V4 Flash/Pro mesh defaults.
  • examples/grpo_trainer/run_deepseek_v4_megatron_lite.sh runs GRPO / DAPO-style RL with actor@actor_rollout_ref.actor=mlite_actor.
  • examples/grpo_trainer/run_kimi_k2_6_glm5_1_megatron_lite.sh adds 256-GPU GRPO launch defaults for Kimi K2.6 and GLM 5.1 with PP8/EP8/CP8 and fsdp2.
  • examples/grpo_trainer/run_qwen3_5_35b_megatron_lite.sh adds a Qwen3.5-35B-A3B GRPO launcher that documents the allgather CP path and FLA (flash-linear-attention) 5.0 runtime dependency.

The launchers keep mlite runtime code outside the verl tree, load verl_mlite through MLITE_ROOT / PYTHONPATH, default to OPTIMIZER=fsdp2, and keep OPTIMIZER=dist_opt available. For dist_opt, the docs and launchers call out that larger PP*EP meshes help avoid OOM. The docs also mention deterministic dist_opt validation against Megatron-Core with bitwise-aligned loss / grad norms and aligned step time / throughput.

AI assistance was used to draft and update the docs / launchers; the submitter should review every changed line and run the relevant checks before requesting review.

Checklist Before Starting

Design & Code Changes

  • Keep Megatron Lite runtime code outside the verl tree; examples use MLITE_ROOT / PYTHONPATH to load megatron.lite and verl_mlite.
  • Use grouped Hydra argument arrays and keep mlite-specific knobs near the top of each launcher.
  • Add DeepSeek-V4 Flash/Pro defaults and clarify DS4 fixed TP1/ETP1 behavior.
  • Add 256-GPU Kimi K2.6 / GLM 5.1 defaults with explicit mesh accounting: ngpu / pp = tp * ep * dp = etp * ep * edp.
  • Add Qwen3.5-35B mlite GRPO launcher with allgather CP / FLA 5.0 runtime notes.
  • Allow the intentional _megatron_lite.sh example suffix in the example naming check so these scripts are distinguishable from legacy megatron backend examples.

Checklist Before Submitting

  • Read the Contribute Guide.
  • Apply pre-commit checks on changed PR files.
  • Add / update documentation.
  • Add unit or end-to-end tests to CI, or explain why not feasible: these are launcher/docs changes for external mlite and large multi-node meshes; syntax and pre-commit checks were run instead.
  • Once ready for CI, request CI in the ci-request channel.
  • Not related to the recipe submodule.

ISEEKYAN and others added 6 commits June 17, 2026 08:30
Add a Megatron Lite backend doc and two DeepSeek-V4 launchers for GSM8K SFT and GRPO / DAPO-style RL.

The launchers keep mlite runtime code outside the verl tree, load verl_mlite through MLITE_ROOT/PYTHONPATH, use OPTIMIZER=fsdp2 by default with OPTIMIZER=dist_opt available, and follow the modern grouped-array launcher layout.
Co-authored-by: GPT-5.5 <noreply@openai.com>

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces the Megatron Lite backend integration, adding documentation and several launcher scripts for DeepSeek-V4, Kimi K2.6 / GLM 5.1, and Qwen3.5-35B models using GRPO and SFT. The feedback identifies a missing entry in the check_example_naming.py sanity check ignore list for the newly added SFT launcher, which would otherwise cause CI failures.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread tests/special_sanity/check_example_naming.py Outdated
@wuxibin89
wuxibin89 merged commit 7f16719 into verl-project:main Jun 18, 2026
10 of 160 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