Fix(DSpark): Broadcast Verify Budget Across TP Ranks for Compact Graph Tier Alignment - #31195
EanWang211123 wants to merge 1 commit into
Conversation
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
Independent B300 TP8 validation: O2 complete; strict eager boundary confirmedI independently backported this PR's TP0 verify-budget broadcast logic onto SGLang baseline Stability results
Test points were batch 64 / 96 / 128, 10 workloads per point, fixed prompt, output length 1024, compact ragged verify, CUDA Graph enabled, and Radix Cache disabled. TP consistency auditThis strongly validates the PR's intended effect: broadcasting TP0's final verify budget keeps compact target-verify Graph-tier selection identical across TP ranks and removes the original observed cross-rank mismatch in this B300 TP8 matrix. Residual issue does not invalidate this PRA separate compact SPS transition failure remains on machine A: With CUDA Graph enabled, the transition crashes with both overlap enabled and disabled. Before the crash, all TP ranks agree on: A fresh server running only This residual failure is therefore being tracked in #31023 as a CUDA Graph capture/replay or Graph-associated metadata/buffer lifetime issue, not as a failure of this PR's TP budget synchronization. Cross-machine statusA separate machine B replay used ten independent fresh servers and the same A-machine Every run completed Current assessmentAn earlier |
…project#32035 sgl-project#33656 sgl-project#32183 sgl-project#33145) Applied PRs (latest from GitHub): sgl-project#33288 Indexer logits OOM fix sgl-project#30393 HiCache packed/sidecar draft caches sgl-project#31170 DPA prefix_affinity load balancing sgl-project#33795 DSpark compact ragged-verify CUDA graph JIT race sgl-project#32467 C128 plan-kernel warp barrier sgl-project#33865 DSpark x prefill CP unblock sgl-project#30371 SWA state pool sizing (storage page) sgl-project#33358 FlashMLA norm-rope K-tokens-per-block ILP sgl-project#33872 num_draft_tokens clamp + extend_len==0 skip (supersede sgl-project#32183) sgl-project#34002 Sidecar backup vacuously-successful fix (replaces sgl-project#33656, with tests) sgl-project#33862 Reclaim redundant host mirrors after storage backup sgl-project#31315 Avoid repeated Mooncake gets after stale hits sgl-project#32327 Q8KV8 sparse MLA prefill backend (flashmla_sparse_q8) sgl-project#31668 Fix sidecar pool life-time (use-after-free on prefetch abort) sgl-project#31195 TP0 verify-token-budget broadcast (adapted to get_schedule() API) Dropped (per user request or superseded): sgl-project#32771 IndexCache C4 top-k reuse — has bug sgl-project#32035 DSpark C128 online compressor — has bug sgl-project#33656 Superseded by sgl-project#34002 (same fix + unit tests) sgl-project#32183 Superseded by sgl-project#33872 (included in supersede PR) sgl-project#33145 Base f01f706 already has superior reasoning-effort profile system Conflicts resolved: sgl-project#31195: adapted to base get_schedule().disable_overlap_schedule API sgl-project#32327: path remapped jit_kernel/ -> kernels/jit/ and kernels/ops/attention/ sgl-project#31668: applied cleanly on top of sgl-project#30393+sgl-project#34002+sgl-project#33862 modifications
… get_schedule().disable_overlap_schedule)
|
Follow-up after the later Bug-2 isolation: the B300/TP8 validation for this PR still stands independently. I backported the TP0 verify-budget broadcast onto baseline
Across TP0-TP7 in those runs: The residual CUDA-Graph failure that originally remained after this synchronization has since been isolated separately: on B300, #32467 can directly produce/repair the invalid ragged plan ( So the current evidence separates the two layers cleanly: The later Bug-2 findings therefore reinforce rather than weaken the conclusion here: the TP budget/Graph-tier mismatch fixed by this PR was a real and independently validated Bug 1. |
c6ade4d to
8c96f09
Compare
Signed-off-by: EanWang211123 <wangyiheng@sangfor.com.cn>
8c96f09 to
b5f6385
Compare
Motivation
In DSpark compact ragged verify with TP > 1, each TP rank independently computes
verify_token_budgetfrom locally resolved draft confidence (including overlap precompute viaprepare_verify_budget). Per-requestverify_lensare broadcast from TP0 after top-k scheduling, butgraph_num_tokens(compact CUDA graph key / M tier) is derived from each rank’s local budget inschedule_layout()when_dynamic_graph_tieris enabled.Draft confidence can differ slightly across TP ranks (floating-point / sharded draft paths). Ranks then pick different budgets and different graph tiers for the same step. Both ranks still participate in the same TP MoE/attention collectives with mismatched token shapes, which leads to a hang: CPU blocked in
copy_done.synchronize()while GPUs stay busy.Reproduction logs
1. Pre-broadcast CPS debug: local
verify_lensdiverge on the same requestSGLANG_DSPARK_DEBUG_CONFIDENCE_PREFIX_SCHEDULER=1logs beforeverify_lensbroadcast; TP0/TP1 can disagree on the samereq:Similar divergence on other requests in the same step (e.g. req=34: TP0
verify_len=8, TP1verify_len=6).2. Graph tier mismatch on the same step (root cause for hang)
With
SGLANG_LOG_DECODE_GRAPH_KEY=1, the same decode step replays different target verify graphs on TP0 vs TP1 (raw_bs=32on both):TP0 target verify uses M=160; TP1 uses M=144. Draft graphs match (
key_size=32), but target verify does not.3. Hang symptom: symmetric CPU wait, GPUs still busy
py-spyon both scheduler ranks (TP0 pid 115005, TP1 pid 115007):Both ranks stuck in
result.copy_done.synchronize()(waiting for prior forward’s D2H oncopy_stream).nvidia-smi pmonat hang time:GPUs not idle; forward likely blocked inside mismatched TP collective / kernel path.
4. Typical server config when reproducing
Modifications
SpecTpSync.sync_cpu()to broadcast CPU decision tensors through the existing TP CPU process group while respecting the configuredSpecTpSyncSite._sync_verify_token_budget()toDSparkVerifyPlanner, usingSpecTpSyncSite.DSPARK_PLANto broadcast TP0’s scalar budget; retain-1as the wire sentinel forNone.verify_token_budgetin both overlap and non-overlap paths beforeschedule_layout(), ensuring all TP ranks use the same budget for verify-lens scheduling, graph-tier alignment, andgraph_num_tokensselection.DSPARK_PLANsynchronization ofverify_lens, providing a second consistency boundary after budget-based scheduling.Nonesentinel is preserved correctly.Expected behavior after fix: for the same step, logs should show matching target graph keys, e.g.:
Cost: one CPU-side scalar
broadcastper decode step whentp_size > 1and budget scheduling is active.Checklist
Review and Merge Process
/tag-and-rerun-ci,/tag-run-ci-label,/rerun-failed-ciCI States
Latest PR Test (Base): ❌ Run #33462766027
Latest PR Test (Extra): ❌ Run #33462765865
Latest PR Test (AMD ROCm 7.2): ❌ Run #33462766032