Add scheduler prefill queue wait breakdown#28470
Open
RitwijParmar wants to merge 1 commit into
Open
Conversation
RitwijParmar
requested review from
JustinTong0323,
Ying1123,
fzyzcjy,
hnyls2002,
merrymercy,
sogalin,
sufeng-buaa,
wisclmy0611,
xiezhq-hermann and
zijiexia
as code owners
June 17, 2026 00:18
Contributor
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
RitwijParmar
force-pushed
the
codex/prefill-queue-breakdown
branch
from
June 17, 2026 00:19
fc5608c to
240fde4
Compare
RitwijParmar
force-pushed
the
codex/prefill-queue-breakdown
branch
from
June 17, 2026 00:19
240fde4 to
6f6ecab
Compare
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
Follow-up for #28047.
SGLang currently records total scheduler queue time, but that does not show whether high TTFT came from backlog before a request was considered or from budget pressure after the scheduler first tried to admit it.
This PR adds the missing scheduler-side split mentioned in the issue thread.
Modifications
first_prefill_attempt_timeto scheduler request time stats.PrefillAdderfirst considers a request.prefill_queue_idleandprefill_budget_waitstages.docs_new/.This does not duplicate the pre-scheduler timing work in #25933. It sits inside scheduler admission. It also does not change HiCache tier counters from #26976.
Accuracy Tests
Not applicable. This only adds timing instrumentation and metadata.
Speed Tests and Profiling
Not applicable. The hot path addition is one guarded timestamp write when a queued request is first considered, plus derived metrics when the request enters forward.
Checklist
Local checks run:
/Users/ritwij/.cache/codex-runtimes/codex-primary-runtime/dependencies/python/bin/python3 -m compileall -q python/sglang/srt/observability/req_time_stats.py python/sglang/srt/managers/schedule_policy.py test/registered/unit/observability/test_req_time_stats.py test/registered/unit/managers/test_prefill_adder.pyuvx ruff check --extend-ignore E402 python/sglang/srt/observability/req_time_stats.py python/sglang/srt/managers/schedule_policy.py test/registered/unit/observability/test_req_time_stats.py test/registered/unit/managers/test_prefill_adder.pygit diff --checkI could not run pytest locally because this checkout is not installed with SGLang dependencies in the current environment. System Python missed
pybase64, and the bundled Python does not havepytest. I did run a lightweight stubbed check of the newSchedulerReqTimeStatsmath and metric calls.CI States
Latest PR Test (Base): ❌ Run #27657056151
Latest PR Test (Extra): ❌ Run #27657056150