- Tested with
- PanCode (2026-10-02 development build), FastFlowLM 1.0.5, Lemonade Server 2026.39.1, strands-decider 0.1.0, Julia-1, llama.cpp b10825 tools, Ryzen AI NPU driver 32.0.20102.3930
- Tested on
- Environment
- AMD Ryzen AI Max+ PRO 395 (Radeon 8060S iGPU, XDNA2 NPU, 128 GB unified memory), Windows 11 Pro 26100 with WSL2 Ubuntu 24.04
Every Apple Silicon Mac, every Copilot+ PC and most phones sold today carry a second accelerator that a local chat model never touches. On a Ryzen AI Max+ 395 it is the XDNA2 NPU, idle while the Radeon 8060S serves a 26B chat model. On a Mac it is the Neural Engine beside the GPU, and on a phone it is the NPU beside the CPU. The chat model cannot use that processor well, because it is too large and it needs the GPU’s bandwidth. A coding agent has a second workload that fits it. Every turn makes dozens of closed decisions, a long turn hundreds, and each one is a single forward pass of a small model that returns a calibrated distribution. A decision model is small enough to live on the processor the chat model leaves idle.
On 2026-10-02 I tested that on the first machine where it was practical. The NPU answered 33 typed decisions for a coding agent, 32 of them with the same top answer as PyTorch, while Gemma-4-26B stayed resident on the iGPU. Strix Halo is the first proof because AMD put all three processors on one 128 GB memory pool, so placing a model on one of them moves no weights across a bus. The Neural Engine and phone NPUs are next. This entry is about why that matters for a harness like PanCode, what the port took, what a coding session on all three processors looked like, and how to place each tier of models on one machine.
Everything here was measured on 2026-10-02 with a development build of PanCode on the machine in the test record above.
November 8, 2026: This tutorial predates later PanCode changes and has not been retested on current builds. The NPU port and its measurements do not depend on PanCode, but the binding steps do. PanCode later removed decision recording, System One’s fixed decision sites, the per-site configuration map, and decision export. Today a decision engine is opted into through a single System One setting and verified with a live check. Follow the PanCode guide for current setup.
Why a coding agent wants three processors
A coding turn produces one visible answer and a few hundred invisible decisions, and I argued in part 5 of Why PanCode that a chat model is the wrong instrument for them. Since then the decision-model space has filled in fast. TypeSafe released Jev, the hosted System One model that returns a calibrated distribution over a closed answer shape instead of prose. Convai Innovations answered with Laya, an open-weights encoder with a typed decision head. Supersonic Labs shipped Julia-1, 144M parameters on mmBERT-small, which runs on a CPU. Fastino kept pushing GLiNER2. And the Strands team published the Strands Decider 2B, a Qwen3.5-2B-Base torso with a rank-16 LoRA and a one-million-parameter pointer head that scores every option from its own hidden state in one forward pass.
In the build I tested, PanCode bound these to fixed decision sites: the operator’s request, a proposed tool call, a tool result, a finished turn, a catalog ranking. The System One guide listed the tiers at the time. Jev is tier 3 and the redacted state leaves the machine. Laya, Julia-1, GLiNER2, and now the Strands decider are tier 2: a server you run, no API fee, your hardware.
That last clause is the catch on a laptop. The chat model owns the iGPU. The proactive memory tier, when you turn it on, runs a background model that records requirements, failed attempts, and diagnoses while the main agent works, and it competes for the same device. A decision engine that fires dozens of times per turn on a shared GPU is a decision engine that slows the thing it is supposed to guard. On Strix Halo there is a third processor sitting there with nothing to do, on the same memory, and the question was whether a published decision model could run on it faithfully.
Prerequisites
- A 2026-10-02 development build of PanCode, the build tested here. Current builds bind System One differently; see the dated note above.
- A Strix Halo machine on Windows 11. Mine is a Ryzen AI Max+ PRO 395 with 128 GB, Radeon 8060S (gfx1151), XDNA2 NPU, driver 32.0.20102.3930, in Performance power mode.
- Lemonade Server 2026.39.1, serving Gemma-4-26B on the iGPU through its Vulkan llama.cpp backend, with the FastFlowLM 1.0.5 NPU backend installed. Lemonade already serves Qwen3.5-4B on the NPU this way; that is the lead the whole port followed.
- FastFlowLM source for its headers and the Xilinx XRT headers, Visual Studio 2022 Build Tools, CMake, and MinHook. The engine kernels are closed and shipped as DLLs; the orchestration around them is MIT.
- In WSL2: a Python 3.12 environment with
transformers5.18,peft0.21,strands-decider0.1.0, llama.cpp for its converter, and AMD’s FLM Q4NX converter. - A PyTorch reference to compare against. I used the decider package itself on the CPU, and a parallel session measured the same model on the iGPU with ROCm 7.2.1.
Steps
- Rule out the official LLM flow first. AMD’s OnnxRuntime GenAI flow for the NPU covers Qwen2, Qwen2.5, and Qwen3 with standard attention. Qwen3.5 is 18 GatedDeltaNet layers and 6 attention layers, and nothing in that toolchain lowers GatedDeltaNet. A from-scratch ONNX export hits the same wall.
- Follow the kernels that exist. FastFlowLM 1.0.5 ships compiled XDNA2 kernels for exactly Qwen3.5-2B, including
GateDeltaNet_prefill.xclbin. Its weight file is a plain safetensors container, and AMD’s converter builds one from a GGUF. So: merge the LoRA into Qwen3.5-2B-Base with PEFTmerge_and_unload, export a bf16 GGUF with llama.cpp, quantize to pure Q4_K with Q8_0 embeddings (and Q8_0 for the two tinyssm_alphaandssm_betaprojections, which the prefill kernel wants in Q8 with a bf16 copy beside them), convert, and drop the folder next to the stock model with a copy of its kernel directory. - Drive the engine directly. A 190-line C++ harness links the shipped engine DLLs through import libraries generated with
dumpbinandlib, loads the model, and reads token ids on stdin. Tokenization stays in Python with the decider’s own tokenizer, so the harness never needs FastFlowLM’s tokenizer build. - Get the hidden states out. This was the hard part. The engine returns only last-position logits, its LM head quantizes activations to int8 and is baked for a fixed vocabulary, so every trick that edits the weights to smuggle hidden states through the logits fails. What works is reading what the engine already computes: it does the residual adds on the host, so after a prefill its heap holds a bf16
[tokens][2048]buffer with the pre-norm hidden state of every position. The harness hooks the C runtime’smalloc,calloc, andfreeto track large blocks, hooksxrt::bo::syncto capture the one row the engine hands its LM head, and finds the buffer whose last row equals that capture. One prefill then yields the<answer>row and every option-end row. The final RMSNorm and the pointer head run in numpy. - Compare before you trust. Per-position hidden states correlate 0.98 to 0.998 with the PyTorch reference at 73, 521, and 977 tokens, including positions across the engine’s internal 512-token chunk boundary. Then run the real questions.
The harness and the Python client are research code for one closed engine on one driver version, and I say so in the limitations. They are not a PanCode feature yet.
Expected result
Faithfulness over 33 questions (the model card’s example, the six states from my GPU benchmark, and eight recorded decisions from a PanCode session): 32 of 33 top choices agree with the PyTorch reference. The one miss is a reference coin-flip at 0.506 versus 0.494 that came out 0.441 versus 0.559. The maximum probability difference per question has a median of 0.037, a 90th percentile of 0.055, and a worst case of 0.096 on a seven-option choice. The model card’s example comes out as urgency 0.79 (reference 0.83) and billing 0.75 (reference 0.76). Twenty repetitions of every cell gave identical probabilities, so the path is deterministic.
Latency with two warm-ups and twenty repetitions, one prefill per question, compared with the same model on the Radeon 8060S under PyTorch with ROCm:
| State | NPU p50 | NPU p95 | NPU max | iGPU p50 |
|---|---|---|---|---|
| Short, 74 to 86 tokens | 539 to 553 ms | 564 to 607 ms | 575 to 619 ms | 128 to 138 ms |
| 1,000-token state, 1,062 to 1,074 tokens | 1,110 to 1,117 ms | 1,129 to 1,155 ms | 1,135 to 1,172 ms | 515 to 523 ms |
The harness holds 4.0 GB of working set, 1.37 GB of it the Q4_K weights, and loads in six seconds. During the loop the Windows counter for the harness process on the NPU adapter read 80 to 88 percent on its compute engine, and xrt-smi examine -r aie-partitions showed the harness holding all eight AIE columns. Lemonade’s own utilization field stayed at 0.0 the whole time because it only watches its own processes, which is a useful thing to know before you believe a dashboard.
So the picture on one laptop today is: Gemma-4-26B on the iGPU answering the operator, a 2B decision model on the NPU answering the harness, Julia-1 or the rules-only memory tier on the CPU, and all of it in one 128 GB pool with nothing copied across a bus. That is the deployment I wanted when I built the decision sites, and this is the first machine where it is not a diagram.
One coding session on all three
A benchmark loop is not a session, so I bound the whole stack in PanCode. Gemma-4-26B on the iGPU ran the main agent and its workers, and Gemma-4-E2B ran the proactive memory tier. The Strands decider on the NPU took the tool-call, tool-result, turn-end, steering, and draft sites, and Julia-1 on eight CPU threads took the turn and consult sites. In a 340-second terminal session Gemma fixed the bugs in a small Python project, then added a summarize() function with a test, and the suite passed. E2B ran six memory steps. Julia answered the turn site in 402 ms and once missed its 600 ms deadline by 3 ms. The NPU answered the turn-end site, six questions and so six prefills, in 3.6 and 5.0 s, under an 8 s deadline that nothing in the turn waits on.
The decisions were never the slow part. Gemma’s 9.3k-token system prompt took about 27 s to its first token cold, each warm step cost about 5 s, and llama-server’s own counters averaged 215 tokens per second of prefill. That is the bandwidth limit below, and it is the one a person at the keyboard feels.
The session also changed PanCode. Julia’s server answered in 100 to 150 ms while PanCode recorded 330 to 600 ms, because a turn’s first decision fires while the session is still starting, so each engine request now records its own round trip beside the site’s wall time. Julia’s 48-token option limit had been checked by byte length, which kept it off most sites. PanCode now counts options with Julia’s own tokenizer, and on the recorded requests Julia answers the same six-question turn-end check on the CPU in about a second. Which of the two decides better is a calibration question I have not measured yet.
Limitations
- Precision is Q4_K, because the Qwen3.5 layer kernels only accept Q4-packed projections. A Q8_0 torso loads and produces NaN. The 0.04 median drift is the price, against 0.004 between the CPU and GPU runs of the same model in PyTorch. For a decision gate with a confidence floor that is acceptable; for a calibration study it is not.
- The engine has a fixed cost of about 433 ms per prefill plus 0.4 ms per token. It pads to 512-token chunks and does per-layer host work, and two engine processes serialize on the NPU, so there is no parallelism to buy. The read of the hidden rows costs 7 ms and the head microseconds; the floor is inside the closed engine.
- The NPU is memory-bound like everything else on this package. A single-token decode streams the 1.3 GB of weights in 35 ms, about 37 GB/s effective, and prefill cannot escape that bandwidth either. This is a laptop-class LPDDR5X bus, not an HBM stack, and no amount of NPU cleverness changes it.
- The hidden-state capture reads a closed engine’s private memory through hooks. It is validated against PyTorch on this driver and this FastFlowLM release, and it will need revalidating on the next. The OpenFlowLM-Next fork with open kernels is the long-term route, and the lever on both the precision and the fixed cost.
- Tested on a 2026-10-02 development build of PanCode only. The site bindings, decision recording, and decision export used in the session were later removed, so that section describes the tested build and not a current release.
- Windows only. FastFlowLM’s Linux build exists but the measurements here are all on Windows with the harness driven from WSL2.
What this changes
The NPU path is slower than the iGPU path, four times slower on short states and two times slower at a thousand tokens. I am not going to pretend otherwise. It is still a win, and the reason is what it leaves alone. The GPU time it does not use is the chat model’s. The decisions it makes cost no hosted API call and never leave the machine. And it fits the deadline the harness actually sets: the recorded PanCode decisions carry a 1.5 s budget, and every short and mid-length state landed under it.
Credit where it is due, because none of this was mine alone. AMD’s Lemonade team made the NPU runtimes installable with one command and serve a Qwen3.5 model on the NPU today, which is the only reason I believed the port was possible. The FastFlowLM team shipped the kernels and opened the orchestration code and the converter, and their create_new_model.md is one of the clearest documents of its kind. llama.cpp’s converter handled a hybrid Qwen3.5 checkpoint without complaint. The Strands team published a decider with a readable training config, a pointer head, and an Apache-2.0 license. TypeSafe, Convai Innovations, Supersonic Labs, and Fastino each made the decision-model category real enough that a coding harness could bind to it. A Claude Code session did most of the digging in the engine while I steered, and a Codex session ran the GPU path beside it; I will write that collaboration up separately.
Unified memory is what made Strix Halo the first place this worked, and it is a better story than the one on the slide decks, but it is the enabling detail rather than the point. Gorgon Halo, the Ryzen AI Max 400 series, supports 192 GB on the same three-processor package. Everyone will use that number to talk about which 300B model fits. I am excited about it for the opposite reason: 192 GB is room for a 27B agent on the iGPU, a 26B observer in the background, two or three decision models on the NPU and CPU, a reranker, an embedder, and a working set of files, all resident at once, none of them swapping, working for one developer on a box under a desk. The bandwidth will still be the limit. The capacity to run the whole stack locally will not.
The point is placement. A decision engine is a target with a placement, the same way a chat model is: the iGPU for the model that writes, the NPU for the model that decides, the CPU for Julia-1 or the rules-only memory tier, and a hosted engine when the state may leave the machine. PanCode never schedules any of it. It sees a URL, a window, and the build the server reports, which is why the same configuration will describe a Mac with a decider on the Neural Engine, or a phone with one on its NPU, the day someone serves a decision model there. Every machine has a processor the chat model leaves idle. The decision tier is the workload that fits it.
If you want to try the stack, the installer on pancode.dev sets up PanCode against your models on your machines. In the 2026-10-02 development build I tested, you bound a decision engine to individual sites, checked it with the health check, and turned on decision recording to export every decision it made. Current builds use a single System One opt-in and a live check that sends one content-free decision and reports the build that answered; the PanCode guide has the current steps. The NPU harness was research code for one closed engine on one driver, and I am not shipping it. As of 2026-10-02, a profile for this model, a placement guide, health-check rows that show each engine alive, Julia-1’s tokenizer count, and per-engine round trips had landed in the tree.