Repository navigation
scheduler: ATLAS_DECODE_STEPS_PER_CHUNK lets decoders run between a long prompt's prefill chunks (head-of-line) - #213
Merged
Conversation
…ween a long prompt's prefill chunks (head-of-line) While sequences are decoding, run at most one continued prefill chunk per k decode steps instead of one per scheduler tick. The resting path advances each active decode one step per chunk, so a short reply behind a long prompt waits out the whole prompt; holding chunks for k steps lets it finish while the long prompt's TTFT grows by about k decode steps per chunk. Default 0 = unchanged. Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
AzeezIsh
added a commit
that referenced
this pull request
Oct 27, 2026
Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Merged
3 tasks
Contributor
Author
|
n=3 head-of-line A/B on this PR's exact head (e05c6c3), sparky GB10,
With the knob off, outputs are byte-identical to the base (4-request control). At one sequence (r1short gate with k=8), agentic and BFCL were unchanged vs the same profile without the knob. This PR now rides integration train 2 (#217) for its GB10 default-path gate. Marking ready for review. |
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.
Summary
ATLAS_DECODE_STEPS_PER_CHUNK=k(default 0 = unchanged): while sequences are decoding, run at most one continued prefill chunk perkstandalone decode steps instead of one per scheduler tick.Why. On qwen4_exp a prefill chunk costs 1.9 s (2K tokens) to 5.5 s (8K). The resting path advances every active decode by one step per chunk, so a short reply that arrives behind a long prompt waits out the whole prompt. On FP4-Local, 6 short requests sent during a 20.6K-token prefill all finished at about 18 s (sparky, 2026-10-23,
prod_probe_hol.py).What. New
scheduler/phase_continue_prefills/decode_share.rs(76 lines), a 1-line hold inphase_continue_prefills.rs, and 3 lines inscheduler/mod.rs: a decode-step counter, a reset on idle ticks, andhead_just_started(end the tick after a new prompt's first chunk, as under EP) extended to the knob. When the knob is on, it ends the tick so requests that arrived during the first chunk are admitted before the second one.Evidence so far (sparky GB10, nvidia/Qwen3.8-Flash-Next-FP4-Local, PLE cache 2 GB, prefix cache on)
~/code/q10h/queue29.log, 2026-10-27.k=8, agentic-webserver 50: 50/50, 50/50, 11.74 s/turn (run-1792814374289258605); BFCL ST-995 87.34 / 86.50 (run-1792825067944442327). The same profile without the knob scored 11.76 s/turn and 87.34 / 86.50.The shorts finish in two waves of three because the batched short-prompt pass groups the arrivals. A time-based variant (
ATLAS_DECODE_SHARE_PCT) was tried and dropped: 12.8–16 s for the shorts. Reasons are in the campaign log (#211, entry 2026-10-24 02:50).Pending: an n=3 alternating A/B (off vs k=8) on this PR's exact head is queued on sparky (job
20-dshare-hol). This PR stays a draft until it reports. The table above gets replaced by those numbers.Flip condition
Opt-in for now (repo rule: winning opt-in arms state a flip condition). The knob only matters when other sequences are decoding during a prefill, so it is inert at one sequence. If the n=3 A/B holds, the proposal is to turn it on in the multi-sequence FP4-Local profile, then consider a qwen4_exp default where chunk cost is seconds, not milliseconds.
Test plan
-p spark-server --tests, typos, SPDX, file-size capcargo test --release -p spark-server decode_share: 1 passed (off_by_default_never_holds, in the bin target)Generated with Devin