Repository navigation
docs/determinism: the REPACK=OFF stop-gap costs 38% of prefill, and that is the number it was missing - #1228
Conversation
…hat is the number it was missing The page names `-DGGML_CPU_REPACK=OFF` as the way to make `cpu` width-invariant, and never said what it costs. #1145 records that cost as the one thing never measured here; this is it. Where the cost lands is fixed by the mechanism the page already describes: the repacked path walks mul_mat output rows in 4-row blocks and the remainder singly (ggml-cpu/repack.cpp:4300-4306), so it is only reached when ne11 >= 4 -- prompt processing, not one-token decode. Measured, Qwen3-0.6B Q4_K_M, -t 8, one build with only libggml-cpu.so swapped between the arms (so every other byte of the payload is identical, verified file by file), 6 requests per arm interleaved by round so the box's other tenants load both equally: prefill 984 -> 612 tok/s (1.61x, -38%) long: 2.10 s -> 3.01 s (+43%) 1183-token prompt, 32-token reply, 3 rounds each, wall clock chat-short 0.60 s vs 0.61 s (a wash) 23-token prompt, 75-token reply decode 82 vs 85 tok/s (ranges overlap: single-stream decode does not pay) Two independently run arms gave 1.607x and 1.618x on prefill. The pair was verified causally before it was measured, and both halves of that check found something: the two arms did not differ until LD_LIBRARY_PATH was set, because the launcher carries an absolute DT_RUNPATH into the build dir -- the first attempt measured the same library twice and produced two identical arms. With the loader pointed at each arm, the width-2/4 oracle reproduces #751 digit for digit (repack on: 6/6 and 6/6 trials moved, worst 2.953e-01; repack off: 0/6 and 0/6, 0.000e+00). Does not close #1145: the width gate itself is still unwritten. This is the cost line a fixer and a user both need in order to decide. tools/copyright.py --check rc 0. One file, docs only.
|
#1228 ready for review at a72091a Docs-only, one file, +9/−1: the measured cost of the Refs #1145 without closing it — the width gate itself is still unwritten. |
|
/review |
PR Reviewer Guide 🔍(Review updated until commit 846abac)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 a72091a2.
The arithmetic of every number in the new paragraph checks out, and the flag it is about is the one already in the page
(determinism.md:277, -DGGML_CPU_REPACK=OFF):
prefill 984 -> 612 tok/s : 984/612 = 1.608 (claimed 1.61x), (984-612)/984 = 37.8 % (claimed -38 %)
wall 2.10 -> 3.01 s : 3.01/2.10 = 1.433 (claimed +43 %)
"two independently run arms gave 1.607x and 1.618x" is consistent with the headline 1.61x
What I did not re-measure is the arms themselves — two libggml-cpu.so builds plus three interleaved rounds on a
box that four other lanes are loading is not something a docs PR should buy, and the page's claim is the cost of a flag
rather than a new capability. What I can say is that the shape of the claim is the right one: it converts a "reproducible
CPU" recommendation into "reproducible, and here is what it costs you on a RAG-sized prompt, and what it does not cost you
on decode", with the decode row (82 vs 85 tok/s, ranges overlapping) stated as a wash rather than dressed up as a win.
The one thing worth a second look before merge is not in the diff: -38 % prefill and +43 % wall for the same
1183-token prompt are consistent with each other only if the reply is the small part of that wall time, which is what a
32-token reply is. That is the case here, and the sentence says which prompt does which, so a reader cannot carry the
43 % over to a decode-bound workload — which is the mistake the paragraph exists to prevent.
|
Persistent review updated to latest commit 5e6cd76 |
|
Persistent review updated to latest commit 846abac |
The page names
-DGGML_CPU_REPACK=OFFas the way to makecpuwidth-invariant, and never said what it costs. #1145 records that cost as the one thing never measured here; this is it.Root cause of where the cost lands is the mechanism the page already describes: the repacked path walks mul_mat output rows in 4-row blocks and the remainder singly (
ggml-cpu/repack.cpp:4300-4306), so it is only reached whenne11 >= 4— prompt processing, not one-token decode. So the cost is a prefill cost, and single-stream decode should not pay. Measured, that is exactly what happens.Measured — Qwen3-0.6B Q4_K_M,
-t 8, one build with onlylibggml-cpu.soswapped between the arms, 6 requests per arm interleaved by round so the box's other tenants load both equally:Two independently run arms gave 1.607× and 1.618× on prefill.
The pair was verified before it was measured, and both halves of that check found something:
LD_LIBRARY_PATHunset means the launcher's absoluteDT_RUNPATHinto the build dir wins, so both arms loaded the same library and produced two identical results. Two suspiciously identical arms is what caught it, not an assertion.libggml-cpucomes from that arm (/proc/<pid>/maps), and the width-2/4 oracle reproduces serve: identical requests served concurrently are not bit-reproducible on cpu and hrx (decode-batch width changes the logprobs; --parallel 4 default) #751 digit for digit: repack on 6/6 and 6/6 trials moved, worst 2.953e-01; repack off 0/6 and 0/6, 0.000e+00.Every other byte of the two payloads is identical — verified file by file (23 files, real paths, not
md5sumover relative symlinks, which resolves against the cwd and lies).tools/copyright.py --checkrc 0. One file, docs only, +9/−1.Does not close #1145 — the width gate itself is still unwritten. This is the cost line that a fixer and a user both need in order to decide, and the issue's "Cost" section asks for exactly it.
Data:
~/wt/rlk-ab/{pp_ab_par1.json,pp_ab_short.json,wall_ab.json}on strixhalo; harness~/wt/rlk-ab/{pp_ab.py,wall_ab.py,repack_oracle.py}(all self-tested). No GPU, no NPU, no ticket — this is a CPU-only measurement on a box whose GPU was held by another lane all night.