You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Each table below maps a model_tag to its model folder, the kernel (slot) files in it, and the
CI build each comes from: xclbins-<unit, / as _>[_<MODEL_TYPE>], a folder of the run's
devkit-xclbins-shard-<i> artifacts (download them all with
gh run download <run id> -R ROCm/FastFlowLM -p 'devkit-xclbins-shard-*' -D <dir>).
Kernels
Artifacts
Compiler
slot file (.xclbin or .switches)
CI build (folder in devkit-xclbins-shard-<i>)
compiler
How to Test Your Kernel Code
Open a pull request that changes files under flm-dev-kit/FLM_Xclbin. Its Build and Test
run's devkit-xclbins jobs build the kernels the change touches (and those of any model whose
kernel_assignment.json entry it changes) with Peano in the pinned aie-build image, then
assemble them per model. To try them on your machine:
Download the devkit-xclbins artifact from that run (the run's page, or
gh run download <run id> -R ROCm/FastFlowLM -n devkit-xclbins -D <dir>). It is laid out as
FastFlowLM's xclbins tree: <model folder>/<slot> (.xclbin, or a .switches file), the folders and slots of the
tables below. A model only some of whose kernels the change rebuilt gets only those.
Copy the model folders you want over the installed ones, keeping the file names:
The run also compares each kernel with the one FastFlowLM ships (the job summary and the
devkit-xclbins-compare artifact; a report, never a failure). It fails when a kernel's RTP
addresses differ from rtp_addresses.lock.txt: the engines hard-code them, so in the same pull
request update the constants in flm-dev-kit/FLM_DLL/detail/<engine>/ of every engine serving a
model that uses the kernel (and FastFlowLM's src/detail/<engine>/), and regenerate the lock
from the run's shards:
gh run download <run id> -R ROCm/FastFlowLM -p 'devkit-xclbins-shard-*' -D <dir>, then
python3 .github/script/ci/devkit_rtp_lock.py generate <dir> -o flm-dev-kit/FLM_Xclbin/rtp_addresses.lock.txt --update.
devkit_check.py fails a pull request that changes a lock stanza without touching each of
those engines.
To build a kernel yourself, run make bitstream (with MODEL_TYPE=<type> for the units that fan
out) in its directory, either inside the ghcr.io/rocm/fastflowlm/aie-build image, which holds
the toolchain CI uses, or after source setup.sh with a local toolchain. The kernels land in
build/[<MODEL_TYPE>/]xclbins/; copy the one a table below assigns to a slot to
<model folder>/<slot>.xclbin as in step 2.
Limitations (will fix in the future)
Qwen3.5-Omni — no FastFlowLM model tag yet, so CI doesn't bench it. FastFlowLM ships its
Qwen3.5-OMNI-NPU2 folder; see
Qwen3.5-Omni for what CI builds for it. layer, lm_head and mm have no CI
build yet.
Same checkpoint as qwen3vl-it:4b, run by the qwen3vl_flash engine. Prefill
runs one fused overlay instead of separate mm.xclbin and attn.xclbin, so the
array is never reconfigured mid-layer. Columns 1-6 are the dequant+matmul half
and columns 0 and 7 a single attention compute unit, which keeps three matmul
columns on each of the two DDR channels.
qwen3_5.switches is not a kernel: it packs the aie2p-launchlib control-packet switches that let the prefill's conv1d,
gated delta net and attention run in the hardware context of mm_rtm2_glu.xclbin (about 0.1 ms per switch instead of
about 2.6 ms for a second context); see Qwen3_5/prefill_switches/README.md. The engine uses it when it is in the
folder and mm_rtm2_glu.xclbin is the mm kernel; QWEN35_NO_SWITCH=1 turns it off. qwen3_5_vision.switches does
the same for the vision encoder: its attention runs in the hardware context of vision_mm.xclbin (see
Qwen3_5/vision_switches/README.md); QWEN35_VISION_NO_SWITCH=1 turns it off. qwen3_5_decode.switches lets the
decode's q4_k lm_head run in the hardware context of layer.xclbin (see Qwen3_5/decode_switches/README.md);
QWEN35_DECODE_NO_SWITCH=1 turns it off.
No model tag yet → Qwen3.5-OMNI-NPU2. CI neither assembles
nor benches it. attn, conv and GateDeltaNet_prefill are the same files the Qwen3.5 models
use. — means CI has no build target for that kernel yet; FastFlowLM ships a Chess build.
NVIDIA Nemotron-3.5-Bolt-E4B: Gemma-4-E4B-it with more post-training, same text architecture (42 layers, hidden 2560,
vision and audio towers byte-identical to Gemma-4-E4B-it's). Same engine (gemma4e_npu) and the same kernels as
gemma4-it:e4b, in a folder of its own so this model's xclbins are built and shipped separately. The weights are
Q4_1 (converted from NVIDIA's Q4_K_M GGUF), as for gemma4-it:e4b.
DFlash speculative decoding for Nemotron-3.5-Bolt-E4B (engine gemma4e_dflash, a fork of gemma4e_npu). The tag needs nemotron3.5-bolt:e4b
installed (base_model): the main weights, tokenizer and chat template come from that package, this package holds only the draft weights.
Its xclbin folder has the full base kernel set plus lm_head_8.xclbin (Gemma4/lm_head_8: the final vocabulary projection for 8 token rows per
dispatch, used for the verify rows and the draft rows) and verify.xclbin (Gemma4/verify_decoding: the decoder layer on the 8 verify rows,
DESIGN=fused8). Both builds check their RTP addresses against rtp_expected/ because the engine compiles them in.
Single-turn flash serving with DFlash speculative decoding (engine gemma4e_dflash_flash: the gemma4e_flash fused prefill plus the
gemma4e_dflash draft/verify decode). Same package folder as nemotron3.5-bolt-dflash:e4b (and the same base_model,
nemotron3.5-bolt:e4b), so no new weights; the tag uses fused_prefill.xclbin instead of that tag's attn/swa/mm/dequant
prefill kernels, which is 9 NPU hardware contexts in total.
Same checkpoint as gemma4-it:e2b, run by the gemma4e_flash engine. Gemma4
alternates four sliding-window layers to one full-attention layer and the two
use different head dims, so the standalone flow needs three prefill overlays per
layer — mm.xclbin, attn.xclbin (DH 512) and swa.xclbin (DH 256) — and swaps
between them constantly. fused_prefill.xclbin holds all three at once: columns
1-6 are the dequant+matmul array, column 0 the full-attention CU and column 7
the sliding-window CU, so the array is never reconfigured mid-layer.
Same checkpoint as gemma4-it:e4b, run by the gemma4e_flash engine. Gemma4
alternates four sliding-window layers to one full-attention layer and the two
use different head dims, so the standalone flow needs three prefill overlays per
layer — mm.xclbin, attn.xclbin (DH 512) and swa.xclbin (DH 256) — and swaps
between them constantly. fused_prefill.xclbin holds all three at once: columns
1-6 are the dequant+matmul array, column 0 the full-attention CU and column 7
the sliding-window CU, so the array is never reconfigured mid-layer.
The tower uses vision_mm_p (design C on packed bfp16 operands) and vision_attn_kv when they are present.
vision_mm_c / vision_mm_a / vision_mm_b / vision_attn are the fallbacks (FLM_MINICPM_V_VISION_MM_P=0,
FLM_MINICPM_V_VISION_ATTN_KV=0). vision_mm_a is also the single-context home of the attention.
Text = the Qwen3.5-0.8B kernels, vision = the Qwen3.8 tower kernels, as minicpm-v-4.7:1b; GatedDeltaNet prefill is
its own rewritten kernel. The faster paths come from FLM_Xclbin/minicpm_ocr/: decode with the lm_head inside the
layer (layer_with_lm_head, and layer_with_lm_head_kvb reading K/V as bfp16; matrix type QWEN3_5_08B_KVB =
make bitstream KV_BFP16=1), bfp16 prefill attention (attn_bfp16), bfp16 prefill mm with the GLU on the array
(mm_bfp16_glu) and vision_overlay (vision mm + vision attention in one xclbin). The engine opens each of these when
present and falls back to attn / layer + lm_head / mm / vision_attn + vision_mm_a (env switches turn them
off); vision_mm_b is always needed. The overlay's switch table and layout are compiled into the engine
(FLM_DLL/detail/minicpm_ocr_npu/image/npu/); after any change to the overlay or the two vision folders run
make engine there and commit the copies. make bitstream fails if they differ (check_engine). No conv kernel:
conv1d runs on the host.
The prompt prefill's projections (q/k/v, o, up/gate, down) run on prefill.xclbin, a 32-core GEMM that reads the decode
weights below in place and multiplies them as block float; the host keeps the norms, RoPE and the last token's LM head.
Prompts of about 384 tokens or more also run their attention on the NPU, the shared prefill attention, inside
prefill.xclbin's hardware context through r2t2.switches (shorter ones, or with QWEN3_ASR_CPU_ATTENTION=1, keep it
on the host). Without r2t2.switches, or with QWEN3_ASR_NO_SWITCH=1, attn.xclbin runs it in its own context from
about 1024 tokens (switching contexts twice per layer costs more below). Without
prefill.xclbin, or with QWEN3_ASR_CPU_PREFILL=1, the prompt is prefilled on the host (AVX-512). The audio
encoder's matrix products (conv2/3, conv_out, qkv, o, fc1, fc2, proj1/2) run on audio_gemm.xclbin, a 32-core block-float
GEMM for its bf16 weights; the host keeps conv1 (K = 9), LayerNorm and window attention. Without that file, or with
QWEN3_ASR_CPU_ENCODER=1, the encoder runs on the host. Mixed
decode weights (QWEN3_ASR_1_7B_MIX): Q4_1 for q/k/o/gate/up and the LM head, Q8_0 for v_proj and down_proj (4-bit
everywhere breaks this fine-tune); the package's npu_q41.q4nx holds the Q4_1 copies. QWEN3_ASR_1_7B is the all-Q8_0
build (packages without that file).
r2t2.switches is not a kernel: it packs the aie2p-launchlib control-packet switches between prefill.xclbin's GEMM and
the attention; see r2t2_switches/README.md.
The d3 decision encoder (vllm-sr/d3-lite: the Qwen3.5-0.8B text tower, bidirectional full attention, no LM
head) runs every projection on mm.xclbin; conv1d and the gated delta rule run on the host, and so does
attention for short prompts. Prompts at or over the engine's cutover use attn.xclbin, Qwen3.5's prefill attention
made bidirectional, registered on the first such prompt (FLM_DLL/detail/d3_npu). Requests with images run Qwen3.5-0.8B's vision tower on
vision_mm.xclbin / vision_attn.xclbin, registered on the first image request.
The same engine and the same text kernels as d3:lite (vllm-sr/d3-nano: the Qwen3.5-2B text tower, 24 layers,
hidden 2048); the engine reads its dimensions from the package. Requests with images run Qwen3.5-2B's vision tower
(24 layers, width 1024, output 2048; the blocks are stock Qwen3.5-2B's, only the merger is d3-nano's).
The same engine and the same text kernels as d3:lite and d3:nano (vllm-sr/d3-mini: the Qwen3.5-4B text tower, 32
layers, hidden 2560, 16 heads / 4 kv heads, 16 key / 32 value linear-attention heads); the engine reads its dimensions
from the package. Requests with images run Qwen3.5-4B's vision tower (24 layers, width 1024, output 2560; every tensor,
merger included, is stock Qwen3.5-4B's).
The same engine and the same text kernels as d3:lite, d3:nano and d3:mini (vllm-sr/d3-turbo: the Qwen3.5-27B text
tower, 64 layers = 48 linear + 16 full attention, hidden 5120, 24 heads / 4 kv heads, 16 key / 48 value linear-attention
heads), with prefix_bidir attention (the state block attends within itself, the question block to everything) and the
state-once API; the engine reads its dimensions from the package. attn.xclbin is the same bidirectional bitstream as the
other d3 sizes (GQA 6 runs as 8 passes of 4 heads). Requests with images run Qwen3.5-27B's vision tower (27 layers, width
1152, output 5120) on the qwen3.5:9b vision kernels, which have the same tower shape (the merger output width is a
host-side parameter), so no new vision kernel is built.
vllm-sr/d3-ultra is a new fine-tune of the d3-turbo architecture (identical config, tokenizer and engine); it uses exactly the same four kernels as d3:turbo.
New in the host-side format only: prompt_layoutheader-v1 and temperature_by_questions.
vllm-sr/d3-flash is the Qwen3.5-9B size of the d3 family (32 layers, hidden 4,096, FFN 12,288, 16 query / 4 kv heads = GQA 4, 16 key / 32 value linear-attention
heads; noncausal_full_attention, no new host-side format). Its vision tower is qwen3.5:9b's (merger out 4,096), so it uses the same four kernels as d3:turbo
and d3:ultra; no kernel is built for it.
vllm-sr/d3-edge is the Qwen3.5-0.8B size of the d3 family, pruned to 12 layers (hidden 1,024, FFN 3,584, 8 query / 2 kv heads = GQA 4, 16 key / 16 value
linear-attention heads, tied embedding; noncausal_full_attention, no new host-side format). Its layer pattern is not every 4th layer: full attention sits at
layers 2, 5, 8, 9, 10 and 11, and the engine reads it from layer_types. Its vision tower is qwen3.5:0.8b's (12 layers, width 768, merger out 1,024), so it uses
that model's two vision kernels; no kernel is built for it.
d3.switches is not a kernel: it packs the aie2p-launchlib control-packet switches that let attention (from 512 tokens) and conv1d (from 1,536 rows)
run in the hardware context of mm_rtm2_glu.xclbin (about 0.12 ms per switch instead of 2.2-2.8 ms for a second context); see d3_switches/README.md.
The engine uses it when it is in the folder and mm_rtm2_glu.xclbin is the mm kernel; D3_NO_SWITCH=1 turns it off.
Inkling
inkling-2:mini → Inkling-2-Mini-NPU2
Thinking Machines Inkling-2-Mini (MoE). Prefill and decode do not load one xclbin per kernel: each
phase is a set of aie2p-launchlib apps, switched between by control packets, so the slots hold
.switches files (switches and decode_switches build them, with the xclbin each is made for)
next to the xclbins. mm_rtm2_glu.xclbin and prefill_attn.xclbin are the base contexts of
the prefill matmul and attention apps; decode.xclbin the decode overlay. The vision tower
(vision_mm.xclbin, vision_attn.xclbin) is the Qwen3-VL-4B one (same 1,024 width, 16 x 64 heads):
no kernel is built for it.
vision.switches is not a kernel: it packs the aie2p-launchlib switches that let the vision tower's attention (vision_attn32) run in the
hardware context of vision_mm8.xclbin (about 0.17 ms per switch as control packets); see SMOLVLA/vision_switches/README.md.
vision.xclbin is the SMOLVLA_VISION_L32=0 kill switch design, expert_bf16.xclbin the SMOLVLA_EXPERT_BF16=1 one.