Skip to content

weekly: ship the sealed NPU kernels by default; launcher requires sealed kernels - #508

Closed
bong-water-water-bong wants to merge 1 commit into
mainfrom
npu/weekly-npu-on
Closed

bong-water-water-bong wants to merge 1 commit into
mainfrom
npu/weekly-npu-on

Conversation

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator

The release path that consumes the sealed NPU kernel sets was written but never opened as a PR. This is that PR — no code changes made by me; the branch is taken as-is.

What it turns on

  • scripts/weekly.sh: WEEKLY_NPU_KERNELS now defaults to 1, so the weekly build calls the private checkout's release-kernels.sh into $BUILD/npu/kernels, seals the sets and passes -DONEBIT_NPU_PRIVATE / -DONEBIT_NPU_RELEASE=ON — i.e. the shipped binary loads sealed kernels only.
  • scripts/lemond-onebit.sh: the launcher now always exports ONEBIT_KCRYPT_REQUIRE_SEALED=1, so a packaged Lemonade backend refuses plain kernel sets instead of accepting them.
  • config/npu-kernels.config, docs/releases.md: pin/wording follow-up.

Why it matters

Without this, merged main still has WEEKLY_NPU_KERNELS:-0, so the weekly artifact carries no NPU kernels at all and the launcher does not require sealing — the closed-source delivery (#503) exists but nothing in the release path uses it.

Interaction with what already landed

#505 (merged, f90d041d) already makes the packaging side correct — the allowlist staging, pack_is_dynelf and the package_checks leak scan — so this branch no longer has to carry any of that; it only flips the release path on and hardens the launcher. npu-kernels #15/#16 (merged, 8d93d89d) make the producer emit clean sealed sets.

Verified on strixhalo with the merged packaging code, WEEKLY_NPU_KERNELS=1 and the merged producer: three clean sealed sets (11 files each = layout.json + 10 layer1.elf, 10/10 sealed, zero layer1.work/.mlir/.o), and a package whose package_checks returns rc=0 on every line, including NPU kernels: 33 files under npu/kernels, all sealed, no private source, host-only ELFs, and no symbol table or build-machine paths in the packed 1bit.

…res sealed kernels

- scripts/weekly.sh: WEEKLY_NPU_KERNELS defaults to 1 (the npu gate phase passed on Strix
  Halo: oracle/greedy64/prefill/reproducible PASS, 90.33 tok/s against a 60 floor, release
  build, embedded key). WEEKLY_NPU_KERNELS=0 builds a package without them.
- scripts/lemond-onebit.sh: exports ONEBIT_KCRYPT_REQUIRE_SEALED=1 unconditionally, no
  opt-out; the release 1bit refuses plain kernel sets on its own as well.
- package_checks: with the kernels on, the engine tarball must carry the three sets
  (Qwen3-0.6B, 1.7B, 4B); lemonade_package_checks: lemond-onebit must export the variable.
  Unit-checked on synthetic packages (3 sets ok / 1 set FAIL; export ok / missing FAIL).
- config/npu-kernels.config: npu-kernels npu/kernel-cache-key (#15, kernel cache keyed by
  kernel inputs); moves to #15's merge commit once it lands.
- docs/releases.md: the release carries the kernels.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
@bong-water-water-bong

Copy link
Copy Markdown
Collaborator Author

Superseded by #509: this branch predates #505 and conflicts on scripts/weekly.sh where #505 added the exact-allowlist leak scan. #509 is the same commit cherry-picked onto current main with both changes kept (the presence check and the allowlist scan). Closing rather than force-pushing your branch.

@bong-water-water-bong
bong-water-water-bong deleted the npu/weekly-npu-on branch October 23, 2026 11:04
bong-water-water-bong added a commit that referenced this pull request Nov 24, 2026
…s the requested value's rows, and the mixed-layout row reads its own import (llama.cpp#508, #509; engine#3380, #3389) (#3487)

Two device regressions found by the first device-tier run at the pin 6164e5ba (the self-hosted gate has been offline since
the 1bit OS reinstall, so this run was made by hand): add-on hrx-ops-test was 407 pass / 3 fail / 1 known-fail.

llama.cpp#508 (engine#3380): find_alternate_value's Q8_1 comparator required BOTH values' ne[0] to be 128-aligned. The
split-FA output publishes its alternate for [64,32,1] and the consumer reads reshape_2d(..., 2048, tokens) -- a pure
ordered range over the same bytes, but the source's ne[0]=64 -- so the fallback refused it and the q8 publish had no
alternate (q8_alternate == nullptr on ...query1.kv512.masked.head96.value64; the 4-query row failed the plan-size assert
first). At head size 128 the source ne[0]=128 and the same lookup passed, which is why only head96/value64 broke. The
row width that matters is the requested value's, which is 128-aligned. A plain revert of #503 fixes it but reopens
engine#3383, so this is a targeted comparator change; the two rows also become host cases (they never open a device and
reproduce cpp:5440/5420 on a host).

llama.cpp#509 (engine#3389): mixed_weight_layout_program.q4_k/q6_k compared a ValueId from imported_mixed.graph against
bindings of the decode program's SEPARATE import. Ids do not align across imports; the collision it matched was the
2048-float activation (binding length 8192 vs the weight's 215040 bytes). No product path broke and no expectation is
re-baselined -- the row now reads the decode program's own weight value.

Device evidence (strixhalo gfx1151, root, one box-hold both ticket, runtime libs from the pin's package):
  before: 23-Nov staged build PASS/PASS on the two FA rows; pin 6164e5ba FAIL/FAIL (and a fresh rebuild at the pin
          reproduced it, so the staging was not the cause)
  #508 alone: both FA rows PASS; full add-on suite 409 passed / 1 failed / 1 known-fail (the 1 being #3389's row)
  #509 alone: both mixed rows PASS on add-on AND no-add-on; full add-on 408 passed / 2 failed / 1 known-fail (the 2 FA)
  host control: 0/2 at 6164e5ba, 17/17 with #508; revert of #503 alone -> rows PASS but #503's host row fails

registry/architectures.json is regenerated by scripts/registry-regen.sh (llama.cpp source sha).

A combined #508+#509 full device run was not made; the two per-PR runs are above. #3483's compile-count/TTFT sweep
(its item 3) remains unmeasured.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant