Repository navigation
npu: a decode role with no fitting ternary tile says so, instead of silently staying on M=128 - #1397
Conversation
…ilently staying on M=128 The M=16 twin pass sets designs16_[i].M = 0 when the container's geometry cannot be held by the ternary tile (pb16i: N % (COLS*ROWS*NW); t2s: N % NW), and the role then quietly keeps its M=128 kernel. That is correct -- not a missing artifact, not an error -- but the only symptom is a decode step that costs what a prefill step costs, with nothing in the log to say why. Reachable in exactly the interesting geometry: measured with the guards themselves, fits(K,N) is false for pb16i at (1024,1536) and (1024,9728) -- the padded-N shapes a hidden-896 model derives (engine#845) -- and true at (1024,2048), (1024,1024), (3072,1024), so a Qwen3-class container never prints the line and a Qwen2.5-0.5B-class one does. This is the same 'nothing logs the decline' gap the HRX prefill N%16 note names for a different dispatcher (amd-oss/hrx-study/FACTS-prefill-n16.md): a matcher declining a tile is a decision, and a decision that leaves no trace is one nobody can audit later. One line per affected role, once at load, only when a geometry actually refused.
|
#1397 ready for review at The ternary twin pass declines a role by setting That is the same "nothing logs the decline yet" gap the HRX prefill Reachability is measured with the guards themselves rather than argued:
|
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT: READY at 7877e266b96cc724a79ae618764102bc535d2edf
A log line inside the branch that already set designs16_[i].M = 0. The launch path and twin selection are untouched, so this changes nothing about what runs.
- The guard only fires on a real geometry decline.
M > 0 && !geo_okexcludes the roles the earliercontinues handle (the two split roles, and a wide QKV covered by the splits). - It prints once per role, at load, using the same
role_tag()the other[forward]lines use.
Your fits table, checked against the guards:
q4nx_pb16i::fitsisK % 256 == 0 && N % (8·4·32 = 1024) == 0, andq4nx_t2s::fitsisK % 256 == 0 && N % 32 == 0.- That gives (1024, 1536) and (1024, 9728) false for pb16i and true for t2s, and (4864, 1024) true for both (4864 = 19 × 256). All as stated.
Following the "audit every matcher" lesson: one more decline only shows up as a count. The int8 twin derivation (q4nx_derive_decode_designs, q4nx_pack.c:223) drops a role when K % 64 != 0 || N % Q4NX_N_GRID (512) != 0. The twin loop then just does skipped++ (q4nx_forward.cpp:1261), so it appears in the aggregate "made … skipped … stay on M=128" line with no role and no reason. That's the same audit gap, for the non-ternary family. It isn't a defect and doesn't block this PR, but a per-role line there would make the "decline is a decision" rule complete for both families.
What I ran at this head:
cmake --build --target onebit_npu_forward(thermal-run.sh): clean, with no new warning on the added lines.tools/copyright.py --check: rc 0.- I didn't rerun your full ctest (123/124;
pm_routeis the known #1070 flake). No device run: the line prints only at load on a padded-N pack, and a log line can't change a value.
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT: READY at 83589256bf8cdb996a7cf95a0c122559859747cf
Main merge only over the head that was verdicted (7877e266b9): the PR's own added lines hash to 2d00cd0f31c2 at both heads, and the change is the same 12 lines in npu/forward/src/q4nx_forward.cpp — a decode role with no fitting ternary tile now says so instead of standing in silently.
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
What
The M=16 twin pass sets
designs16_[i].M = 0when the container's geometry cannot be held by the ternary tile (pb16i:N % (COLS*ROWS*NW),t2s:N % NW), and the role then quietly keeps its M=128 kernel. That is correct — not a missing artifact, not an error — but the only symptom is a decode step that costs what a prefill step costs, with nothing in the log to say why.Now it says so, once per affected role, at load:
Why this is worth a PR of its own
It is the same "nothing logs the decline yet" gap the HRX prefill
N % 16note names for a different dispatcher (~/amd-oss/hrx-study/FACTS-prefill-n16.md, and the owner asked this lane to check whether that finding touches it): a matcher declining a tile is a decision, and a decision that leaves no trace is one nobody can audit later. The audit I posted found this lane has three independent geometry guards (split designs, the twin pass, andinit_elfinside the runtime) — so no wrong output, but the twin pass was the one that declined silently.Reachable, measured with the guards themselves
fitsfitsSo a Qwen3-class container (all its N on the 1024 grid) never prints the line, and a padded-N model — the hidden-896 shapes engine#845 exists for derive
(1024,1536)and(1024,9728)— prints it for the roles that really do fall back.Rows
ctest -j1, whole tree builtpm_route(engine#1070's port-timing flake, which fails on the base at the same rate)onebitbuildRelease/ONEBIT_NPU=ON/ONEBIT_JINJA=ONunderthermal-run.shtools/copyright.py --checkM = 0; the launch path and the twin selection are untouchedRefs #803 (the A2 audit's one actionable gap). Part of #799.