Repository navigation
Build against a prebuilt binary drop when the private parts are not available - #469
Conversation
The engine now reaches the private NPU runtime only through npu/npu_rt_api.h: the calls its NPU code (and the private route add-ons) make, each class an opaque handle (device, bo, ext::bo, elf, hw_context, ext::kernel, run, runlist), plus ert_cmd_state and the two sync directions. npu/rt.h includes it and aliases xrt = npu_rt_api; the private npu_rt.h is no longer on the engine's include path. CMake: ONEBIT_NPU=ON takes exactly one runtime: - ONEBIT_NPU_RT_LIB: a prebuilt static library implementing the header (libnpu_rt_api.a, built in the private repository); no private source or header needed. - ONEBIT_NPU_RT_DIR: the private sources (npu_rt.h, npu_rt.cpp and now npu_rt_api.cpp), with the directory on onebit_npu_rt's own include path only. The runtime pin moves to the private commit that adds npu_rt_api.cpp (npu_rt.cpp and npu_rt.h are unchanged from the old pin). npu_runtime_option covers the new refusals; npu_rt_shim now links every call of the header. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A source build that is not on the release machine has no private HIP kernels and no private NPU runtime sources, so it cannot compile those parts and stops at scripts/fetch-private.sh. This adds a way to use them already compiled, under the 1bit Binary License the packages already carry. scripts/make-binary-drop.sh <engine checkout> <out dir> packs one engine pin as a tarball plus SHA256SUMS: hrx/llama/bin (the release package's llama-server, llama-bench and the libraries beside them, libggml-hrx.so with the private kernels compiled in), npu/libnpu_rt_api.a behind the engine's public npu/npu_rt_api.h, npu/include, both binary licenses and a MANIFEST with every pin, the build host, the compilers and the sha256 of every file. It takes the HRX tree from a release build or an already packed release, and the NPU library prebuilt or built from the pinned private sources, then runs the weekly package's checks: XRT-free, the kernels really are compiled in, no source files, nothing named like the private sources, both licenses present. It publishes nothing. cmake/binary_drop.cmake takes ONEBIT_BINARY_DROP as a directory or a URL. A URL is downloaded with the sha256 config/binary-drop.config pins for that engine commit, and a body that does not match is refused. A directory is verified against its MANIFEST, every file's sha256 and the engine commit it was built from, and a mismatch stops the configure. When a drop is used, cmake/hrx.cmake links its llama-server instead of building llama.cpp (so neither TheRock nor the llama.cpp and hrx-system submodules are needed) and the NPU block takes ONEBIT_NPU_RT_LIB from the drop. Without ONEBIT_BINARY_DROP nothing changes. docs/releases.md documents the layout, how to make one and how to build against one. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
CMake's regex engine did not honour {64} in the MANIFEST and pin patterns, so the
verification loop matched nothing and every drop was refused as empty. Match on
[0-9a-f]+ and check the length explicitly instead.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
On a machine without TheRock the drop branch found no libhsa-runtime64.so.1 and list(GET) on the empty result stopped the configure. Guard it; the build proceeds with an empty ONEBIT_HRX_LIBHSA and says so. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…he end zstd refuses to overwrite, so a second run in the same output directory did all the work and then stopped. Remove this script's own previous output first. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
PR Reviewer Guide 🔍(Review updated until commit feb5e1a)Here are some key observations to aid the review process:
|
# Conflicts: # docs/npu.md # docs/releases.md
|
Preparing review... |
|
Persistent review updated to latest commit feb5e1a |
Outside the org, a source build stops at scripts/fetch-private.sh because the HIP kernels and the NPU runtime are closed. This adds the other route: a per-pin binary drop under the 1bit Binary License.
Tested on ryzen (CPU only): drop made from a rehearsal build; a fresh clone with no private access (no token, no submodules) configures and builds against the local drop, ctest 35/35; bad sha, wrong engine commit and tampered file are refused; the packer refuses source in the build dir.
Review notes:
🤖 Generated with Claude Code