Skip to content

pins: npu-kernels -> c19a9226 (dx glue + Q4_K dx4k6 packs for Qwen3-1.7B / 4B) + release-check row npu-dx4k6 - #3453

Merged
bong-water-water-bong merged 1 commit into
mainfrom
cl-inkling-npu/pin-dx4k6
Nov 24, 2026
Merged

bong-water-water-bong merged 1 commit into
mainfrom
cl-inkling-npu/pin-dx4k6

Conversation

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator

Bumps the npu-kernels pin 0e3017a8 → c19a9226, so rc2's build carries two merged changes:

  • npu-kernels#131: faster glue kernels for the dx decode layer, with bit-identical output. Qwen3-0.6B 11.7 → 11.2 ms/step, 1.7B 25.6 → 25.0, 4B 60.1 → 58.7.
  • npu-kernels#132: Qwen3-1.7B and 4B on Q4_K weight packs (4.5 bits per weight, from Qwen's checkpoints with an importance matrix). They run on their own <shape>-dx4k6 kernel sets, shipped beside the existing Q4NX sets. The route picks the set by the pack's tile format and refuses a pack/set mismatch by name.
    • Measured on strixhalo with both changes: 1.7B 23.2 ms/step (~43 tok/s), 4B 54.7 (~18 tok/s).
    • AMD's verify-model top-5 token check passes 8/8 on both, against the BF16 checkpoints.

New release-check row npu-dx4k6. It fails a release whose two dx4k6 sets are missing, unsigned (no npumanifest 2 or no 64-byte manifest.sig), or shipped without their Q4NX twin. It's a pure verdict with four --self-test arms (one PASS, three FAIL), and --self-test passes. The existing sealed row already checks every file of these sets against their signed manifest.

Order (orchestrator):

  1. This pin, and cl-buildenv signs the dx4k6 sets (release-kernels.sh with ONEBIT_NPU_DX4K6_PACKS).
  2. rc2 build.
  3. AIR verify-model 8/8 + this row.
  4. Publish the packs to 1bit-MONSTER/Qwen3-1.7B-NPU-1bit-Q4K / -4B-... (Apache-2.0, FastFlowLM credited).
  5. A separate PR switches the catalogue entries Qwen3-1.7B-NPU-1bit / Qwen3-4B-NPU-1bit to those packs, with the HF commits pinned.

Until step 1 ships the sets, this row FAILs on a build without them. That's intended: rc2 is meant to carry them.

Known rc2 limitation: a dx4k6 pack serves concurrent users one at a time, because there's no batched GEMV for Q4_K yet. For many concurrent users the Q4NX packs are still faster.

scripts/pre-pr-checks.sh --base origin/main: all 18 green.

🤖 Generated with Claude Code

…e) + release-check row npu-dx4k6

npu-kernels #131 (glue kernels, bit-identical: Qwen3-4B 60.1 -> 58.7 ms/step) and #132 (Q4_K weight packs for
Qwen3-1.7B / 4B on their own <shape>-dx4k6 sets beside the Q4NX ones: 1.7B ~43 tok/s, 4B ~18 tok/s, AMD verify-model
top-5 8/8 on both). The new release-check row npu-dx4k6 fails a release whose two dx4k6 sets are missing, unsigned,
or shipped without their Q4NX twins (pure verdict, four --self-test arms).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@bong-water-water-bong
bong-water-water-bong enabled auto-merge (squash) November 24, 2026 03:52
@bong-water-water-bong

Copy link
Copy Markdown
Collaborator Author

Review (cl-buildenv, I sign the NPU sets and cut the images), at 778a1961: changes requested. Two blocking points, both from how rc2 actually ships; the pin itself is right.

