Skip to content
3977b6127d184421f41ecc7eb5a385c222d9a452

3977b6127d184421f41ecc7eb5a385c222d9a452

github.com • December 3, 2026

An IREE backend for the RK3588 NPU, built on the mainline accel/rocket kernel driver -- no RKNN SDK, no vendor runtime, no closed blobs anywhere in the path. An ONNX or MLIR model is compiled ahead of time into a .vmfb and executed by iree-run-module with the NPU registered as an IREE HAL device, so a model's convolutions and matmuls run on the accelerator while everything else runs on IREE's own CPU backend in the same process.

Apache-2.0 with the LLVM exception, like IREE itself.

Where the project stands

Ten ONNX models compile, offload and run correctly on an RK3588, each measured against a CPU baseline built by the same compiler pipeline with offload disabled. Medians on four Cortex-A76 cores, NPU at 1 GHz (the kernel-patches/7.3/ DVFS patch set), measured on the v0.1.0-rc5 release candidate's own packages -- 0.1.0 changes nothing these numbers depend on ( the release survey , with the eight-core column, the method and the accuracy runs):

All twenty arms agreed with an ONNX Runtime oracle on the predicted class, with no NPU timeouts.

int8 , quantized by the compiler itself from a float32 export ( compile --data-type int8 --calibration-file ), scored on real data against the same model's f32 ONNX Runtime run:

Beyond the models above: the onnx-community survey

