Repository navigation
Conversation
ormandj
requested review from
Qiaolin-Yu,
Ying1123,
hnyls2002,
merrymercy and
xiezhq-hermann
as code owners
October 6, 2026 04:45
ormandj
force-pushed
the
dspark-forced-budget-verify-all
branch
from
October 7, 2026 05:42
83a84bc to
8c443d9
Compare
17 of 56 tasks
This was referenced Oct 22, 2026
…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.
ormandj
force-pushed
the
dspark-forced-budget-verify-all
branch
from
October 29, 2026 21:53
8c443d9 to
0c2039f
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Without this change, an SPS cost table profiled on a server that has no table yet records full-width verify costs for every budget, so the planner that uses the table plans from wrong costs.
python -m sglang.benchmark.dspark_sps_profiler run --fracs ...profiles the off-diagonal SPS costT(bs, M)by pinningdspark_force_budget_frac(through/set_internal_state) on a server runningSGLANG_RAGGED_VERIFY_MODE=compact. A server started without--speculative-dspark-sps-table-pathhas the flat, uninitialized table, soDSparkVerifyPlanneris verify-all. This is the state when profiling the off-diagonal costs without a seed table.schedule_layoutthen returns the cached full-width layout before it looks at the budget. The budget planner does compute the pinned budget, but the layout ignores it. Pinned cells still run full-width verify, while the profiler records them under the requestedM; its validation does not reject the mismatch.I observed this on DeepSeek-V4.1-Flash, TP4 on 4x RTX PRO 6000 Blackwell (SM120), gamma=5: a
--batch-size 1 2 4 8 --fracs 0.2 0.4 0.6 0.8 1.0sweep on a server with no SPS table recorded only full-width steps (bs=4 always verified 24 tokens). The same sweep on a server started with a 1D table applied the budgets, for example bs=8 ran at 44.3 steps/s with 16 verify tokens vs 33.8 steps/s with 48.#40567 changes how profiler control reaches the planner; it leaves this verify-all shortcut unchanged.
Modifications
DSparkVerifyPlanner.schedule_layout: the verify-all shortcut (cached uniform layout) now applies only while no budget fraction is pinned. Clearing the pin (dspark_force_budget_frac=Nonethrough/set_internal_state) brings back the cached layout./set_internal_staterejects pinningdspark_force_budget_fracwhile simulated acceptance is on (SGLANG_SIMULATE_ACC_LENabove 0), unless the length is exactly 1.0 withSGLANG_SIMULATE_ACC_METHOD=match-expected(the default), which always accepts exactly one token.multinomialsamples the accept length from a normal distribution aroundSGLANG_SIMULATE_ACC_LEN, so even 1.0 can accept two or more tokens, past a trimmed compact verify window and onto target KV that verify never wrote. Now that a pin trims verify under verify-all, a constant simulated accept length could exceed the trimmed budget, which the DSpark worker already rejects at startup for profiled tables. Clearing the pin is still allowed.TestForcedBudgetUnderVerifyAll(test/registered/spec/dspark/test_dspark_scheduler.py, CPU): with the uninitialized table,schedule_layoutgives the full-width layout without a pin, a trimmed layout atfrac=0.4(12 verify tokens instead of 24 at bs=4, on main 24), and the cached layout again after the pin is cleared.TestForcedBudgetRejectsSimulatedAcceptLength(same file) drivesSchedulerInternalStateController.set_internal_state. WithSGLANG_SIMULATE_ACC_LEN=3, or 1.0 withSGLANG_SIMULATE_ACC_METHOD=multinomial, the pin is rejected and the worker's budget setter is not called. Clearing the pin, and pinning with the variable set to -1.0 (disabled, with either method) or to 1.0 withmatch-expected, still work. On main, the rejection case fails.Serving is unchanged unless a fraction is pinned. The pin is only set through
/set_internal_state, which the profiler uses.Accuracy Tests
This changes pinned layout selection and rejects incompatible simulated-accept-length settings; model outputs are unchanged when no fraction is pinned.
test_dspark_scheduler.py: 29 passed on CPU, including the four new tests.Speed Tests and Profiling
No GPU speed measurements for this diff; serving is unchanged unless a fraction is pinned.
Checklist
Review and Merge Process
/tag-and-rerun-ci,/tag-run-ci-label,/rerun-failed-ciDeveloped with AI assistance.
CI States
Latest PR Test (Base): ❌ Run #40961582812
Latest PR Test (Extra): ❌ Run #40961582767
Latest PR Test (AMD ROCm 10): ❌ Run #40961582732