You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
npu: step_users refuses position 0 on a re-used slot, so the 'start a new sequence' reset it documents is unreachable #2978
Found on the device while verifying the bumped NPU runtime (npu-kernels#102/#103), with step_users_test's own re-used-slot arm — the arm that exists for exactly this.
What happens
step_users() refuses a pass whose first row for a slot is not at that slot's sequence end (rightly: a row appends at its own position and reads 0..pos). But the guard has no exception for position 0, while the loop immediately below it implements exactly that exception:
npu/forward/src/q4nx_forward.cpp:4815 if (pos[m] != have) { err_ = "step_users: slot ... holds N position(s), but this pass starts it at 0 ..."; return false; }
npu/forward/src/q4nx_forward.cpp:4824 // A slot whose FIRST row is position 0 starts a NEW sequence, so what the previous
// conversation left in its caches is cleared first ... (one clear per slot)
So the reset path is unreachable: a re-used slot at position 0 is refused with the message that describes the case it is refusing.
FAIL step_users on the re-used slot: step_users: slot 0 holds 7 position(s), but this pass starts it at 0
(each row appends at its own position and reads up to it, so a start that is not the end of the slot's
sequence reads state that is not there; position 0 starts a new sequence)
Fix
Exempt pos[m] == 0 from that check, which is what the clearing loop below it already assumes. With the exemption the same run passes the arm and completes:
ok: 3 sequences x 4 rounds, every row bit-identical to its own single-sequence run
A second defect surfaced with it, in the test rather than the engine: the re-used-slot arm resets slot 0 to a 4-position sequence, so the arm after it (a single-slot pass at slot 0's old position 7) was refused for a reason that is not a bug — invisible while the first arm failed and returned early. That arm now runs last, with a comment saying why. Both changes have to land together for the suite to be green on a device.
Whoever takes this: the serve batcher (--npu-batch-users) is the caller that would use a reset between requests, so this is the difference between "a slot can be reused" and "a slot cannot".
Claimed → #2982 (cl-game/2978-step-users-pos0), and both halves reproduced locally, host-GEMM, no device and no ticket — a leftover NPU-enabled build tree in this worktree made that possible, which is worth noting because I had written off NPU verification on this box earlier today.
Three states, one command (ONEBIT_TEST_Q4NX=~/models/npu/Qwen3-0.6B):
origin/main FAIL step_users on the re-used slot: slot 0 holds 7 position(s), but this pass starts it at 0
exemption only FAIL single-slot pass on slot 0: slot 0 holds 4 position(s), but this pass starts it at 7
exemption + reordering ok: 3 sequences x 4 rounds, every row bit-identical to its own single-sequence run
The middle line is the one that matters for the fix's shape: the test-order defect the issue names is real and only becomes visible once the engine stops refusing the first arm — which is why the two changes belong in one commit.
The exemption is pos[m] != 0 and nothing else: a row at position 3 of a slot holding 7 is still refused, which is the case the guard exists for.
Activity
npu/forward: position 0 on a re-used slot starts a new sequence, as t…
bong-water-water-bong commentedon Nov 20, 2026
Claimed → #2982 (
cl-game/2978-step-users-pos0), and both halves reproduced locally, host-GEMM, no device and no ticket — a leftover NPU-enabled build tree in this worktree made that possible, which is worth noting because I had written off NPU verification on this box earlier today.Three states, one command (
ONEBIT_TEST_Q4NX=~/models/npu/Qwen3-0.6B):The middle line is the one that matters for the fix's shape: the test-order defect the issue names is real and only becomes visible once the engine stops refusing the first arm — which is why the two changes belong in one commit.
The exemption is
pos[m] != 0and nothing else: a row at position 3 of a slot holding 7 is still refused, which is the case the guard exists for.duplicate_fixes_check: an open PR re-doing a MERGED fix is a finding
npu: slot re-use gets the tests it lacked, and batched users refuse s…
duplicate_fixes_check: an open PR re-doing a MERGED fix is a finding (#…
npu/forward: each slot keeps its own short-convolution windows, so LF…