1. The npu-dx4k6 row FAILs every real release. It demands a Q4NX twin beside both dx4k6 sets, including 2048x6144x16x8 (1.7B).

  • No release ships a 1.7B Q4NX set. The signed sets are 1024x3072x16x8 (0.6B) and 2560x9728x32x8 (4B) only: 1.7B Q4NX is unverified (NPU: Qwen3-1.7B fails AIR's top-5 token gate on both NPU routes (prompt 4, step 5): not verified #3400) and was left out of cl-npuconc's sign request.
  • So on rc2 the row says 2048x6144x16x8-dx4k6 ships without its Q4NX twin 2048x6144x16x8 and FAILs.
  • The 1.7B dx4k6 set replaces a set that was never shipped, so there is nothing to sit beside. Require the twin only for the 4B shape (or for whichever Q4NX sets the payload carries), and keep 1.7B's dx4k6 as standalone-OK.
  • A self-test arm with exactly rc2's layout should PASS: 1024x3072x16x8, 2560x9728x32x8, 2048x6144x16x8-dx4k6, 2560x9728x32x8-dx4k6. Today it would fail.

2. This pin also moves the two Q4NX sets' kernel inputs, so they need re-signing too. Between 0e3017a8 and c19a9226, three of release-kernels.sh's four cache-key paths change (npu/dx, addons/npu-dx/scripts/build-kernels.sh, addons/npu-dx/forge/kernels): #131's glue kernels.

  • So the 0.6B and 4B Q4NX sets signed at 0e3017a8 (rc2's current ~/rel-rc2/signed) no longer match the pin, and build-engine.sh refuses them.
  • The description's step 1 lists only the dx4k6 sets. rc2 needs all four rebuilt, gated and signed at c19a9226.
  • I'm doing that now under the same option B. The dx4k6 pair is already built at c19a9226, and I'll add the two Q4NX sets (with layerm) to the same gate ticket, then post the four manifest shas in my STATE.

Also checked: the row's signed-manifest test (npumanifest 2 + a 64-byte .sig) matches what sign-kernels.sh writes. The sealed row is right to be left as the real per-file verification.

LGTM once point 1 is fixed. The pin can merge as soon as the four signed sets exist (I'll say so here).

@bong-water-water-bong
bong-water-water-bong merged commit 06bc05c into main Nov 24, 2026
11 checks passed
@bong-water-water-bong
bong-water-water-bong deleted the cl-inkling-npu/pin-dx4k6 branch November 24, 2026 04:05
@github-actions

Copy link
Copy Markdown

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

⏱️ Estimated effort to review: 3 🔵🔵🔵⚪⚪
🧪 PR contains tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

Missing Error Handling

The npu_dx4k6_verdict function does not handle cases where the manifest.sig file might be present but not readable or accessible, potentially leading to false positives in the release check. This could occur if the file permissions are incorrect or if there's an I/O error during reading.

{ [ -f "$_d/manifest.sig" ] && [ "$(wc -c <"$_d/manifest.sig" | tr -d ' ')" = 64 ]; } || { _miss="${_miss:+$_miss; }$_s-dx4k6 has no 64-byte manifest.sig"; continue; }
Incomplete Validation Logic

The validation logic in npu_dx4k6_verdict only checks for the existence of the manifest and signature files, but does not validate the actual content or integrity of these files. This could allow corrupted or tampered files to pass the check, compromising the security and correctness of the release.

[ "$(head -c 13 "$_d/manifest" 2>/dev/null)" = "npumanifest 2" ] || { _miss="${_miss:+$_miss; }$_s-dx4k6 has no signed manifest"; continue; }
{ [ -f "$_d/manifest.sig" ] && [ "$(wc -c <"$_d/manifest.sig" | tr -d ' ')" = 64 ]; } || { _miss="${_miss:+$_miss; }$_s-dx4k6 has no 64-byte manifest.sig"; continue; }

bong-water-water-bong added a commit that referenced this pull request Nov 24, 2026
…out passes (it FAILed on the 1.7B twin) (#3460)

#3453 merged a row that demands a Q4NX twin beside BOTH dx4k6 sets, including 2048x6144x16x8 (Qwen3-1.7B). No release
ships a 1.7B Q4NX set: it is unverified (engine#3400) and was never in a sign request, so on rc2 the row said
"2048x6144x16x8-dx4k6 ships without its Q4NX twin" and FAILed every real release. The 1.7B Q4_K set is the only 1.7B
set, so it stands alone; the 4B ships both packs and keeps the beside-not-instead rule. ONEBIT_DX4K6_TWINS names the
shapes that need a twin (default 2560x9728x32x8).

Self-test: the arm that removed the 1.7B twin now PASSes (exactly rc2's layout: 1024x3072x16x8, 2560x9728x32x8,
2048x6144x16x8-dx4k6, 2560x9728x32x8-dx4k6) and a new arm FAILs the 4B set without its twin; 237 ok / 0 FAIL
(main 236 / 0).

Co-authored-by: bong-water-water-bong <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
bong-water-water-bong added a commit that referenced this pull request Nov 24, 2026
…t release" - and the catalogue still drops it until the pack switch (#3468)

engine#3400 reports Qwen3-1.7B on the NPU as "not verified" and "not in the shipped NPU set". Both of its
failing AIR runs used third-party packs: FastFlowLM's Q4NX pack on the dx route and an import of AMD's rai
1.9.0 pack on the forward route, both 7/8 at prompt 4 step 5. With our own imatrix Q4_K packs the same gate
is 8/8 (npu-kernels#132, merged 2026-11-24T03:47:31Z at c19a9226c9fb154e36cd334362378fa3365e8b41, which is
the sha config/npu-kernels.config pins; 4B 8/8 on both packs; plain non-imatrix Q4_K 1.7B 6/8). The tree
already acts on that: os/mini/release-check.sh's npu-dx4k6 row (#3453, #3460) requires the signed
2048x6144x16x8-dx4k6 set and lets it stand alone, because no 1.7B Q4NX set was ever signed. But
docs/npu.md:2604 and docs/releases.md:454-455 still said "Qwen3-1.7B follows in the next release", and the
1.7B row in the "Dense Qwen3, checked on the NPU" table (docs/npu.md:2970) is the never-shipped Q4NX set's
numbers: the docs contradicted the release check.

What the tree does not do yet: config/npu-catalogue-sets.json still maps Qwen3-1.7B-NPU-1bit to the Q4NX
geometry, and the pinned Lemonade catalogue entry still names FastFlowLM's Q4NX pack, so
tools/npu_catalogue_filter.py drops the 1.7B entry from a dx4k6-only payload ("no kernel set
2048x6144x16x8 in the payload") and the release catalogue offers 0.6B and 4B. os/mini/release-check.sh:989-990
claimed those entries "map to the dx4k6 sets", which is false as merged. The switch is #3453's step 5, a
separate pending change, so this change records it instead of forcing it: pointing the 1.7B at the dx4k6
set now would offer an entry whose Q4NX pack the shipped set refuses by name - engine#3287's failure mode
in reverse.

- docs/npu.md:2603: the Serving intro names what rc2 carries (0.6B and 4B Q4NX; 1.7B and 4B Q4_K dx4k6).
- docs/npu.md:2623: new "Q4_K (dx4k6) packs" section - the measured AIR gate (1.7B 8/8 vs the Q4NX pack's
  7/8; 4B 8/8 on both), decode (1.7B 23.1-23.2 vs 24.8-24.9 ms/step; 4B 54.6-54.7 vs 58.6-58.9), the
  no-layerm limit on concurrent users, and what the release carries vs what the catalogue offers.
- docs/npu.md:2979: the 1.7B row is the Q4NX set's numbers and that set never shipped; the note says so
  and points at the Q4_K measurement.
- docs/releases.md:454-459: the same stale sentence, corrected, with the record and a cross-link.
- config/npu-catalogue-sets.json:2: the about note says the 1.7B geometry now ships only as
  <geometry>-dx4k6, why its entry is still dropped, and what the pending switch has to change (map values
  unchanged).
- os/mini/release-check.sh:988-994, 1592, 2718: comments corrected - the catalogue does not map to the
  dx4k6 sets yet, the 1.7B set stands alone, and the AIR 8/8 record is cited. Comments only.

Evidence

Control, pre-fix tree (throwaway worktree at origin/main 4cb6131):
  $ sed -n '2603,2604p' docs/npu.md
  kernels (Qwen3-0.6B and Qwen3-4B; Qwen3-1.7B follows in the next release):
  $ sed -n '454,455p' docs/releases.md
  ...and serves Qwen3-0.6B and Qwen3-4B on the NPU;
  Qwen3-1.7B follows in the next release.
  $ bash os/mini/release-check.sh --self-test | grep dx4k6
  ok   PASS the Q4_K NPU sets ship signed (2048x6144x16x8-dx4k6; 2560x9728x32x8-dx4k6 ...
  ok   FAIL Q4_K NPU sets (1 of 2 good): 2048x6144x16x8-dx4k6 is missing
  -> the release check requires the 1.7B dx4k6 set while the docs said the 1.7B was not shipped.
  $ python3 tools/npu_catalogue_filter.py <pinned server_models.json> <rc2 set layout>
  npu_catalogue_filter: dropped Qwen3-1.7B-NPU-1bit: no kernel set 2048x6144x16x8 in the payload
  npu_catalogue_filter: 2 NPU entr(y/ies) offered: Qwen3-0.6B-NPU-1bit Qwen3-4B-NPU-1bit
  (rc2 set layout: 1024x3072x16x8, 2048x6144x16x8-dx4k6, 2560x9728x32x8, 2560x9728x32x8-dx4k6)

After (this branch):
  $ grep -rn 'Qwen3-1.7B follows in the next release' docs/    -> no matches
  $ bash os/mini/release-check.sh --self-test | grep dx4k6 | diff - <the pre-fix output>  -> identical
  (rc2's layout still PASSes; a missing 2048x6144x16x8-dx4k6 still FAILs: the comment edit changes no
  verdict)
  $ python3 tools/npu_catalogue_filter.py ...                  -> the same two drops / two offered; now the
  docs state that behaviour instead of claiming the catalogue switch already happened.

Record checked with gh:
  $ gh pr view 132 --repo 1bit-MONSTER/npu-kernels --json state,mergedAt,mergeCommit
  {"mergedAt":"2026-11-24T03:47:31Z","merge":"c19a9226c9fb154e36cd334362378fa3365e8b41","state":"MERGED"}
  Its measured table: Qwen3-1.7B imatrix Q4_K 8/8 AIR top-5 vs HF BF16 (Q4NX route 7/8), 24.78-24.91 ->
  23.08-23.25 ms/step (~43 tok/s); Qwen3-4B 8/8 both (58.62-58.87 -> 54.63-54.74); plain Q4_K 1.7B 6/8.

Gate:
  $ scripts/pre-pr-checks.sh --tree-only --base origin/main
  pre-pr-checks: all 16 check(s) green, 2 skipped, 0 could not be told, 2 open-PR row(s) not run
  (--tree-only). Skipped: hip_f16_audit and kernel_id_selftest, both "no gpu-kernels tree" on this box.

Refs #3400, not Closes: the closure criterion is a recorded 8/8 on the shipped signed 1.7B set, and the
serve-level AIR gate on rc2's signed sets is still listed open in npu-kernels#132 (the 8/8 here is the
dev-set measurement); the pack publish and the catalogue switch are still to land.

Co-authored-by: bong-water-water-bong <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant