mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #2423] [CLOSED] serve: GET /metrics gives each request's PCIe expert bytes and its own KV streaming share, and a bandwidth summary #4037
Labels
No labels
needs-format
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Niko1221/Strata#4037
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/Niko1221/Strata/pull/2423
Author: @MrKop-git
Created: 10/14/2026
Status: ❌ Closed
Base:
main← Head:pr/bandwidth-observability📝 Commits (1)
4339655serve: GET /metrics gives each request's PCIe expert bytes and its own KV streaming share, and a bandwidth summary📊 Changes
4 files changed (+173 additions, -3 deletions)
View changed files
📝
docs/DETAILS.md(+12 -1)📝
serve/server.py(+66 -2)📝
serve/test_monitor.py(+61 -0)📝
serve/test_server.py(+34 -0)📄 Description
Summary
Observability for the bandwidth view (the link-tier work in #2099), server side only:
offloaded(the DONE line's count of routed experts the GPU read over PCIe) aspcie_experts_mibandpcie_experts_gib_sover the request's decode time. The blob size is the mean the engine reports for its own expert cache (its INFO line'sexpert_cache_miboverexpert_slots) - a pack's blobs differ in size (a native pack has one size per layer: the default is 1,382,400 B, NVFP4 2.76 MB, IQ2_XS 1.51 MB), so no constant is assumed and the fields arenullwhen the engine did not report enough.kv_block_reads,kv_hit_pct,kv_ram_mib: one request's own share of the engine's per-requestKV streaming:summary. That summary's counters are cumulative over the process (generate.cpp's own comment), so the server reports each line's difference from the previous one and matches it to the request that owns it - the line's own numbers are not a request's share. A request whose engine died before writing its summary keepsnull; the fields are absent while KV streaming is off.GET /metrics— a"bandwidth"object: mean and peak of the 1 s hardware series since the start (gpu_pcie_rx_mb,gpu_pcie_tx_mb,disk_read_mb,disk_write_mb;nullwithout hardware telemetry).What it changes and what it leaves alone
Additive fields in the JSON of
GET /metrics(the same wayconversation_cachewas added), plus the fields' description in docs/DETAILS.md. The engine, its DONE line and every answer are untouched - no flag, no default change.How it was checked
serve/test_server.py(PcieExpertsBytes): the bytes and GiB/s from the engine's own cache size, andnullfor zero offloaded / no INFO / an older engine's DONE line.serve/test_monitor.py(KvStreamingLines): two cumulative summaries become their differences (1000 then 2000 reads, 0.8 then 1.0 MiB, 80.0% then 87.5% per request), taken once each and attached to the right request rows throughGET /metrics.KV streaming:line (the exact float formatting is pinned by the tests' strings against generate.cpp's%.2f%% of %llu block reads/%.1f MiB), and multi-slot (--batch) attribution - with several slots finishing at once the lines still arrive in finish order and the rows match that order.🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.