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
tools: moe_expert_chunks verify refuses the very chunks chunks --pad-n writes, with a byte-count that reads like corruption #1135
tools/moe_expert_chunks.py chunks --pad-n N writes each expert's chunk with N_padded columns; verify, the
only host check on that chunk's int4 quantisation error, opens the chunk at the container's own N and dies
before comparing anything:
Both the chunk and the file are exactly right: 2048x1024 int8 codes + 2048/128x1024 fp16 d = 2,129,920 B. The
message is read_chunk's corruption complaint, so the first reading of it is a damaged file, not a wrong width.
Root cause
verify takes K, N from model.q4nx's __metadata__.moe and has no notion of the padding chunks() applies,
while chunks() has per-projection padding (gate/up 768 -> 1024, down's 2048 stays 2048). The manifest it writes
beside the chunks already records N_padded per projection; verify never reads it.
Why it matters rather than being cosmetic
The pad is not optional decoration: the arena's NW=32 geometry needs N % 1024 == 0 (npu_expert_chunks.geometry
reports ok_at_nw32: false for 768), and docs/npu.md sizes this model's stream with--pad-n 1024
(1,930,346,496 B/token against 1,703,854,080 unpadded). So the padded chunk is the one a dispatch would eat, and
until now it was the one shape verify refused to check — the padded arm could not be quoted at all.
Fix, and the known-answer check on it
verify gains --pad-n, and reads N_padded per projection from <out>/manifest.json when there is one; the
comparison is then the container's own N columns (padding columns are zero). Measured on the same container, origin/main6211c2fe:
arm
before
after
padded chunks + manifest (the reproducer)
2129920 B, want 1597440 B, rc 1
`ok gate 2048 x 768: rel rms 0.1309, cos 0.991547, max
same, up / down
—
0.1288 / cos 0.991808 / 0.0131, 0.1399 / cos 0.990344 / 0.0287
The padded numbers being identical to the unpadded ones is the known answer: zero padding cannot change the
container's own 768 columns, so a fix that changed them would be wrong.
Device-free, host-only: the container is read, no NPU ticket, no ELF.
Activity