mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[GH-ISSUE #485] PCIe probe can read ~3x low and pin pcie_frac far below the calibrated value #223
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#223
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?
Originally created by @yannickloth on GitHub (Oct 2, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/485
probe_pcie_h2d_gbps()(src/program/generate.cpp) measures one 256 MiB x4 pinned burst after a single warmup and derivespcie_fracfrom it. On the same machine the same binary read the link at very different rates across starts, and a low sample pinspcie_fracwell below whattools/calibrate.pypicks.Environment
current_link_width=16,16.0 GT/s)Measurements (same host, across starts)
tools/calibrate.pyon the same host (decode tok/s,--spec-min-pfixed):--pcie-fracSo the auto value the probe produced (0.12-0.15) is ~5 tok/s below the calibrated 0.35, and 0.35 also edges out the 0.55 default.
Likely cause
One 256 MiB x4 burst (1 GiB) after one warmup, on the default stream, with no retry/median and no exclusivity check: concurrent copy-engine work, ASPM/low link power state, or a context that has not ramped can depress the single sample, and the result is then used as a hard tuning input.
Suggested fix
Prime the link and take the median of several bursts (a host-side fix is on the
fix/pcie-probe-medianbranch of my fork), and/or read the trained link width/speed (NVMLnvmlDeviceGetCurrPcieLinkWidth/...LinkSpeed) instead of one bandwidth sample. Note also thebw / 26formula's discontinuity at 20 GB/s (19.9 -> 0.42, 20.0 -> 0.55), which a noisy sample can straddle.A full write-up of this host (hugepages, probe, calibration) is in
bench/results/2026-10-02-rtx-a3000-i7-12850hx/.@meelonjisoo-commits commented on GitHub (Oct 2, 2026):
Data point from a different direction on this, in case it helps scope the fix.
Our box: RTX 3080 (gen4 x16) + Tesla V100-PCIE-32GB sitting in the chipset gen3 x4 slot. The probe reads the V100's link at 2.8 GB/s ->
pcie_frac 0.00, and that reading looks correct for the slot (gen3 x4 = 3.94 GB/s theoretical), not a mis-read.What the
0.00fallback costs, and what it does not (0.1.35, IQ3_XXS, 32K cold prompt; startup logs otherwise identical apart from the probe line):Solo, the fallback is enormous. The same V100 at 2.8-2.9 GB/s ->
0.00-> 305 t/s prefill. Moved to the CPU-attached x16 slot (probe 13.1 GB/s ->0.28), same binary and config: 729 t/s = 2.4x, with the only log difference being the probe and thepcie_fracderived from it.In a layer split, the fallback costs nothing. On a 3080+V100 split, forcing the second stage's policy to the values a wider slot would select changed nothing at all:
--pcie-fracforced (all stages)(vs 549.5 at the probe-derived
0.00.) With a balanced placement, that stage's cache covers ~100 % of its own layers' profile, so the PCIe share has almost nothing to route during prefill. The split's 2.9x loss there turned out to be the placementK, not the link — filed as #509.So the calibration matters most exactly where cache coverage is incomplete (a single card on a narrow link, or a stage whose layers do not fit its VRAM), and a low probe reading is not automatically the explanation for a slow split.
Two suggestions if either is useful:
pcie_fracit derived — that alone lets a user tell a mis-read from a genuinely narrow link.--pcie-fracis a single value that overrides every stage's own probe (pcie_givenshort-circuits the per-stage branch), so raising it for the narrow second card also lowers the fast card's setting. A per-stage override (or reusing the existing request-levelpcie_frackey for serve requests) would make that measurable.@Niko1221 commented on GitHub (Oct 2, 2026):
Fixed in 0.1.37: the probe times four 256 MiB bursts and takes the fastest (a disturbance only slows a copy), and the PCIe share now follows the measured speed smoothly below 20 GB/s (
base x min(1, GB/s / 20)) instead of jumping. Above 20 GB/s nothing changes. The probe line lists every burst. Thanks for the data!