Repository navigation
feat(server): split the time before the queue in the timings report - #932
Draft
RaunakGengiti2725 wants to merge 1 commit into
Draft
RaunakGengiti2725 wants to merge 1 commit into
RaunakGengiti2725 wants to merge 1 commit into
Conversation
Under --enable-timings-report a chat completion's timings gain parse_ms, render_ms, to_worker_ms, tokenize_ms, to_scheduler_ms and admit_ms, the spans from the request's arrival to the waiting queue, stamped in the API server, the tokenizer worker and the scheduler. A stream also reports reply_ms, from the first sampled token to its first piece of text.
3 tasks done
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.
Closes #939.
The timings block (
--enable-timings-report) starts at admission, so time before the waiting queue went unreported. Chat completions now carry consecutive spans:parse_ms(arrival to the handler),render_ms(the handler up to submit; on a stream it holds the chat template pre-check),to_worker_ms,tokenize_ms(the worker's template render and encode),to_scheduler_msandadmit_ms. A stream addsreply_ms, from the first sampled token to its first piece of text. Report only; without the flag nothing is stamped.A/B against main 2fb371e. RTX 5090 (575 W), AMD EPYC 9354, driver 615.71.09,
nvidia/Qwen3.6-35B-A3B-NVFP4. One interleaved run, 2 rounds, order reversed. Both arms:ft serve --model nvidia/Qwen3.6-35B-A3B-NVFP4 --enable-timings-report --moe-strategy fused --max-running-requests 1 --speculative-algorithm mtp --speculative-num-steps 3. Unique streamed chat prompts of 128 to 32,768 tokens, greedy, 128-token replies; client first token, median of 6 (4 at 32,768).No change beyond noise; replies 32/32 equal main's. 8,192-token spans, median ms: parse 0.89, render 0.88, to_worker 0.53, tokenize 36.42, to_scheduler 0.61, admit 0.02; reply 2.11. Non-streamed requests: not measured on main yet.
Tests (no GPU).
tests/server/test_generation_accounting.py::test_timings_split_the_time_before_the_queue_across_the_processesfails if the tokenizer worker drops its two stamps,timings_blockstops copying the spans, or a span is renamed.tests/server/test_openai_api.py::test_chat_completion_stamps_the_message_only_under_the_flagfails if the handler stops stamping or stamps without the flag;tests/scheduler/test_scheduler_chunked_prefill.py::test_chunked_reqs_share_one_stats_stamped_at_the_first_chunkfails if the waiting queue drops the stamps;tests/scheduler/test_cost_accounting_core.py::test_scheduler_stamps_the_receipt_on_an_admitted_user_msgfails without the scheduler's receipt stamp. The arrival middleware andreply_ms: A/B only.Tested on real hardware by me.