Repository navigation
[Feat] dspark: Enable DeepSeek-V4.1 dynamic verify on PD decode - #40567
lidekang160122 wants to merge 9 commits into
Conversation
…ens to their requests With SGLANG_RAGGED_VERIFY_MODE=compact, target verify packs a variable number of tokens per request. EngramHasher asserted equal blocks per request and token_req_indices repeated each request draft_token_num times, so DeepSeek-V4.1 failed at CUDA graph capture (sgl-project#39173). Add ragged_verify_token_rows, a fixed-size token-to-row lookup over the layout's qo_indptr. Engram hashes packed verify through its existing extend path; token_req_indices maps graph padding to pool slot 0. Uniform verify is unchanged. sgl-project#40567 by @lidekang160122 identified these two call sites. (cherry picked from commit 0f85c31b3e1a123330c0ac3972954bc6ea2caacc)
…ens to their requests With SGLANG_RAGGED_VERIFY_MODE=compact, target verify packs a variable number of tokens per request. EngramHasher asserted equal blocks per request and token_req_indices repeated each request draft_token_num times, so DeepSeek-V4.1 failed at CUDA graph capture (sgl-project#39173). Add ragged_verify_token_rows, a fixed-size token-to-row lookup over the layout's qo_indptr. Engram hashes packed verify through its existing extend path; token_req_indices maps graph padding to pool slot 0. Uniform verify is unchanged. sgl-project#40567 by @lidekang160122 identified these two call sites.
DeepSeek-V4.1 captures each verify token tier for two attention variants. Capture both through the runner, stage live unequal lengths, and check that token_req_indices and EngramHasher read them from either variant's layout.
…lized dspark_sps_profiler --fracs pins dspark_force_budget_frac on a compact server to profile the off-diagonal SPS cost T(bs, M). Before a profiled table exists the planner is verify-all, and schedule_layout returned the cached full-width layout before consulting the budget, so every pinned cell measured full-width verify and the fitted 2D table was flat in M. Serve the cached layout only while no fraction is pinned. Since a pin now trims verify under verify-all, reject pinning it while SGLANG_SIMULATE_ACC_LEN is above 1, as the DSpark worker already does at startup for profiled tables.
SGLANG_SIMULATE_ACC_METHOD=multinomial draws the accept length from a normal around SGLANG_SIMULATE_ACC_LEN, so a configured 1.0 can still accept past a trimmed compact verify window. Allow the pin only when the simulated length is exactly 1.0 with match-expected sampling.
…d execution checks
1d71ced to
7b8d4f0
Compare
This comment has been minimized.
This comment has been minimized.
|
Refreshed this PR on main @davidorman I reused the commits from #42718 (packed-token mapping and Engram @hnyls2002 @Qiaolin-Yu Could you review the PD decode gate, attention-TP budget Please pay particular attention to the remaining numerical boundary: real Could an authorized maintainer trigger the full base + extra CI for this head, The automatic Base run |
DeepSeek-V4.1 DSpark rejects dynamic verify on PD decode. This enables
compactand
cap-accepton decode while keeping prefill static and preserving main'sMooncake/NIXL, attention-DP and interleaved Prefill-CP validation.
The attention TP group broadcasts the chosen budget before selecting the layout
and graph tier. The SPS profiler accepts a separate decode control URL: generation
uses the PD router, while budget updates, observations, abort and reset reach
decode. Observations distinguish logical target rows, padded input rows and the
CUDA graph capacity actually replayed. Off-diagonal profiling rejects eager
fallback, ineffective budget pins and inconsistent execution geometry.
Dependencies and calibration fixes
Engram extend path, preserving the original commit authorship. There is no
parallel mapping kernel in this PR. It also includes [Fix] dspark: Produce correct SPS cost tables when profiling a server without a table #42711's pinned-budget
corrections. Both dependencies remain open; their commits can be dropped
after they merge.
dspark_force_budget_frac: nullnow resets the pin through HTTP/msgpack.Other null updates remain invalid, and invalid mixed updates are atomic.
budget underfilled. Profiling pins now retain confidence ranking with cutoff
zero, including zero-probability prefixes; reset restores the normal policy.
avoiding the B12/0.7 truncation mismatch (41 vs 42 draft slots).
Validation
Final head
7b8d4f061ais based on maineae134d61f. 120 focused tests and75 subtests pass, including real CUDA graph replay of both layout variants,
changing request layouts, short/empty rows, padding, and a real Gloo subgroup
whose leader is global rank 1. Pre-commit passes.
Full-model checks on H20 TP8/EP8 with released DeepSeek-V4.1-Flash weights:
positions, including a separate 30K-context probe. All compared logits are
finite. PD graph repeats are bitwise equal at those 149 positions.
target-only prefixes and all 78 compact/static aligned positions. PD batches
are aligned by request ID and token position across split/reordered layouts.
top-1 is 38/42; static/target-only is 36/42; compact/static is 73/78. Static
graph/eager is 78/78. Monolithic compact graph/eager has weighted MAE 0.07658
and max absolute error 4.24219; target-only MAE is 0.92134 and max error 14.75.
A BF16 MoE diagnostic did not eliminate differences and was not full-model
BF16. These checks establish mapping/history consistency, not losslessness.
4e6b50e506on main306ccf6f57, before the isolatedforced-pin/profiler corrections. The final main refresh changes GLM chat
templates, NPU attention and tests; the native token-ID H20 path is unchanged.
All 20 PR files are byte-identical across that final rebase. Formal decode
uses final HEAD; static prefill remains on
4e6b50e506.SPS was recalibrated using actual replayed graph rows: 25 fit cells, numeric
rank 12/12; fit median/max error 1.00%/3.05%. Ten independent hold-outs pass
median/max 1.55%/12.31%; two additional graph-tier checks pass at 1.86%/2.18%.
Every captured tier has a physical measurement, with at least 10 measured steady
seconds per valid cell. Invalid underfilled/rounding attempts are retained and
excluded. Logical costs expand through graph buckets, so the table invents no
savings within a fixed replay tier. Simulated AL1 is used only for cost fitting.
PD measurements
Two poc-beijing nodes, 8 H20 GPUs per role, TP8/EP8, attention DP1, Mooncake,
1P1D, full verify width 6, Decode max-running 16. Default folded proposal and
overlap, no simulated acceptance, forced budget or diagnostic hooks. Frozen
16 public LongBench-v2 inputs span 12,678–30,324 tokens; caches are flushed per
trial. Each fresh process has an untimed identical warmup. No request retries.
A separate C64/N64/output1024 pair gives +0.86% E2E TPS, API TPOT
8.461 → 7.516 ms (−11.17%), and strict draft AL 2.742 → 2.422. Static/compact
have sampled continuous B16 windows of 24.8/15.8 seconds, but whole-trial full
coverage is only 56.1%/37.5%, below the 95% gate. This pair is not pooled with
ABBA. Its first attempt lost Decode GPU monitoring during compact startup;
that coverage failure is retained, and both arms were repeated with identical
settings after repairing the sampler. All 448 requests in the original ABBA
and replacement pair completed with zero failures/retractions and complete
GPU monitoring. Independent raw-record aggregation and OLS fitting verify all
37 SPS points and all 1,248 requests, including warmups and excluded trials.
Original C16 mean paired E2E gain is 7.24%; C1 is effectively unchanged. These
are complete client-workload results, not stable B16 decode-only claims:
none of the original trials achieves a continuous sampled 10-second full-target
window or 95% whole-trial coverage. C16 repeats the 16 inputs four times and
reuses about 72–73% of prefill tokens within each trial; this is not a cold,
unique-prompt workload. API TPOT is derived from native
decode_throughput,not isolated GPU kernel time. Strict draft AL excludes the bonus; AAL = AL +1.
Complete output strings differ on every original static/compact comparison. Same-mode
repeats also have 0/16 (C1) and 0/64 (C16) exact matches for both static and
compact. Baseline variability does not establish task-quality equivalence.
No answer-quality score or lossless guarantee is claimed. NIXL, attention DP
and Prefill CP have configuration-test coverage only. H20 does not activate
DSv4.1's Blackwell candidate graph variants; the two-variant CUDA regression
covers their layout/mapping geometry, not Blackwell full-model execution.
CI States
Latest PR Test (Base): ❌ Run #39429081078
Latest PR Test (Extra): ❌ Run #39429080833
Latest PR Test (AMD ROCm 10): ❌ Run #39429080934