mirror of
https://github.com/mw00/project-maya.git
synced 2026-12-03 21:08:26 +07:00
[PR #472] [CLOSED] Fix inaccurate decode rate on parallel decode #549
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
mw00/project-maya#549
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/mw00/project-maya/pull/472
Author: @asdacap
Created: 10/25/2026
Status: ❌ Closed
Base:
main← Head:fix-decode-tps-counting📝 Commits (3)
d22fa08Server: the live decode rate is per request (no ~1000 tok/s blips with --parallel or after a burst)d8d4bf6Monitor: with several requests running, the big decode number is their total (the graph's newest point)1cb32e0Monitor: the label under the decode total counts the requests writing📊 Changes
4 files changed (+161 additions, -47 deletions)
View changed files
📝
serve/server.py(+78 -37)📝
serve/test_fair.py(+2 -2)📝
serve/test_server.py(+77 -6)📝
serve/web/app.js(+4 -2)📄 Description
The Monitor's live decode number sometimes jumped to ~1000 tok/s, far above what the engine can do. This fixes how the server counts it, and makes the Monitor's big number follow all running requests under
--parallel.What was wrong
--parallel(READY ... multi=<n>), every request wrote its(time, generated)samples into the oneService.ratedeque, so the rate was taken between two different requests' counts. Example: 813 from one answer against 5 from another, half a second apart, reads as ~1600 tok/s. The order the other way round gave 0.done:line printedn / (now - first token), so a one-token answer read as thousands of tok/s. The setup TUI parses that line for its speed.Changes
RequestStatwith its own samples and first token.Service.current_requestsholds the ones writing, andlatest_requestis the one that last got the engine (it replaces the sharedstatus["first_token"]). The live tok/s is the sum overcurrent_requests. The window is measured fromRequestStat.base, the last sample at or before its start, with no scan. Thedone:line uses the engine's decode clock (DONE'sdecode_ms), the same figure as the Monitor's history row.history.tok_s, the series the graph already draws, so/metrics'liveblock is unchanged for that. With one or no request running, the number is the same as before./metricsgainslive.writing, the requests past their prompt. The label reads "decode · N writing" rather than counting a request that is still reading its prompt.The badge and the header pill are unchanged.
Screenshot
Checks
tools/check_hip_compat.py: passes (no engine code touched).servetests: 368 run on Linux. 10 errors are in the Responses API tests and need a localopenai2.30 SDK. The same 10 fail onmainat v1.1.27, and CI doesn't installopenai, so they skip there.toolstests: not run to completion here (one exits because this checkout isn't set up), and this PR doesn't touchtools/.🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.