Repository navigation
docs: the quiet-box rows table exists now, and 12 rows is the smallest margin rather than break-even - #943
Conversation
… called break-even #929 merged saying 'a genuinely quiet-box table is still owed'. It arrived: a watcher held no ticket until load1 stayed under 4 for five minutes, then spent one 24 s window at load 1.72-2.73 with 60 timed calls per leg, three rounds. On a quiet box every shape is faster at 12 rows - k/v 1.13x, the other four 1.17-1.23x - where the loaded take had k/v at 0.98-1.06x. Both are real; the difference is the box. The quiet run is the one to trust because of its internal spread: within a cell the host loop varies 1.00-1.09x at load 1.7-2.7 against 1.51-3.45x at load 5-14. So the boundary sentence is neither 'every shape faster from 12' (also #929's fix) nor 'break-even at 12': 12 rows is where the margin is smallest, and 16 (1.53-1.64x) is the first count that keeps more margin than a busy box adds. kDeviceMinRows stays 16 and gemm_q8 is untouched - this is the reason for the constant stated correctly, not a change to it. Both tables are now in docs/onnx.md with their loads and spreads; docs/onnx-pack.md and the comment beside kDeviceMinRows say the same thing in one sentence each.
PR Reviewer Guide 🔍(Review updated until commit e971b68)Here are some key observations to aid the review process:
|
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT: READY at 679666843. The quiet table reproduces from the raw file exactly, the spreads reproduce, and the
ONNX gate it cites passes here in a fresh unoptimized build.
Re-derived from the quiet run's own output (/tmp/qdq-quiet-timing-2.txt, 60 lines = 5 shapes x 4 row counts x 3
rounds, repeats=60 per leg), medians of host/device:
1 row 12 rows 16 rows 32 rows
q 0.10x 1.17x 1.56x 3.07x
kv 0.10x 1.13x 1.55x 3.00x
gu 0.10x 1.19x 1.53x 3.09x
o 0.10x 1.17x 1.60x 3.19x
d 0.10x 1.23x 1.64x 3.17x
— identical to the PR's table in every cell. The spread sentence also reproduces on both takes: within a cell the host
loop's max/min is 1.00–1.09× in the quiet run and 1.51–3.45× in the loaded one, and the loaded run's k/v at 12
rows is 0.98× ("as little as break-even"), which is what the new wording claims. So the two takes are consistent
with each other and the difference really is the box.
The gate, re-run (cmake -S onnx -B /tmp/qdw-host-qt, fresh unoptimized Ninja build, then ctest):
6/6 passed, 37.15 s — the same six tests, slower than the PR's 22.84 s because my run hit two thermal pauses
(thermal: paused at 78C), which is the PR's own point about timings and this box in miniature.
kDeviceMinRows is still 16 and gemm_q8 is untouched; the change is the reason recorded beside the constant plus
the docs, which is the right shape for a follow-up to #929 (it does not re-open what #929 settled, it corrects the
boundary sentence to what the quiet take shows).
One nit, in the shipped comment: onebit_ep_kernel.h now says "at 16 rows they are 1.53-1.64x either way". The
quiet take is 1.53–1.64×, but the loaded take's 16-row range is 1.45–1.65× (o is 1.45) — so "either way" is a
little optimistic. docs/onnx.md scopes the 1.53–1.64 figure to the quiet table and is correct; only the header
sentence generalises. "1.53-1.64x on a quiet box and 1.45-1.65x loaded" would be exact.
CI: build + Analyze x4 + CodeQL green at this head.
…-1.64x quiet The header comment beside kDeviceMinRows generalised the quiet-box 16-row range to both takes. The loaded take's 16-row range is 1.45-1.65x: o at 2048x1024 measures 1.45x, everything else sits at 1.52-1.65x. Both figures now stated, which is also the only form consistent with docs/onnx.md, whose tables are generated as median(device)/median(host) per cell - the estimator that gives 1.45 for that cell (the median-of-per-round-ratios estimator gives 1.52 for the same data, so the sentence has to use the table's).
|
The nit is right, and the interesting part is which estimator it exposes.
Worth recording, because it is a live trap in the tables rather than a typo: No change to Gate after the edit (comment-only, but this lane runs it): Gate at the new head, and a warning about the reproduce line in that body. My first attempt to re-run the gate Re-run with a dir named for this PR and the source directory printed before the build: 6/6, 20.60 s, full compile this time (15/15 steps — the previous "green" run built nothing). So your 37.15 s run stands Head |
|
Persistent review updated to latest commit fe7f29c |
1 similar comment
|
Persistent review updated to latest commit fe7f29c |
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT: READY at fe7f29c (re-verdict of my READY at 6796668).
The nit I posted at 6796668 is closed: onnx/ep/onebit_ep_kernel.h now says 16 rows is 1.53–1.64× on a quiet box and 1.45–1.65× on a loaded one instead of "either way", and 1.45 is the loaded take's floor (o 2048×1024), which is exactly the cell my earlier re-derivation from the loaded data disagreed with.
Re-checked at this head:
- head
fe7f29c7dabbe52494a99e15b0d07781cffc6608=refs/pull/943/head, andgit diff 6796668 fe7f29cis one file, +2/−1, the comment only — no table or code change rode along. - CI at this head:
buildSUCCESS,Analyze (actions|c-cpp|javascript-typescript|python|rust)SUCCESS,CodeQLSUCCESS,pr_agentSUCCESS,hw_gateskipped. Nothing pending. kDeviceMinRowsstill 16 andgemm_q8untouched at this head.- The quiet table itself I re-derived from the raw take when I reviewed
6796668and it matched every cell (12 rows 1.13–1.23×, 16 rows 1.53–1.64×, 32 rows 3.00–3.19×, 1 row 0.10×); this head does not touch it.
One nit, not a gate: docs/onnx.md:193 (the "re-measured on a second boot" paragraph) states the same loaded 16-row range as 1.40–1.65×, while the code comment now says 1.45–1.65× — two estimators/round-subsets of the same take, which the doc explains elsewhere but not at that sentence. One clause ("median-of-medians, rounds 1–2") would make the two agree on their face.
tprs-ready stands at this head.
|
Persistent review updated to latest commit 5bf5205 |
|
Persistent review updated to latest commit 1c5c1d7 |
|
Persistent review updated to latest commit ab39ec8 |
|
Persistent review updated to latest commit 19945b5 |
|
Persistent review updated to latest commit e971b68 |
Docs-only, and it closes the item #929 merged with explicitly open ("a genuinely quiet-box table is still owed: this box has not been quiet for any of the three attempts so far"). The table arrived tonight, and it moves the one cell #929 called break-even.
What changed and why
~/wt/qdq-quiet-watch.shholds no ticket untilload1stays under 4 for five consecutive minutes, then spends one shortnpu-holdticket. It fired at 23:18 AST: ticket01793756550241566970.qdq(8 s to token), one 24 s window, rounds at load 1.72 / 2.45 / 2.73, die 64–69 °C, 60 timed calls per leg, three rounds, same five M=32 designs.On a quiet box every shape is faster at 12 rows — k/v 1.13×, the other four 1.17–1.23× — where the loaded take (#929's) had k/v at 0.98–1.06×. Both are real; the difference is the box, not the kernel.
The reason to prefer the quiet run is its own internal spread, which is now the sentence the docs use: within a cell the host loop varies 1.00–1.09× at load 1.7–2.7 against 1.51–3.45× at load 5–14. That is also the honest reason
kDeviceMinRowsis 16 rather than 12: at 12 the margin (1.13–1.23×) is smaller than what a busy box adds, and at 16 (1.53–1.64×) it is not.So the boundary sentence becomes neither "every shape faster from 12" (what #929 removed) nor "break-even at 12" (what #929 put in its place) but: 12 rows is where the margin is smallest; 16 is the first count that keeps more margin than a busy box adds.
Files
docs/onnx.md— the boundary sentence, the routing paragraph, and the new quiet take as its own table with load, spreads, and the reproduce line.docs/onnx-pack.md— the same statement in one sentence.onnx/ep/onebit_ep_kernel.h— the comment besidekDeviceMinRows(the sentence the constant's own header still carried).kDeviceMinRowsis still 16 andgemm_q8is untouched — this corrects the reason recorded for the constant, not the constant. No code changes.Gate
Fresh build dir, unoptimized (the stricter configuration):
cmake -S onnx -B /tmp/qdq943-host -G Ninja(build dir named for this PR — see the note below)&& cmake --build … -j8 && ctest --output-on-failure→ 6/6 passed, 22.84 s (ort_info,onebit_ep_proof,onebit_ep_proof_cpu_fallback,onebit_ep_qdq_proof7.69 s,_qdq_proof_unfused7.19 s,_qdq_proof_qdq_only7.62 s).tools/copyright.py --checkrc 0.The same six tests took 253 s on this box an hour ago at load 33 and take 22.8 s now — which is the same point the docs make about the timing table, measured on the test suite by accident.
What this does not do
It does not re-open the device-vs-CPU-EP model question:
~/models/q8(the four Quark A8W8 exports) and the calibration venv were deleted between sessions, so the model-level prefill number is still not measured — recorded in the lane's state file, not claimed here. It also does not movekDeviceMinRows; the measurement supports 16 with more margin than before, not a different constant.Two notes added after the READY verdict
1.45-1.65x (o at 2048x1024 is 1.45x, the rest 1.52-1.65x). Both are now stated. This is also the only form
consistent with
docs/onnx.md, whose tables aremedian(device)/median(host)per cell — the estimator that gives1.45 there. The median-of-per-round-ratios estimator gives 1.52 for the same data; the sentence beside the constant
has to use the one the table uses.
/tmp/qdw-host-qt. The first re-run of this gate came backninja: no work to doand was buildingpi-prs' worktree, because the build dir named in an earlier version of this body had been configured from
~/wt/tprs-842/onnxby the reviewer. A green line from a build dir you did not configure is not evidence about yourtree;
grep CMAKE_HOME_DIRECTORY CMakeCache.txtin front of the build is the cheap fix, and it is now in the commandabove (
/tmp/qdq943-host, configured from this branch).