The tables above cover models this project chose. To see how the toolchain does on models it didn't choose, a survey in December 2026 started from the 1,000 most-downloaded repos in Hugging Face's onnx-community organization. It took the top repo for each of their 166 architectures ( config.json 's model_type ), plus the newest repo for the 25 architectures that have ten or more. That came to 194 repos, 185 of which publish fp32 or fp16 graphs. It included every graph in those repos: encoders, decoders, merged decoders, vision towers and embedding graphs, in both fp32 and fp16 where a repo has both. That made 583 graphs . Only the graphs were downloaded: any tensor over 64 KiB was replaced by zeros, while small constants such as Reshape targets and Gather indices were kept, so each graph imports the way the real model would. Each graph went through rocket-import-onnx and then IREE's first lowering ( iree-compile --compile-to=input ).

The survey checks whether a graph lowers, nothing more. It doesn't check numerics or NPU placement, and nothing in it ran on a board. Its main finding was that most of the failures were in the import, not in a missing lowering:

Intermediates without a static type. 69 of the 103 graphs that torch-mlir refused failed on a value_info with no shape, or none at all, which the importer reads as a scalar or !torch.none .

Old opsets. 49 graphs in 25 repos are below the opset at which torch-mlir registers a lowering for one of their ops ( Erf , Softmax , Unsqueeze at opset 11, for example), even though the op itself hasn't changed.

ONNX Runtime's attention ops. GroupQueryAttention (36 repos) mostly uses forms torch-mlir doesn't lower: a sliding window, or the 11-input form. MultiHeadAttention (23 repos) has no lowering at all.

Interior dims no --dim can name. ONNX Runtime's exports name dims like unk__N and total_token_count , and the import refused to pin them. That was 43 graphs in 24 repos.

rocket-import-onnx now handles each of these itself ( #261 ): it completes shapes, upgrades the opset, rewrites both attention ops into plain ONNX ops, and derives the interior dims. Each step leaves the reference imports byte-identical. Here is what each step did to the survey's results:

Gemma 4 E2B's decoder, which prompted the survey, now imports, compiles and agrees with ONNX Runtime on the board, with the NPU running its matmuls. Its weights pack into one NPU buffer larger than 2 GiB, which needs kernel patch 0008 ( kernel-patches/7.3/ ). What still blocks the remaining graphs is mostly not in the import: CausalConvWithState and mixture-of-experts ops, If control flow in merged decoders, a torch-mlir bug in RotaryEmbedding , iree-compile crashing on Mamba-style hybrid models, and fp16 Pow , GridSample and STFT failing on a few models.

The compiler and the board runtime both come as prebuilt packages, so nothing below builds IREE. The full version, with the ONNX Runtime oracle and the baseline arm, is in agent-docs/onnx-to-numbers.md .

First, the board. Every result above was measured on the mainline rocket module plus out-of-tree patches : NPU devfreq (Igor Paunovic's DVFS series, with a devicetree overlay), PPU completion, and reset-before-IOMMU-detach. On a stock module, pooling jobs are killed by the watchdog at ~500 ms, timings roughly double, and a job timeout can corrupt the submitting process. The approved set is in kernel-patches/7.3/ with instructions; agent-docs/board-setup.md says what each does, what breaks without it, and how to check what your board has.

First, the board. Every result above was measured on the mainline rocket module plus out-of-tree patches : NPU devfreq (Igor Paunovic's DVFS series, with a devicetree overlay), PPU completion, and reset-before-IOMMU-detach. On a stock module, pooling jobs are killed by the watchdog at ~500 ms, timings roughly double, and a job timeout can corrupt the submitting process. The approved set is in kernel-patches/7.3/ with instructions; agent-docs/board-setup.md says what each does, what breaks without it, and how to check what your board has.

The packages. Each release publishes these:

Install the compiler and the runtime from the same release: a .vmfb is only guaranteed to run on the runtime built alongside the compiler that made it. The release notes list the glibc each package needs.

Releases don't include a command-line runner yet, so step 5 runs the model with rocket-runtime 's run example, built on the board against the installed runtime ( rocket-runtime/rust has its options). Check out the release tag that matches the runtime you installed: the crates' build script refuses any other runtime.

int8. The compiler quantizes a float model itself, from ranges it calibrates with onnxruntime: import the f32 model with rocket-import-onnx --for-int8 , then rocket-compiler compile --data-type int8 --calibration-file calibrates and compiles in one run ( rocket-quantize-prepare --calibration-out turns images into .npy ). The recipe is step 9 of the walkthrough , and the ImageNet cost of each option is in the accuracy gate . A model onnxruntime already quantized imports and compiles like a float one.

audit is the command worth running first on any model of your own: it prints one line per convolution and matmul -- shape, precision, where it went, and the decisive reason -- then reconciles that against the dispatches the compiled module actually contains. A refusal names its class, so shape and semantics are compiler work, validation means nobody has measured that configuration yet, and hardware never closes.

Every option of the four commands rocket-compiler installs is in docs/ : an explanation of each and its full --help .

To run models from your own program instead of a command-line runner, build against libiree-rocket-runtime-dev from C or C++ ( rocket-runtime has the API and a minimal example), or depend on the rocket-runtime crate from Rust ( rocket-runtime/rust ).

The board needs a patched kernel module. The eight patches, the devicetree overlay and the udev rule are in kernel-patches/7.3/ , with what each fixes and how to apply it. None is upstream yet, so this remains the biggest obstacle to reproducing anything here.

There is no code generator for this target. The NPU runs only the dispatches the transform spec creates, so an operation reaches it only if a matcher claims it; unclaimed work stays on the CPU and still runs correctly.

An offloaded convolution runs its inputs at f16 (the ABI is f16-in/f32-accumulate). Where an f32 stem feeds int8 quantization, as in MobileNetV2, that is ~0.35-0.42 max|err| on the final logits, with the predicted class stable except on near-ties.

No known-wrong case is open. A float16-converted graph whose LayerNorm is left decomposed in f16 overflows as written; tools/import_onnx.py runs those statistics in f32, as ONNX Runtime does (ISSUES.md C14, closed). VGG int8 aborting under a repeated benchmark loop (ISSUES.md C11) was re-run on 2026-11-29 and no longer reproduces.

glibc 2.39 or newer on both sides. The compiler (wheel and tarball, x86_64) and the runtime (arm64) are built on Ubuntu 24.04 and need its glibc: an Ubuntu 24.04 host and a Debian 13 board (2.41) work, older distributions do not. CI fails any artifact that needs more.

LIMITS.md records measurements, not capability. A shape outside it is untested rather than unsupported; the register fields are almost always wider than the constants.

Releases are the durable reference. Nightly artifacts expire after 14 days, so link a release rather than a nightly run.

How this fits upstream

Nothing here is a fork. The compiler side is an out-of-tree IREE target plugin loaded through IREE_CMAKE_PLUGIN_PATHS , and the runtime side is an external HAL driver registered through IREE's own iree_register_external_hal_driver() . IREE itself is a pinned commit of iree-org/iree as a submodule, with no patches applied by the build.

The kernel side is mainline accel/rocket plus eight patches that are not upstream, carried in kernel-patches/7.3/ and rebased onto Armbian 7.3.6: Igor Paunovic's NPU DVFS series (v2, posted to linux-rockchip), this project's PPU change and large-buffer fix, and Greg Tomko's reset fix from the external gregordinary/patches series. Getting them upstream is the useful step for anyone working on that driver. NPU devfreq : the SoC boots the NPU pinned at 200 MHz with no devfreq; the DVFS series adds an OPP table, a governor and a cooling device. Unconditional PPU completion : upstream arms only the DPU interrupts, so a standalone PPU-flying pooling job never reaches the completion path and is retired by the watchdog instead. Reset before IOMMU detach on a job timeout, so in-flight DMA cannot land in pages userspace has already freed.

What would help most from the hardware side is evidence for the configurations the admission policy currently refuses as unmeasured rather than impossible : register documentation or vendor captures for the shape classes listed in LIMITS.md , since every bound there is the extent of an actual measurement and the register encodings are wider.

Each component's detailed role is in agent-docs/developer-tools.md .

Continuous integration

The hardware tests are #[ignore] d in CI -- nothing in GitHub Actions has an NPU -- so correctness on the device is gated by three end-to-end regression suites (convolution, matmul, pooling) run by hand against a real board, each comparing against independently compiled CPU results, most cases exactly rather than within a tolerance. Job-by-job detail is in agent-docs/ci.md .

docs/ is the user documentation: the workflow, and a page per command-line tool with its full --help . Everything below is written for contributors.

LIMITS.md is what the stack is measured to do and which layer enforces each bound. ISSUES.md is every open defect, ranked, with the measurements behind it; closed ones are indexed there and kept in agent-docs/issues-resolved.md . ROADMAP.md is which operations the hardware could reach and in what order; COMPILER_ROADMAP.md is the compiler-side plan, with DYNAMIC_SHAPES.md and SOFTMAX.md as single-topic notes.

agent-docs/ holds the detailed working documents -- board setup , the ONNX-to-board walkthrough , developer tools , CI , the IREE 3.14 bump record behind the numbers above, the Mali/panvk Vulkan spike , bring-your-own quantization, measured , what to expect from ONNX models and quantization , the ImageNet accuracy gate , open questions and dated survey results. They are written for contributors rather than for a first read.

Clone with submodules ( git submodule update --init --recursive ), then cargo test --workspace for the Rust side, which needs no IREE build. The three CMake configurations -- the compiler, the host runtime and the aarch64 runtime -- are in agent-docs/developer-tools.md .

The full story

This article is one source in a clustered incident — the cluster page carries the summary, timeline and every other outlet covering it.