Skip to content

server : add last-5-seconds generation speed display#24291

Merged
ngxson merged 2 commits into
ggml-org:masterfrom
akx:timing-realtime
Jun 18, 2026
Merged

server : add last-5-seconds generation speed display#24291
ngxson merged 2 commits into
ggml-org:masterfrom
akx:timing-realtime

Conversation

@akx

@akx akx commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Overview

This PR adds a tg(last 5s) display to the server token generation speed log.

I noticed tg is computed as an average over the entire computation, which, for instance on my Macbook, doesn't really tell the full story (other than that yes, speed decreases as the context grows longer).

Example:

6.33.268.728  I slot print_timing: id  0 | task 0 | n_decoded =    100, tg =  12.24 t/s, tg(last 5s) =   0.00 t/s
[...]
7.55.294.463  I slot print_timing: id  0 | task 0 | n_decoded =   1005, tg =  11.14 t/s, tg(last 5s) =  10.77 t/s
[...]
11.19.803.987 I slot print_timing: id  0 | task 0 | n_decoded =   2888, tg =   9.80 t/s, tg(last 5s) =   6.98 t/s
[...]
12.49.318.567 I slot print_timing: id  0 | task 0 | n_decoded =   3415, tg =   8.89 t/s, tg(last 5s) =   5.49 t/s
12.52.326.484 I slot print_timing: id  0 | task 0 | n_decoded =   3430, tg =   8.86 t/s, tg(last 5s) =   5.22 t/s
12.55.413.214 I slot print_timing: id  0 | task 0 | n_decoded =   3446, tg =   8.83 t/s, tg(last 5s) =   5.10 t/s
12.58.511.666 I slot print_timing: id  0 | task 0 | n_decoded =   3463, tg =   8.80 t/s, tg(last 5s) =   5.47 t/s
[...]

Requirements

  • I have read and agree with the contributing guidelines
  • AI usage disclosure: YES: assisted by Claude Code (Opus 4.8).

@akx
akx requested a review from a team as a code owner June 8, 2026 06:58
@akx
akx force-pushed the timing-realtime branch from df2c90f to 1568272 Compare June 11, 2026 05:01
@ngxson

ngxson commented Jun 11, 2026

Copy link
Copy Markdown
Collaborator

IMO a sliding window is quite overkill. a rolling windows that is cleared each 5s will be much more simple

@akx
akx force-pushed the timing-realtime branch from 1568272 to bdb1420 Compare June 11, 2026 13:16
@akx

akx commented Jun 11, 2026

Copy link
Copy Markdown
Contributor Author

@ngxson Sure! Replaced with a static 5-second window, no extra allocations.

@ngxson

ngxson commented Jun 18, 2026

Copy link
Copy Markdown
Collaborator

cc @ggerganov : not exactly sure if you think this feature would be useful ?

@ggerganov ggerganov left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's useful to have this info.

@ggerganov ggerganov added the merge ready A maintainer can use this label to indicate that they consider the changes final and ready to merge. label Jun 18, 2026
@ngxson
ngxson merged commit 0802307 into ggml-org:master Jun 18, 2026
25 checks passed
papamoose pushed a commit to papamoose/llama.cpp that referenced this pull request Jun 27, 2026
* server : add last-5-seconds generation speed display

* cont : clean-up

---------

Co-authored-by: Georgi Gerganov <ggerganov@gmail.com>
adrianhoehne pushed a commit to adrianhoehne/llama.cpp that referenced this pull request Jul 5, 2026
* server : add last-5-seconds generation speed display

* cont : clean-up

---------

Co-authored-by: Georgi Gerganov <ggerganov@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

examples merge ready A maintainer can use this label to indicate that they consider the changes final and ready to merge. server

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants