mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #2272] [CLOSED] Monitor: the PCIe traffic from the bytes the engine moved, not from a driver counter #3954
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#3954
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/2272
Author: @unimo-chan
Created: 10/13/2026
Status: ❌ Closed
Base:
main← Head:monitor-pcie-traffic📝 Commits (1)
9972fdfMonitor: the PCIe traffic from the bytes the engine moved, not from a driver counter📊 Changes
9 files changed (+120 additions, -11 deletions)
View changed files
📝
include/strata/core/expert_source.hpp(+4 -0)📝
serve/server.py(+77 -4)📝
serve/telemetry.py(+6 -0)📝
serve/web/app.js(+7 -3)📝
src/core/expert_source.cpp(+1 -0)📝
src/program/generate.cpp(+10 -2)📝
sycl/include/strata/core/expert_source.hpp(+4 -0)📝
sycl/src/core/expert_source.cpp(+1 -0)📝
sycl/src/program/generate.cpp(+10 -2)📄 Description
What this changes
The Monitor's PCIe tile shows a traffic rate only when the driver reports one.
_Nvml.read()fillspcie_rx_mbfrom
nvmlDeviceGetPcieThroughput; nothing else does. An AMD card has no such counter to read: on Windows thereis no NVML, the performance-counter set has no PCIe entry (only the five GPU sets and RDMA Activity) and neither
amdadlx64.dllnoratiadlxx.dllexports a bus metric; on Linux amdgpu'spcie_bwcounts messages, not bytes(#1734). The one component that does know the traffic is the engine: it staged those expert blobs itself.
So the engine counts the bytes and the server turns them into a rate:
ExpertDispatch::pcie_bytes(include/strata/core/expert_source.hpp) — one blob per staged expert, in every--pcie-mode: the copy engine writes them into staging, kernel and direct modes read the host's blob where itlies.
offload_entriesalready counted routed entries, not bytes. Counted inexpert_pool_dispatch_multi, the same placepcie_expertsis.PCIE <bytes>lines at the points where it already flushes a token line(both decode loops and both batch loops), and adds one field to
DONE: the request's own MB.serve/server.pykeeps(time, bytes)samples and takes the slope over the same window the token rate uses(
RATE_WINDOW_S), and reads the request's figure from theDONEline. It fillsgpu_pcie_rx_mbonly whenthe reader says it has no traffic counter of its own — a
has_pcie_throughputflag, True on NVML, False onthe AMD paths — so an NVIDIA card keeps showing NVML's own numbers.
PCIe probe: N GB/s host->device, already on stderr, which the server owns as the log):412 MB/s · 12.1% of 3.4 GB/s measured.The request list's
+X% PCIebadge gains the MB behind it.What it leaves alone
pcie_gen/pcie_widthis added anywhere, and nothing turns a measuredGB/s into a generation (Gen4 x8 and Gen3 x16 measure the same). #2137's point about the Gen headline is a
separate change.
pcie_bw— #1734's question about the three sysfs integers is untouched here;this answers the rate half from the engine instead, which works on Windows too.
older than this prints no
PCIElines and the tile stays as it is.How I checked
python -m unittest serve.test_server.DraftCounts serve.test_server.PrometheusMetrics serve.test_server.PcieShare serve.test_server.CancelledRead serve.test_server.LiveRate serve.test_server.WebApp serve.test_server.AmdTelemetry serve.test_server.TelemetryNoDiskson this branch (main ata0116b2, Python 3.12.10): 27 tests, OK — theclasses that parse the engine's
DONEline, serve/metrics, and run the sampler, with the stock testsunchanged. The
DONEparser still accepts the shorter lines of an older engine: those tests pass as they are.So the
PCIElines and the newDONEfield are exercised against the mock engine, not a real one. Fullserve.test_serveron this branch: 308 tests, OK in 101 s (Windows 11, Python 3.12.10), nothing skipped.the CUDA and SYCL trees get the same lines, and both are unverified by a compiler. A build of
src/(CUDA/HIP)and
sycl/before review is what AGENTS.md asks for; I could not do it, and I am saying so rather thanimplying it.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.