Repository navigation
Description
Three of the four real OGA NPU packs on this box still refuse to import, all at the same place: the per-layer
attention payload between the layer block's first .fconst header and the post-attention header. The 0.5B pack
divides that payload into whole tiles exactly; the other three do not, and for two of them the whole-tile row count
does not even equal q+k+v+o. This is brief item 4 of the OGA-pack lane ("record which pack features the loader does
not yet understand as issues, not as silence"), filed now that the importer converts the 0.5B pack whole (#844).
Measured, on the shipped packs
1bit npu-pack import <pack> today exits 3 and writes nothing. Tile geometry is
tile(k) = (2*(k/128) + 2) * subv(64) with subv(rows) = 64*(rows/2) + 64 + rows = 2,176 at 64 rows, so
tile = 2,176 * (2*k/128 + 2):
| pack | hidden k | tile B | attention payload B | whole tiles | stray bytes |
|---|---|---|---|---|---|
| Qwen2.5-0.5B 4K | 896 | 34,816 | 1,114,112 | 32 exactly | 0 |
| Llama-3.2-1B 4K | 2,048 | 73,984 | 5,921,024 | 80 | 2,304 |
| Qwen3-1.7B 4K | 2,048 | 73,984 | 4,737,280 | 64 | 2,304 |
| Qwen3-4B 4K | 2,560 | 91,392 | 8,776,960 | 96 | 3,328 |
Predicted tile sizes match the importer's arithmetic on all four (73,984 for k=2,048, 91,392 for k=2,560), so the
tile formula itself is not in question — the payload decomposition is.
What the row counts say, and where it stops adding up
64 rows per tile, and q+k+v+o rows from each pack's own config.json dims:
| pack | q | k | v | o | q+k+v+o |
rows in whole tiles | agree? |
|---|---|---|---|---|---|---|---|
| Qwen2.5-0.5B | 896 | 128 | 128 | 896 | 2,048 | 2,048 | yes |
| Llama-3.2-1B | 2,048 | 512 | 512 | 2,048 | 5,120 | 5,120 | yes (+2,304 B stray) |
| Qwen3-1.7B | 2,048 | 1,024 | 1,024 | 2,048 | 6,144 | 4,096 | no |
| Qwen3-4B | 4,096 | 1,024 | 1,024 | 2,560 | 8,704 | 6,144 | no |
So Llama's whole-tile count is right and only the trailing 2,304 B is unexplained, which is the cleanest lead: if
that stray run is a third sub-stream at the section's end (it is present in exactly the same size on two packs with
the same k), Llama would decode with a one-line change. Qwen3's row counts fit q+k+v (4,096 and 6,144) rather than
q+k+v+o, which suggests either a different tile row count for those families or that o_proj is not in this section
— both are guesses at this point and neither is being coded.
The stray bytes do not fit a simple per-k or per-group law: 2,304/2,048 and 3,328/2,560 are not proportional, and as
a + b*k the two points give a negative a. Both are multiples of 128 (18 and 26 groups of 128 B), which is
suggestive and nothing more.
Not doing
No guessed layout. This lane has already paid for guessing on this exact file format: five attacks on the 0.5B tile
order (guessed layouts, ground-truth scale arrays, exact-code block matching) all came back at noise before the vendor's
own preformat routine gave the answer as a transpose. A partial layout that decodes "plausibly" is worse than a refusal,
which is why the importer refuses and names the tensor instead.
What would close it
- The pack is the oracle: Llama-3.2-1B is a different family with a public upstream checkpoint
(meta-llama/Llama-3.2-1B), so the same tie-break the 0.5B used applies — the pack's fp16embed_tokensis already
read and self-checks atcorr 0.999999, and a recovered ground truth makes a candidate decomposition falsifiable
instead of plausible. - The vendor writer (
libdyn_dispatch_core.so, restored under~/ryzenai-1.8/) calls
matmulnbits_preformatand the tile writer directly from Python — that is how the 0.5B tile order was closed
(transpose[N,K] -> [K,N],out = code - 8), and it needs no device. - Failing both, the trailing run can be measured: locate the section's last
q/k/v/orow group and read what the
stray 2,304 B actually is on Llama before changing the tile arithmetic.
Pack features understood today, for the record: 4-bit MatMulNBits decode (verified against the pack's own tied
embedding), the attention tiles and their bias subvolumes, the MLP gate|up fused unit and down_proj groups, all 48
layer-norm anchors, and the final norm in the tail envelope (#844). The attention payload for hidden != 896 is the
remaining blocker for a second family end-to-end.
Activity
bong-water-water-bong commentedon Nov 4, 2026
Root cause found and fixed (measured, not guessed): #986 now carries both facts.
The "attention payload does not decompose into whole tiles" symptom had two causes in the loader, not in the packs:
1,856instead of64 + 2*hidden→ every pack except the 0.5B was read2*(hidden-896)bytes early. That is where the stray runs in this issue's table came from, and it is why2,304and3,328fitted no law:2,304 = 2*(2048-896)and3,328 = 2*(2560-896). The stray run was the block'sinput_layernormweight.[k,q,v tiles @ K=hidden] [header + per-head k_norm] [header + per-head q_norm + o_proj tiles @ K=q_proj's width].So this issue's "Qwen3's row counts fit
q+k+v— a hypothesis, not a finding" was right, and it is now a finding with two independent confirmations:cache/*_meta.jsonop_listfor layer 0 runsk_proj, q_proj, v_proj, attn/k_norm/MLADFRMSNORM, attn/q_norm/MLADFRMSNORM, FLATMHA, o_proj— matching the file's section order — and declareso_proj N=2560 K=4096on the 4B, i.e. K is q_proj's output width, not hidden.320 Bbetween the norms is identical in both althoughhiddendiffers by 512 (it is64 + 2*head_dim, a per-head gain):Which 256-byte run is q and which is k was settled against the public checkpoints, by range-fetching only those two tensors:
Qwen/Qwen3-1.7BandQwen/Qwen3-4Bgive 0 of 128 bf16 values differing atk_norm → header 1+64andq_norm → header 2+64, and 127-128 of 128 differing on the swap. The container the importer writes is bit-identical to the same tensors, so the write path is verified end to end.Result with #986 + #844 in the tree: all four real packs on this box convert whole — 0.5B 291 tensors, Llama-3.2-1B 147, Qwen3-1.7B 311 (210,016 tiles, 2,688/2,688 byte-exact), Qwen3-4B 399 (491,000 tiles, 4,896/4,896 byte-exact). No device time was used for any of it.
What this issue does not close — the two things that remain, named rather than left as silence:
npu/pack.cppfill_i6) and the forward (sem_.qk_norm) already carry and apply per-head q/k norms, but no Qwen3 pack has produced a token on our kernels. That is this lane's step-5 work and it is parked behind theamdxdnaabo->dyingrace fix, not behind anything in the loader._hybridpack (model.binflavour) still refuses with 240 tensors: it has nodd_metastate_*.fconstand nocache/, so there is nothing to read the layer blocks from. It is a different container flavour, not an attention-layout problem.