Skip to content

fix(scheduler): stop the min-free-slots delay once every waiting request fits - #14

Closed
jhinpan wants to merge 1 commit into
kevin-mii:dsv41-amd-mainfrom
jhinpan:fix/min-free-slots-queue-starvation
Closed

jhinpan wants to merge 1 commit into
kevin-mii:dsv41-amd-mainfrom
jhinpan:fix/min-free-slots-queue-starvation

Conversation

@jhinpan

@jhinpan jhinpan commented Sep 24, 2026 •

Copy link
Copy Markdown
Collaborator

Motivation

For the DFlash family (DSpark included) the scheduler auto-enables MinFreeSlotsDelayer, which holds fresh prefills until min(4, max(2, (max_running_requests + 5) // 6)) request slots are free so they are admitted together. When fewer requests than that are waiting and all of them already fit, waiting cannot batch anything more; it only delays them until running requests finish.

On DeepSeek-V4.1-Flash with DSpark and 256 concurrent requests, the server settles at 254 running with 2 queued. With 2 free slots and a threshold of 4, those 2 requests wait for the whole decode of the batch (about 57 s), which is the 86-90 s maximum TTFT of every such burst.

Modifications

  • MinFreeSlotsDelayer.should_delay takes the number of waiting requests and delays only while the free slots are fewer than both the threshold and the waiting requests. With at least threshold requests waiting the behavior is unchanged.
  • The scheduler passes len(self.waiting_queue).
  • Unit test: 254 running, 2 free, 2 waiting is admitted; 3 waiting still waits.

Accuracy Tests

GSM8K (64 fixed questions, natural EOS, concurrency 64) on every server: 61-63/64 in both arms.

Speed Tests and Profiling

MI355X x4, TP4/EP4, DeepSeek-V4.1-Flash dba1be0a, this branch at e2e824dc58, the cookbook MI350X Low-Latency cell (DSpark block 5) with --cuda-graph-max-bs-decode 256, AITER built as in this branch's Dockerfile, plus #8's int64 FlashMLA store fix in both arms. 256 distinct real-text 4096-token prompts submitted at once, 3072 forced output tokens, temperature 0; fresh servers in ABBA order, two scored bursts per server.

Metric Base This PR Change (95% CI)
Burst output tok/s 6966 7315 +5.02% [+4.42, +5.65]
TTFT max 89.1 s 32.0 s -64.1%
TTFT median 15.9 s 15.9 s +0.08% [-0.07, +0.28]
Peak running requests 254 256

Checklist


CI States

Latest PR Test (Base): ❌ Missing run-ci label -- add it to run CI tests.
Latest PR Test (Extra): ❌ Blocked -- run-ci is required first.
Latest PR Test (AMD ROCm 7.2): ➖ No AMD PR run found for this commit.

…est fits

The DFlash-family delayer (auto-enabled for DSpark, threshold 4 at 256
running requests) held fresh prefills until four request slots were free.
When fewer requests than that were waiting and all of them fit, nothing more
could be batched, yet they waited until running requests finished: at 254
running with 2 queued, those 2 waited for the whole decode of the batch.

Delay only while the free slots are fewer than the threshold and fewer than
the waiting requests.
@jhinpan

jhinpan commented Sep 29, 2026

Copy link
Copy Markdown
Collaborator Author

Carried onto dsv41-amd-5-integration (the sgl-project#41308 head) in #18 and re-measured there. Closing in favor of #18.

@jhinpan jhinpan closed this Sep 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant