Repository navigation
[DSpark] Fix draft MoE expert-location dispatch to restore speculative acceptance - #34846
zhanxxxxxxx wants to merge 2 commits into
Conversation
dd13bfe to
2b4f7ff
Compare
|
@Fridge003 @ispobock Hi, could you please help review this PR and tag it with run-ci if appropriate? This fixes incorrect expert dispatch for DSpark draft layers when EPLB uses a non-identity expert placement. The draft weights are loaded according to the remapped expert locations, but the NextN path previously skipped logical-to-physical dispatch, causing the draft model to execute the wrong experts. The fix is opt-in for DSpark only and preserves the existing NextN/MTP behavior. I also added regression tests, and in my test the mean acceptance length recovered from 1.61 to 3.38. Would appreciate your help getting this through review. Thanks! |
…aft MoE DSpark reuses DeepSeek nextn layers for its draft; regular nextn/MTP layers skip expert-location dispatch, but the draft expert weights are loaded with the target's global expert-location mapping. With a non-identity expert placement (any large EP deployment) the draft gate then emits logical ids while the weights live in remapped physical slots, so the wrong draft experts run and acceptance collapses (upstream measured 1.61 -> 3.38). - deepseek_v2: add the per-layer opt-in (enable_nextn_expert_location_dispatch / _should_use_expert_location_dispatch) and route the four dispatch_info sites through it - deepseek_v4_dspark: opt in from DSparkV4Stage
Squash the debug branch back to its essential changes on top of main: - KEEP: DSparkAttention reduces wo_b over the attn-TP group instead of the full DP x TP group (the accept-rate-0 root cause). - KEEP: disable the folded proposal under attn_tp > 1 (eager markov path), since the in-graph markov vocab-shard gather is not verified there. - KEEP: the upstream attn_tp == 1 guard, commented out with a NOTE explaining that its corruption is the wo_b group and is fixed. Remove all DSPARK_DUMP instrumentation (dspark_numeric_dump.py and every call site), plus the changes that are no-ops for this deepep + dp-attention + NPU configuration: the _base_logits_context alignment, sgl-project#34846 expert-location dispatch (eplb off), sgl-project#31868 speculative MoE contexts (a2a == target deepep), the _dp_gather replicated path (only a2a=none), and SpecTpSync PyNCCL (no PyNCCL on NPU).
|
Thanks @zhanxxxxxxx. Closing this because you have 9 PRs open and none updated in 7 days, over our soft cap of 5 for idle PRs. Reopen the two or three you most want reviewed - a short active set moves faster than a long idle one. Some directories moved recently, so an older branch may need retargeting: |
|
This issue has already been fixed upstream in #45299. This PR is superseded and will remain closed. |
Motivation
DSpark reuses DeepSeek NextN decoder layers for its draft model. Regular NextN/MTP layers intentionally skip expert-location dispatch, but DSpark draft expert weights are loaded according to the target model's global expert-location metadata.
With a non-identity initial expert placement, the draft gate emits logical expert IDs while the corresponding weights reside in remapped physical slots. Skipping logical-to-physical dispatch therefore executes the wrong draft experts and substantially degrades speculative acceptance.
Modifications
DSparkV4Stage.op_select_expertspaths.Accuracy Tests
GSM8K smoke test (20 questions) after the fix:
0.9500.000The test confirms that the corrected draft expert routing restores valid model output. This is a small smoke test rather than a statistically strong accuracy evaluation.
Speed Tests and Profiling
Under the same DSpark + non-identity expert-placement configuration (10 random requests):
The workload is intentionally reported as a smoke/performance regression test; it is not a full throughput benchmark.
Regular NextN/MTP behavior is unaffected because the new dispatch behavior is opt-in and is enabled only by
DSparkV4Stage.Checklist
Review and Merge Process
/tag-and-rerun-ci,/tag-run-ci-label,/rerun-failed-ciCI States
Latest PR Test (Base): ❌ Run #34451781659
Latest PR Test (Extra): ❌ Run #34451781346
Latest PR Test (AMD ROCm 10): ❌ Run #34451781568