Skip to content

XDNA: pin upstream amd/xdna-driver (and its XRT), build it privately, keep it current - #12

Merged
bong-water-water-bong merged 2 commits into
mainfrom
xdna-pin
Sep 23, 2026
Merged

bong-water-water-bong merged 2 commits into
mainfrom
xdna-pin

Conversation

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator

Pins the XDNA userspace stack the NPU lane runs on to upstream amd/xdna-driver, with a daily job to follow new upstream commits.

What

  • The pin: third_party/xdna-driver = upstream amd/xdna-driver 5d302c9 (2026-09-22). Its own xrt submodule pins XRT d8ececf.
  • What it covers: XRT and the XDNA shim plugin (libxrt_driver_xdna). The kernel driver amdxdna ships in the kernel (drivers/accel) and isn't built from the pin.
  • scripts/build-xdna.sh <prefix> builds both privately:
    • XRT (NPU package) and then the shim, staged with DESTDIR under <prefix>/root. XRT hard-codes /etc/OpenCL/vendors, so nothing touches system paths.
    • The shim goes next to XRT, which is where XRT loads plugins from.
    • XRT's OpenCL layer (xocl) is excluded: the NPU doesn't use it, and it doesn't compile against this distro's newer ocl_icd.h.
    • Using it: build the engine with -DONEBIT_XRT_ROOT=<prefix>/root/opt/xilinx/xrt.
  • Keeping current: .github/workflows/bump-xdna.yml runs daily and opens a PR when upstream main moves. It uses the same HRX_BUMP_TOKEN secret as bump-hrx.yml (HRX: follow AMD's live ggml-hrx, pinned to AMD's tested pair and kept current #11).
  • Docs: docs/npu.md gains a section, "The XDNA stack".

Verified on Strix Halo

The box had been running XRT 2.21.75 and a hand-built shim (in /usr/local/xrt-runlist) from an xdna-driver checkout 73 commits behind upstream. Against the pinned stack:

  • The right libraries load: strace shows libxrt_core.so.2 and libxrt_driver_xdna.so.2 coming from the pinned prefix.
  • Output is unchanged: tests/npu_lane_e2e.sh gives logits bit-identical to the reference lane, 24/24 steps.
  • Speed: 10.8 ms/token (92.6 tok/s), against 11.0 before, with a 327 ms warm load.

CI has no NPU, so run the build script and the lane test on Strix Halo before merging each bump PR.

🤖 Generated with Claude Code

bong-water-water-bong and others added 2 commits September 23, 2026 13:33
… keep it current

third_party/xdna-driver pins upstream amd/xdna-driver 5d302c9, whose xrt submodule pins XRT
d8ececf: the userspace the NPU lane runs on (XRT and the XDNA shim plugin libxrt_driver_xdna).
The kernel driver ships in the kernel (drivers/accel/amdxdna) and is not built from the pin.

- scripts/build-xdna.sh <prefix>: builds XRT (NPU package, without its OpenCL layer: it does not
  compile against newer distro ocl_icd.h headers and the NPU does not use it) and the shim,
  staged with DESTDIR under <prefix>/root (XRT hard-codes /etc/OpenCL/vendors), and puts the shim
  next to XRT, where XRT loads plugins from. Nothing is installed system-wide.
- .github/workflows/bump-xdna.yml: daily, opens a PR when upstream main moves.
- docs/npu.md, "The XDNA stack".

Strix Halo: the engine built with -DONEBIT_XRT_ROOT=<prefix>/root/opt/xilinx/xrt loads
libxrt_core and libxrt_driver_xdna from the pinned prefix (strace); tests/npu_lane_e2e.sh gives
logits bit-identical to the reference lane, 24/24 steps, 10.8 ms/token, 327 ms warm load.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@bong-water-water-bong
bong-water-water-bong enabled auto-merge (squash) September 23, 2026 19:21
@bong-water-water-bong
bong-water-water-bong merged commit 1e1264e into main Sep 23, 2026
1 check passed
@bong-water-water-bong
bong-water-water-bong deleted the xdna-pin branch September 23, 2026 19:31
bong-water-water-bong pushed a commit that referenced this pull request Sep 26, 2026
…oints and three HRX fixes

Our llama.cpp #7 (HRX MoE router route-ids binding length), #9 (decode-split
flash-attention capacity bound), #11 (ZAYA sliding-window attention, ZAYA1-74B),
#12 (MoE router experts-per-wave launch geometry) and #14 (ZAYA legacy
checkpoints; --remote fetches chat_template.jinja).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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