Skip to content

[RL] DeepEP support for --enable-return-routed-experts - #16859

Merged
hnyls2002 merged 8 commits into
sgl-project:mainfrom
PrinsYin:deepep_r3
May 6, 2026
Merged

hnyls2002 merged 8 commits into
sgl-project:mainfrom
PrinsYin:deepep_r3

Conversation

@PrinsYin

@PrinsYin PrinsYin commented Jan 10, 2026

Copy link
Copy Markdown
Contributor

Linked issue: THUDM/slime#1316

Summary

  • Add DeepEP a2a support to RoutedExpertsCapturer (rebased onto srt/state_capturer/ after move topk capturers to srt/state_capturer/ #24450)
  • Each attn-TP rank only sees its scattered slice of topk_ids under DeepEP, so all-gather across attn-TP at capture time before staging into device_cache
  • Alternative late-gather impl in [RL] support deepep when enabling return routed experts #17892 by @ocss884 (gather at D2H sync); this PR keeps the early-gather approach
  • Replace the R3 capture test with a config that actually exercises the gather path (--tp 4 --dp 2 --moe-a2a-backend deepep, attn_tp_size == 2); previous tp=dp=2 config left the gather as dead code

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

hnyls2002 and others added 2 commits May 5, 2026 17:00
PR sgl-project#24450 moved RoutedExpertsCapturer into srt/state_capturer/.
Re-apply the DeepEP attn-tp all-gather override to the new path.

Co-Authored-By: Junrong Lin <33685709+ocss884@users.noreply.github.com>
The previous tp=2 dp=2 config has attn_tp_size=1, so the DeepEP
all-gather added by this PR is dead code under that test. Switch
reference to tp=4 dp=2 + --moe-a2a-backend deepep (attn_tp_size=2)
to actually exercise RoutedExpertsCapturer.capture's gather path.
Baseline stays attn_tp_size=1 (tp=4 dp=4) to keep correctness ground
truth simple. Bumps suite to stage-c-test-4-gpu-h100.

Co-Authored-By: Junrong Lin <33685709+ocss884@users.noreply.github.com>
@hnyls2002

Copy link
Copy Markdown
Collaborator

/tag-and-rerun-ci

…rf flags

Mirror the original test pattern (vary perf flags, hold tp/dp + a2a fixed)
so a mismatch points cleanly at perf-side bugs (overlap stream race, cuda
graph capture mis-sync, radix cache key reuse) rather than at orthogonal
config drift between the two servers.

Co-Authored-By: Junrong Lin <33685709+ocss884@users.noreply.github.com>
@hnyls2002

hnyls2002 commented May 6, 2026

Copy link
Copy Markdown
Collaborator

/rerun-test test/registered/rl/test_return_routed_experts.py
(4 tries)

@github-actions

github-actions Bot commented May 6, 2026

Copy link
Copy Markdown
Contributor

4-gpu-h100 (1 test): View workflow run

cd test/ && python3 registered/rl/test_return_routed_experts.py

@hnyls2002 hnyls2002 changed the title feat: deepep routed experts capture [RL] DeepEP support for --enable-return-routed-experts May 6, 2026
hnyls2002 added 3 commits May 5, 2026 17:19
…nner

ep_moe/layer.py:238 has `assert False, "forward_deepgemm_contiguous is
deprecated"` for non-{aiter, NPU, w4afp8} models in the deepep_normal
path. The new deep_gemm runner (super().run_moe_core) only kicks in
when quant_config is Fp8Config — Qwen3-30B-A3B (bf16) hits the assert.
Use the FP8 variant Qwen/Qwen3-30B-A3B-FP8.
@sgl-project sgl-project deleted a comment from github-actions Bot May 6, 2026
@sgl-project sgl-project deleted a comment from github-actions Bot May 6, 2026
@github-actions

github-actions Bot commented May 6, 2026

Copy link
Copy Markdown
Contributor

4-gpu-h100 (1 test): View workflow run

cd test/ && python3 registered/rl/test_return_routed_experts.py

@hnyls2002
hnyls2002 merged commit b2420d7 into sgl-project:main May 6, 2026
41 of 101 checks passed
Chronostasys pushed a commit to MindLab-Research/sglang that referenced this pull request Aug 24, 2026
…#16859)

Co-authored-by: hnyls2002 <lsyincs@gmail.com>
Co-authored-by: Junrong Lin <33685709+ocss884@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants