[PR #5364] [Engine] Keep concurrent request accounting and prompt progress correct #5404

Open
opened 2026-11-07 16:34:58 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/5364
Author: @cennac
Created: 11/6/2026
Status: 🔄 Open

Base: main ← Head: fix/rdna3-monitor-accounting-5306-5307-5318


📝 Commits (3)

  • 4b534b8 Serving metrics: keep prompt progress and rates on their request
  • 1a96d64 Serving metrics: count admission and slot decode work exactly once
  • 2266854 Fix external cache and prefill accounting across prompt yields

📊 Changes

8 files changed (+534 additions, -36 deletions)

View changed files

📝 docs/DETAILS.md (+5 -0)
📝 serve/server.py (+91 -27)
📝 serve/test_ds_parallel.py (+48 -1)
📝 serve/test_parallel.py (+192 -3)
📝 serve/test_replicas.py (+35 -1)
📝 serve/test_request_accounting.py (+28 -1)
➕ serve/test_yield_accounting.py (+132 -0)
📝 serve/web/app.js (+3 -3)

📄 Description

Problem and result

When several requests share a batch engine, the Monitor could show prompt progress, prefill rate, and decode rate from a different request. Batch admission time could also be counted twice or omitted, and a missing native decode time could be reported as zero. Prompt reads that yielded to another request were not included consistently in the final request totals.

After this change, Monitor progress and per-request rates remain attached to the selected request. Batch admission and slot decode figures are combined once, unknown native figures remain unknown, and multiple yielded prompt legs are included in the final accounting. The aggregate decode rate remains available for the overall service view.

Approach

  • Keep prompt progress callbacks on the request that owns the engine control lines.
  • Track admission state until BADM 0 or BDONE, then combine its timing with the slot timing exactly once.
  • Preserve unknown values through carry and segment aggregation instead of converting them to zero.
  • Record yielded prompt legs and merge their prefill statistics when the request completes.
  • Include the selected request id in Monitor slot and live metrics.

Validation

Passed on the upstream branch:

  • python -m pytest -q serve/test_request_accounting.py serve/test_yield_accounting.py — 18 passed.
  • python -m pytest -q serve/test_parallel.py serve/test_replicas.py serve/test_ds_parallel.py — 94 passed, 2 skipped.
  • Local dual RX 7900 XTX service verification: /health returned loaded=true; the service continued to report request ids, prompt progress, prefill rate, and per-request decode rate.

The production service used for the runtime check was Qwen3.8-Flash-Next-IQ3_XXS with the existing dual-GPU MTP configuration. This pull request changes server accounting and Monitor data; it does not change model weights, sampling, engine binaries, or GPU kernels.

Limits

The upstream test environment does not include a dual RX 7900 XTX hardware run. The runtime values above are from the local machine; the unit and fake-engine regression tests run on the branch itself.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Niko1221/Strata/pull/5364 **Author:** [@cennac](https://github.com/cennac) **Created:** 11/6/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `fix/rdna3-monitor-accounting-5306-5307-5318` --- ### 📝 Commits (3) - [`4b534b8`](https://github.com/Niko1221/Strata/commit/4b534b852446adb3b875d124b9bd5c829ceb7bcf) Serving metrics: keep prompt progress and rates on their request - [`1a96d64`](https://github.com/Niko1221/Strata/commit/1a96d64f32543419ab097e0fd4f31548efdeafb6) Serving metrics: count admission and slot decode work exactly once - [`2266854`](https://github.com/Niko1221/Strata/commit/226685425851a0aa16c83bef8192342e989101dd) Fix external cache and prefill accounting across prompt yields ### 📊 Changes **8 files changed** (+534 additions, -36 deletions) <details> <summary>View changed files</summary> 📝 `docs/DETAILS.md` (+5 -0) 📝 `serve/server.py` (+91 -27) 📝 `serve/test_ds_parallel.py` (+48 -1) 📝 `serve/test_parallel.py` (+192 -3) 📝 `serve/test_replicas.py` (+35 -1) 📝 `serve/test_request_accounting.py` (+28 -1) ➕ `serve/test_yield_accounting.py` (+132 -0) 📝 `serve/web/app.js` (+3 -3) </details> ### 📄 Description ## Problem and result When several requests share a batch engine, the Monitor could show prompt progress, prefill rate, and decode rate from a different request. Batch admission time could also be counted twice or omitted, and a missing native decode time could be reported as zero. Prompt reads that yielded to another request were not included consistently in the final request totals. After this change, Monitor progress and per-request rates remain attached to the selected request. Batch admission and slot decode figures are combined once, unknown native figures remain unknown, and multiple yielded prompt legs are included in the final accounting. The aggregate decode rate remains available for the overall service view. ## Approach - Keep prompt progress callbacks on the request that owns the engine control lines. - Track admission state until `BADM 0` or `BDONE`, then combine its timing with the slot timing exactly once. - Preserve unknown values through carry and segment aggregation instead of converting them to zero. - Record yielded prompt legs and merge their prefill statistics when the request completes. - Include the selected request id in Monitor slot and live metrics. ## Validation Passed on the upstream branch: - `python -m pytest -q serve/test_request_accounting.py serve/test_yield_accounting.py` — 18 passed. - `python -m pytest -q serve/test_parallel.py serve/test_replicas.py serve/test_ds_parallel.py` — 94 passed, 2 skipped. - Local dual RX 7900 XTX service verification: `/health` returned `loaded=true`; the service continued to report request ids, prompt progress, prefill rate, and per-request decode rate. The production service used for the runtime check was Qwen3.8-Flash-Next-IQ3_XXS with the existing dual-GPU MTP configuration. This pull request changes server accounting and Monitor data; it does not change model weights, sampling, engine binaries, or GPU kernels. ## Limits The upstream test environment does not include a dual RX 7900 XTX hardware run. The runtime values above are from the local machine; the unit and fake-engine regression tests run on the branch itself. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#5404
No description provided.