Skip to content

Report the time a request spends before the waiting queue in the timings block #939

Open

Description

@RaunakGengiti2725

Before you start

  • I have read the Roadmap and this is not already planned there.
  • I have read the FAQ.
  • I have searched existing issues and found no duplicate.

Applies to

Engine

What problem does this solve

The timings block (--enable-timings-report) starts when the scheduler admits a request, so everything before the waiting queue is invisible: request parsing, chat template rendering, tokenization and the hops between the API, tokenizer and scheduler processes. On an RTX 5090 with an 8,192-token prompt, client first token was about 328 ms while server prompt time was about 282 ms, and nothing in the report said where the rest went. In my measurement, tokenization alone was about 36 ms of it.

Proposed solution

Add consecutive spans to the timings block of chat completions: parse_ms, render_ms, to_worker_ms, tokenize_ms, to_scheduler_ms, admit_ms, and on streams reply_ms (first sampled token to its first piece of text). Report only; nothing is stamped without the flag. I have this with tests and an A/B showing no speed change: #932.

Alternatives considered

Measure from the client. That shows the total gap, but cannot split it between parsing, tokenization and process hops.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions