Repository navigation
docs: the gemma3 NPU row names the packs checked on the host and each geometry's shapes (Refs #1786) - #2250
Conversation
… geometry's shapes (Refs #1786) Gemma3-1B-NPU2 and Gemma3-4B-Text-NPU2 answer the known-answer prompt on the host forward at main (cd3054f) with no code change, beside Gemma3-270M and Medgemma-4B. The row said one shape (QKV K2560 N4096) was missing; that is the 4B geometry only. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
ready for review at f2cdae4 |
PR Reviewer Guide 🔍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 at f2cdae4: READY
Docs only: two rows in docs/npu.md. It merges cleanly onto main. CI build at f2cdae4 is green: 100% tests passed, 0 tests failed out of 262. tests/census_watch_test.py, which reads these rows: all checks passed.
The shape lists are right, and they are the padded design shapes (K on the 256 grid, N on the 512 grid; Q4NX_K_GRID/Q4NX_N_GRID in q4nx_pack.c), which is how the kernel names are spelled:
- 4B, from
Medgemma-4B-NPU2's config (H 2560, intermediate 10240, 8 heads, 4 KV, head_dim 256): QKV K2560 N4096, O K2048 N2560, GU K2560 N20480, D K10240 N2560. All are on the grid, and they match the row. They also match what I found on #2210/#2190:QKV K2560 N4096is the one shape not built. - 1B, from
Gemma3-1B-NPU2's config (H 1152, intermediate 6912, 4 heads, 1 KV, head_dim 256): the raw shapes QKV K1152 N1536, O K1024 N1152, GU K1152 N13824, D K6912 N1152 pad to QKV K1280 N1536, O K1024 N1536, GU K1280 N13824, D K6912 N1536, exactly the row's.
The 270M row's prerequisite is on main. It answers via the 1,280-byte quarter tile, #2248, merged 04:01Z.
Not checkable here, and worded accordingly in the row:
- The size and config-key claim for
medgemma-1.5-4b-it,Gemma3-4BandTranslategemma-4B-Instruct: those packs are not on this box. OnlyMedgemma-4B(3,768,226,744 B, matching) andGemma3-1Bare. - The four host-forward
Parisanswers: not re-run.
What
docs/npu.md'sgemma3rows said the device lacks one kernel shape,QKV K2560 N4096. That holds only for the 4B geometry. This PR rewrites the two rows to name which gemma3 packs answer on the host forward today and the shapes each geometry needs. It is docs only, with no behaviour change. Refs #1786.Measured (2026-11-12, main at cd3054f, host GEMM, no device)
The known-answer prompt was run with each pack's own chat template, using greedy decode:
Gemma3-270M-NPU2Paris<end_of_turn>(the quarter tile, #2248)Gemma3-1B-NPU2Paris<end_of_turn>. A three-sentence sky prompt gets a correct Rayleigh-scattering answer.Gemma3-4B-Text-NPU2Paris<end_of_turn>Medgemma-4B-NPU2Paris<end_of_turn>(#2242/#2248)Gemma3-1B and Gemma3-4B-Text needed no code change.
medgemma-1.5-4b-it,Gemma3-4BandTranslategemma-4B-Instructcarry the sameconfig.jsontext keys and the samemodel.q4nxsize (3,768,226,744 B) as Medgemma-4B. They were not run.tests/census_watch_test.py(it reads these rows): all checks passed.🤖 Generated with Claude Code