# FastFlow SDK > FastFlow SDK runs FastFlowLM language models and compiles custom IRON NPU programs for AMD Ryzen AI XDNA2 NPUs on Linux and Windows, on the HRX runtime. FastFlow SDK is AMD's software stack for XDNA2 NPUs in Ryzen AI processors, on Linux and Windows (x86_64). `pip install fastflow-sdk` (from PyPI) installs FastFlowLM (`flm`, which runs and serves LLMs through an OpenAI-compatible API on the NPU), the HRX runtime and the `fastflow` health CLI, the iron-tools (MLIR-AIE) compiler with its `aie.iron` Python API, and the IRON operator library. Use `fastflow doctor --json` to check a machine and the Troubleshooting page to act on any check that fails. The scripts the pages show can be downloaded from /examples/ on this site. # Start here # FastFlow SDK FastFlow SDK is AMD's software stack for generative-AI applications on the XDNA2 neural processing unit (NPU) in Ryzen AI processors, on Linux and Windows. One `pip install` gives you: - **FastFlowLM** (`flm`): runs language, vision, speech, and embedding models on the NPU and serves them through an OpenAI-compatible API. - **iron-tools** (MLIR-AIE): the compiler and the `aie.iron` Python API for writing your own NPU programs. - **IRON**: a library of NPU operators, such as GEMM, attention, normalization, and RoPE, built with iron-tools. - **HRX**: the runtime that loads and dispatches NPU programs, with the `fastflow` CLI that checks a machine's driver, device, and runtime. ``` python -m pip install fastflow-sdk ``` ``` fastflow self-test # dispatches a packaged program on the NPU flm serve qwen3:0.6b # OpenAI-compatible server on http://127.0.0.1:52625/v1 ``` > [!WARNING] > > **Early access** > > FastFlow SDK is at version 0. Interfaces, packages, models, and supported drivers can change between releases. Each [release]() lists the drivers it was qualified on. ## Choose a path - **Run and serve models** Chat with a model in the terminal, or call it from any OpenAI client. [Run and serve models]() - **Program the NPU** Compile and run your first IRON design, then use the operator library. [Hello NPU]() - **Check a machine** Find out why the NPU, driver, or runtime is not working. [Troubleshooting]() - **Work with an AI agent** Machine-readable docs, JSON CLI output, and rules for coding agents. [For AI agents]() ## How the pieces fit | You want to | Use | Package | | --- | --- | --- | | Run or serve a supported model | `flm` | `fastflow-sdk-fastflowlm` | | Write an NPU kernel or design in Python | `aie.iron` | `fastflow-sdk-compiler` | | Reuse tuned NPU operators | `iron.operators` | `fastflow-sdk-ops` | | Check the device, driver, and runtime | `fastflow` | `fastflow-sdk-runtime` | | All of the above | | `fastflow-sdk` | Programs compiled with iron-tools run on the HRX runtime, which ships in the same install; you do not need XRT. For a validated, higher-level serving application, see [Lemonade Server](), which integrates FastFlowLM. ## Supported platforms x86\_64 Linux and Windows (native PowerShell, not WSL) with an AMD Ryzen AI NPU that implements XDNA2 (NPU2): Strix Point, Strix Halo, Krackan Point, and Gorgon Point. See [Hardware and drivers]() for the systems and drivers the latest release was qualified on. # Install ## Requirements | | | | --- | --- | | Operating system | Linux or Windows, x86\_64. On Windows use native PowerShell; WSL is not supported. | | NPU | AMD Ryzen AI with an XDNA2 (NPU2) NPU. See [Hardware and drivers](). | | Driver | The `amdxdna` driver on Linux, the AMD NPU driver on Windows. Each release lists the versions it was qualified on. | | Python | 3.12, 3.13, or 3.14. The standalone archive needs no Python. | ## Python wheels Releases are on [PyPI]() as one `fastflow-sdk` wheel per platform. Create a virtual environment and activate it before every command below: ``` # Windows winget install --exact --id Python.Python.3.12 py -3.12 -m venv $HOME\fastflow & $HOME\fastflow\Scripts\Activate.ps1 ``` ``` # Linux sudo apt-get install -y python3.12 python3.12-venv python3.12 -m venv ~/fastflow source ~/fastflow/bin/activate ``` Install the latest release: ``` python -m pip install fastflow-sdk ``` To install one release, pin its version, `"fastflow-sdk=="`, with a version from the [Release notes](). The wheel contains these parts of the SDK: | Part | Provides | | --- | --- | | FastFlowLM | `flm` and the model registry | | Runtime | `fastflow`, the HRX runtime library, and the `fastflow_sdk_runtime` Python helpers | | Compiler | iron-tools: `aie.iron`, `aiecc`, `aie-opt`, Peano | | Operators | the IRON operator library, `iron.operators` | | Qualification | `fastflow qualify`, for validating a release on a machine. See [Model qualification](). | ### Development builds Development builds are published on [GitHub Releases]() between releases, not on PyPI. Install them from the FastFlow SDK package index: ``` python -m pip install --pre --only-binary=:all: --extra-index-url https://rocm.github.io/FastFlow-SDK/simple fastflow-sdk ``` Pin `"fastflow-sdk=="` to install one development build. They install the SDK as separate packages, such as `fastflow-sdk-runtime` and `fastflow-sdk-fastflowlm`, instead of the single PyPI wheel. Use a new virtual environment to switch between a release and a development build. A development build's packages are `fastflow-sdk-fastflowlm`, `fastflow-sdk-runtime`, `fastflow-sdk-compiler`, `fastflow-sdk-ops`, and the optional `fastflow-sdk-qualification`. You can also install one alone; the runtime and FastFlowLM alone need Python 3.11 or newer. ## Verify the install ``` fastflow version fastflow probe --json fastflow doctor fastflow self-test flm list flm run qwen3:0.6b ``` `fastflow doctor` and `fastflow self-test` exit 0 when everything passes. `flm run` downloads the model on first use and needs access to Hugging Face; type `/bye` to leave the chat. If a check fails, look it up in [Troubleshooting](). After installing or changing a driver, reboot before you debug further. ## Standalone archive Each release also has a relocatable FastFlowLM and HRX archive, `fastflow-sdk-windows-x86_64.zip` or `fastflow-sdk-linux-x86_64.tar.zst`. It runs models without Python but cannot compile NPU programs. ``` # Windows Expand-Archive .\fastflow-sdk-windows-x86_64.zip -DestinationPath . cd .\fastflow-sdk-windows-x86_64 .\bin\fastflow.exe version .\bin\fastflow.exe probe --json .\bin\fastflow.exe doctor .\bin\fastflow.exe self-test .\bin\flm.exe list .\bin\flm.exe run qwen3:0.6b ``` ``` # Linux tar --zstd -xf fastflow-sdk-linux-x86_64.tar.zst cd fastflow-sdk-linux-x86_64 ./bin/fastflow version ./bin/fastflow probe --json ./bin/fastflow doctor ./bin/fastflow self-test ./bin/flm list ./bin/flm run qwen3:0.6b ``` ## Upgrade Add `--upgrade` to the install command: ``` python -m pip install --upgrade fastflow-sdk ``` For a development build, add `--upgrade` to its install command instead. `fastflow-sdk` pins each of its packages to its own version, so they move to the new build together. To build the SDK yourself instead, see [Build from source](). # For AI agents This page is for coding agents, and for people setting one up, that build NPU applications with FastFlow SDK. ## Machine-readable documentation | URL | Contents | | --- | --- | | [`/llms.txt`]() | Index of this site with a one-line summary per page | | [`/llms-full.txt`]() | The whole site as one Markdown file | | Any page URL with `index.md` appended | That page as Markdown | | `/examples/` | The scripts the pages show, for example [`/examples/hello_npu.py`]() and [`/examples/serve/chat.py`]() | The site documents one release, normally the latest, and [Component versions]() names it: commands, pins, and examples match what installing that release gives you. The reference pages ([CLI](), [Troubleshooting](), [Models](), [IRON operators](), [Hardware and drivers](), [Component versions](), [Release notes]()) are generated from the SDK's sources and releases each time the site is published. ## Rules 1. **Install from PyPI.** Use `python -m pip install fastflow-sdk` with Python 3.12 to 3.14 in a virtual environment. Only for a development build, add `--pre --only-binary=:all: --extra-index-url https://rocm.github.io/FastFlow-SDK/simple`, in a separate environment. 2. **Do not install XRT or upstream `mlir-aie` wheels into the same environment.** The SDK ships its own compiler and the HRX runtime, and importing `aie` selects HRX. 3. **Check the machine with JSON, not text.** Run `fastflow doctor --json` (or `fastflow self-test --json` for a real dispatch). Read `status` and each `checks[].id`; look up every check that is not `pass` in [Troubleshooting](). Exit status is `0` for pass, `1` for a failed check, `2` for invalid input. Human output is not stable. 4. **To run a supported model, serve it; do not write kernels.** Start `flm serve ` and use the OpenAI API at `http://127.0.0.1:52625/v1` with any API key. Tags are on [Models](). See [Run and serve models](). 5. **For custom NPU compute, start from a working program.** Prefer an existing [IRON operator]() over writing a kernel. For a new design, begin with [Hello NPU]() and target `NPU2()`. 6. **Match upstream examples to the shipped pins.** MLIR-AIE and IRON documentation describes their default branches. The SDK pins specific revisions; use the links on [Component versions]() when an example does not match the installed API. 7. **Know the limits.** NPU2 (XDNA2) only. Linux or native Windows, not WSL. No `load_pdi` or `ScratchpadParameter` in `@iron.jit` sequences; an `iron.Graph` compiled to a full ELF supports them, on the drivers listed under [Hello NPU limitations](). Setting the NPU power mode needs root on Linux or an elevated shell on Windows. 8. **After a driver change, reboot before debugging.** ## Task to command | Task | Command | | --- | --- | | Is the NPU usable? | `fastflow doctor --json` | | Does a real dispatch work? | `fastflow self-test --json` | | Which driver and firmware are active? | `fastflow probe --json` | | Which models are available? | `flm list` | | Serve a model to an application | `flm serve qwen3:0.6b` | | Check the compiler works without an NPU | `python hello_npu.py --build-only` ([Hello NPU]()) | | Run a library operator on the NPU | The AXPY example on [IRON operators]() | | Set NPU power mode | `fastflow powermode performance` | | Which versions are installed? | `fastflow version --json`, `flm version` | ## Report shape Every built-in `fastflow --json` command writes one report. `data` is left out when a command has none, `--help` stays plain text, and external plugins write their own output. ``` { "schema_version": 1, "command": "doctor", "status": "fail", "product": {"version": "", "source_revision": "", "build_platform": "Linux-x86_64"}, "checks": [ {"id": "device.access", "status": "fail", "message": "no accelerator device can be opened read/write", "details": {"usable_count": 0}} ], "data": {"probe": {}} } ``` The [JSON contract]() defines the fields and what may change between versions. # Glossary The same parts have several names across AMD, upstream projects, and older documentation. This page maps them. | Term | Meaning | Also called | | --- | --- | --- | | NPU | Neural processing unit: the AI accelerator in Ryzen AI processors. | IPU (older name) | | XDNA2 | The NPU architecture this SDK targets, in Strix Point, Strix Halo, Krackan Point, and Gorgon Point. | NPU2, AIE2P, `aie2p`, `npu2` | | XDNA | The previous NPU architecture, in Phoenix and Hawk Point. Reported by `fastflow probe`, not qualified. | NPU1, AIE2 | | AIE | AI Engine: the array of compute, memory, and shim (I/O) tiles inside the NPU. | AI Engine array | | `amdxdna` | The Linux kernel driver for AMD NPUs. | XDNA driver, KMD | | FastFlow SDK | This stack: FastFlowLM, HRX, iron-tools, and IRON in one install. | `fastflow-sdk` | | FastFlowLM | The NPU inference engine for language, vision, speech, and embedding models. | FLM, `flm` | | HRX | HIP Runtime Extended: the runtime that loads and dispatches NPU programs. Replaces XRT for this stack. | `libhrx`, `hrx.dll` | | iron-tools | The AIE compiler toolchain and its Python API. | MLIR-AIE, `mlir-aie`, `aie`, `aie.iron` | | IRON (API) | The Python API in iron-tools for writing NPU designs: `ObjectFifo`, `Worker`, `Runtime`, `Program`, `@iron.jit`. | `aie.iron` | | IRON (library) | The operator library built with iron-tools, in the `iron` package. | iron-ops, `amd/IRON`, `fastflow-sdk-ops` | | Peano | The LLVM-based compiler that generates AIE core code. | llvm-aie | | `aiecc` | The iron-tools compiler driver that turns a design into an NPU binary. | | | XRT | Xilinx Runtime, the runtime MLIR-AIE and IRON use upstream. Not needed with FastFlow SDK. | | | xclbin | A container with the NPU configuration and kernels for a design. | | | PDI | Programmable device image: the configuration loaded into the NPU, extracted from a compiled design. | | | XADX | The HRX executable format that `fastflow self-test` dispatches. | | | Full ELF | A self-contained NPU executable that can hold several designs and their PDIs. | | | ObjectFifo | IRON's abstraction for moving data between tiles with synchronized buffers. | | | Shim tile | An AIE tile that connects the array to host memory. | `ShimTile` | | Mem tile | An AIE tile with shared memory between shim and compute tiles. | `MemTile`, L2 | | Power mode | NPU performance setting: `default`, `powersaver`, `balanced`, `performance`, or `turbo`. | `pmode` | | Qualification | Running a release's test profiles on real hardware and publishing the evidence with the release. | `fastflow qualify` | | Model extension | An engine built outside `flm` that it loads to run or modify a model. | `--model-extension` | # Run and serve models # Run and serve models FastFlowLM (`flm`) runs models on the NPU from the terminal or as a local server with an OpenAI-compatible API, so existing OpenAI clients, LangChain, and Open WebUI work unchanged. The model tags are on the [Models]() page; `flm list` shows the ones in your installed release. ## Chat in the terminal ``` flm run qwen3:0.6b ``` The first run downloads the model from Hugging Face. Type `/bye` to exit. `flm pull ` downloads without starting a chat. ## Start the server ``` flm serve qwen3:0.6b ``` The server listens on `http://127.0.0.1:52625`, with the OpenAI API under `/v1`. Change the port for one run with `--port `, or for every run with the `FLM_SERVE_PORT` environment variable. Other useful options: | Option | Effect | | --- | --- | | `--ctx-len ` | Context length, rounded up to a power of two, at least 512 | | `--pmode ` | NPU power mode: `powersaver`, `balanced`, `performance` (default), or `turbo` | | `--embed 1` | Also load the default embedding model, EmbeddingGemma; or pass an embedding model's tag | | `--asr 1` | Also load the default speech-to-text model, Whisper; or pass a speech model's tag | | `--cors 0` | Disable CORS, which is on by default; do this if the server is reachable beyond localhost | One model of each kind (LLM, embedding, speech) can be loaded at a time, and they can run together in one server. ## Endpoints | Endpoint | Use | | --- | --- | | `GET /v1/models` | List the models | | `POST /v1/chat/completions` | Chat, streaming, tool calls, and structured output | | `POST /v1/completions` | Plain text completion | | `POST /v1/embeddings` | Embeddings; start the server with `--embed 1` | | `POST /v1/audio/transcriptions` | Speech to text; start the server with `--asr 1` | The server does not check API keys, but OpenAI clients require one, so pass any string. ``` curl http://127.0.0.1:52625/v1/chat/completions \ -H "Content-Type: application/json" \ -d '{"model": "qwen3:0.6b", "messages": [{"role": "user", "content": "Hello"}]}' ``` The Python examples below need `python -m pip install openai`. CI runs each one except speech to text against `flm serve` on an NPU. Download them from this site, for example `curl -fsSLO https://rocm.github.io/FastFlow-SDK/examples/serve/chat.py`. ## Chat with streaming ``` #!/usr/bin/env python3 # Copyright Advanced Micro Devices, Inc. # SPDX-License-Identifier: MIT """Chat with a model that FastFlowLM serves on the NPU, streaming the reply. Start the server in another terminal first: flm serve qwen3:0.6b python -m pip install openai python examples/serve/chat.py """ import os from openai import OpenAI # flm serve listens on 52625 unless FLM_SERVE_PORT or --port changes it. BASE_URL = os.environ.get("FLM_BASE_URL", "http://127.0.0.1:52625/v1") MODEL = os.environ.get("FLM_MODEL", "qwen3:0.6b") # FastFlowLM does not check the key, but the client requires one. client = OpenAI(base_url=BASE_URL, api_key="flm") stream = client.chat.completions.create( model=MODEL, messages=[{"role": "user", "content": "In one sentence, what is an NPU?"}], stream=True, ) for chunk in stream: if chunk.choices and chunk.choices[0].delta.content: print(chunk.choices[0].delta.content, end="", flush=True) print() ``` ## Tool calls The server parses each model's own tool-call markup into OpenAI `tool_calls`. It supports `tool_choice` (`auto`, `required`, `none`, or one function) and `parallel_tool_calls`. Use a model whose capabilities on [Models]() include `tool-calling`, such as `gemma4-it:e2b`. ``` #!/usr/bin/env python3 # Copyright Advanced Micro Devices, Inc. # SPDX-License-Identifier: MIT """Let a model that FastFlowLM serves call a Python function. Use a model whose Capabilities on the Models page include tool calling: flm serve gemma4-it:e2b python examples/serve/tool_call.py """ import json import os from openai import OpenAI BASE_URL = os.environ.get("FLM_BASE_URL", "http://127.0.0.1:52625/v1") MODEL = os.environ.get("FLM_MODEL", "gemma4-it:e2b") client = OpenAI(base_url=BASE_URL, api_key="flm") def get_weather(city: str) -> dict: return {"city": city, "forecast": "sunny", "celsius": 21} TOOLS = [ { "type": "function", "function": { "name": "get_weather", "description": "Get today's weather for a city.", "parameters": { "type": "object", "properties": {"city": {"type": "string"}}, "required": ["city"], }, }, } ] messages = [{"role": "user", "content": "What is the weather in Austin today?"}] reply = client.chat.completions.create(model=MODEL, messages=messages, tools=TOOLS) message = reply.choices[0].message messages.append(message.model_dump(exclude_none=True)) for call in message.tool_calls or []: print(f"tool call: {call.function.name}({call.function.arguments})") result = get_weather(**json.loads(call.function.arguments)) messages.append( {"role": "tool", "tool_call_id": call.id, "content": json.dumps(result)} ) final = client.chat.completions.create(model=MODEL, messages=messages, tools=TOOLS) print(final.choices[0].message.content) ``` ## Thinking and structured output Reasoning models put their thinking in `reasoning_content`, separate from `content`. Turn thinking on or off per request with the FastFlowLM `think` field, which the OpenAI SDK sends through `extra_body`: ``` client.chat.completions.create(model="qwen3:0.6b", messages=messages, extra_body={"think": False}) ``` The setting stays on the loaded model for later requests, so send it on every request if you mix both. `response_format` accepts `json_object` and `json_schema`, and constrains the output to the schema. FastFlowLM documents both in [Reasoning, tool calls and streaming]() and [Structured output](). ## Embeddings ``` #!/usr/bin/env python3 # Copyright Advanced Micro Devices, Inc. # SPDX-License-Identifier: MIT """Embed text with EmbeddingGemma, served by FastFlowLM beside an LLM. flm serve qwen3:0.6b --embed 1 python examples/serve/embeddings.py """ import math import os from openai import OpenAI BASE_URL = os.environ.get("FLM_BASE_URL", "http://127.0.0.1:52625/v1") client = OpenAI(base_url=BASE_URL, api_key="flm") def embed(text: str) -> list[float]: return client.embeddings.create(model="embed-gemma", input=text).data[0].embedding a = embed("The model runs on the NPU.") b = embed("The NPU executes the model.") cosine = sum(x * y for x, y in zip(a, b, strict=True)) / ( math.hypot(*a) * math.hypot(*b) ) print(f"{len(a)} dimensions, cosine similarity {cosine:.3f}") ``` ## Speech to text ``` #!/usr/bin/env python3 # Copyright Advanced Micro Devices, Inc. # SPDX-License-Identifier: MIT """Transcribe an audio file with Whisper, served by FastFlowLM. flm serve --asr 1 python examples/serve/transcribe.py recording.mp3 """ import os import sys from openai import OpenAI BASE_URL = os.environ.get("FLM_BASE_URL", "http://127.0.0.1:52625/v1") client = OpenAI(base_url=BASE_URL, api_key="flm") with open(sys.argv[1], "rb") as audio: print(client.audio.transcriptions.create(model="whisper-v3", file=audio).text) ``` ## Use your own NPU kernels in a model FastFlowLM loads model extensions: engines built outside `flm` that replace parts of a model with your own NPU programs. [Replace Gemma 4 GEMM and dequant with IRON]() walks through one. # Models FastFlowLM runs these models on NPU2 (XDNA2). Use the tag with `flm`: ``` flm pull qwen3:0.6b # download flm run qwen3:0.6b # chat in the terminal; /bye exits flm serve qwen3:0.6b # OpenAI-compatible server, see Serve models ``` The registry is versioned with each release, so `flm list` is authoritative for the release you installed. Benchmarks and model cards are on the [FastFlowLM model pages](). Generated from `src/model_list.json` at FastFlowLM `07defcb8cb9a`. Footprint is the approximate memory the model needs, in GB. | Tag | Parameters | Quantization | Default context | Footprint (GB) | Capabilities | Minimum flm | Weights | | --- | --- | --- | --- | --- | --- | --- | --- | | `hy-mt2-flash:1.8b` | 1.8B | Q4\_0 | 32768 | 1.4 | single-turn, translation | 1.0.13 | [Hy-MT2-1.8B-NPU2]() | | `hy-memory:30b-a3b` | 30B-A3B | Q4\_K | 32768 | 22.0 | memory | 1.0.13 | [Hy-Memory-30B-A3B-NPU2]() | | `r2t2:1.7b` | 2B | Q8\_0 / Q4\_1 | 2048 | 4.2 | audio, transcription | 1.0.14 | [Confucius4-R2T2-NPU2]() | | `nanbeige4.1:3b` | 3B | Q4\_1 | 8192 | 2.9 | reasoning | 0.9.38 | [Nanbeige4.1-3B-NPU2]() | | `qwen3vl-it:4b` | 4B | Q4\_1 | 32768 | 3.9 | tool-calling, vision | 0.9.22 | [Qwen3-VL-4B-Instruct-NPU2]() | | `qwen3vl-flash:4b` | 4B | Q4\_1 | 1024 | 3.9 | single-turn, vision | 0.9.22 | [Qwen3-VL-4B-Instruct-NPU2]() | | `gemma4-it:e2b` | 5B | Q4\_1 | 32768 | 5.6 | audio, chat-transcription, reasoning, thinking toggle, tool-calling, vision | 0.9.43 | [Gemma4-E2B-IT-NPU2]() | | `gemma4-it:e4b` | 8B | Q4\_1 | 32768 | 8.5 | audio, chat-transcription, reasoning, thinking toggle, tool-calling, vision | 0.9.43 | [Gemma4-E4B-IT-NPU2]() | | `gemma4-it:12b` | 12B | Q4\_0 | 32768 | 8.7 | audio, chat-transcription, reasoning, thinking toggle, tool-calling, vision | 1.0.4 | [Gemma4-12B-IT-NPU2]() | | `nemotron3.5-bolt:e4b` | 8B | Q4\_1 | 32768 | 8.5 | audio, chat-transcription, reasoning, thinking toggle, tool-calling, vision | 1.0.11 | [Nemotron-3.5-Bolt-E4B-NPU2]() | | `nemotron3.5-bolt-dflash:e4b` | 8B+0.36B | Q4\_1 | 32768 | 8.7 | audio, chat-transcription, reasoning, speculative, tool-calling, vision | 1.0.12 | [Nemotron-3.5-Bolt-E4B-DFlash-NPU2]() | | `nemotron3.5-bolt-dflash-flash:e4b` | 8B+0.36B | Q4\_1 | 1024 | 8.7 | audio, chat-transcription, reasoning, single-turn, speculative, vision | 1.0.12 | [Nemotron-3.5-Bolt-E4B-DFlash-NPU2]() | | `gemma4e-flash:e2b` | 5B | Q4\_1 | 1024 | 5.6 | audio, chat-transcription, reasoning, single-turn, thinking toggle, vision | 0.9.43 | [Gemma4-E2B-IT-NPU2]() | | `gemma4e-flash:e4b` | 8B | Q4\_1 | 1024 | 8.5 | audio, chat-transcription, reasoning, single-turn, thinking toggle, vision | 0.9.43 | [Gemma4-E4B-IT-NPU2]() | | `qwen3.5:0.8b` | 0.8B | Q4\_K | 32768 | 0.72 | reasoning, thinking toggle, vision | 1.0.3 | [Qwen3.5-0.8B-NPU2]() | | `qwen3.5:2b` | 2B | Q4\_K | 32768 | 1.9 | reasoning, thinking toggle, tool-calling, vision | 1.0.3 | [Qwen3.5-2B-NPU2]() | | `qwen3.5:4b` | 4B | Q4\_K | 32768 | 3.2 | reasoning, thinking toggle, tool-calling, vision | 1.0.3 | [Qwen3.5-4B-NPU2]() | | `qwen3.5:9b` | 9B | Q4\_K | 32768 | 7.6 | reasoning, thinking toggle, tool-calling, vision | 1.0.3 | [Qwen3.5-9B-NPU2]() | | `minicpm-v-4.7:1b` | 1B | Q4\_K | 32768 | 2.1 | reasoning, thinking toggle, tool-calling, vision | 1.0.13 | [MiniCPM-V-4.7-1B-NPU2]() | | `minicpm-ocr:1.0` | 1B | Q4\_K | 32768 | 2.4 | tool-calling, vision | 1.0.13 | [MiniCPM-OCR-1.0-NPU2]() | | `minicpm-v-4.7-moe:35b-a3b` | 35B | Q4\_K | 32768 | 20.7 | reasoning, thinking toggle, tool-calling, vision | 1.0.12 | [MiniCPM-V-4.7-35B-A3B-NPU2]() | | `qwen3.6-moe:35b-a3b` | 35B | Q4\_K | 32768 | 20.6 | reasoning, thinking toggle, tool-calling, vision | 1.0.3 | [Qwen3.6-35B-A3B-NPU2]() | | `qwen3.8-mtp:27b` | 27B | Q4\_K | 4096 | 16.8 | reasoning, speculative, tool-calling, vision | 1.0.7 | [Qwen3.8-27B-NPU2]() | | `qwen3.8-dflash2:27b` | 27B+2B | Q4\_K | 4096 | 18.1 | reasoning, speculative, tool-calling, vision | 1.0.12 | [Qwen3.8-27B-DFlash2-NPU2]() | | `lfm2:1.2b` | 1.2B | Q4\_0 | 32768 | 0.94 | | 0.9.24 | [LFM2-1.2B-NPU2]() | | `lfm2:2.6b` | 2.6B | Q4\_0 | 32768 | 1.8 | | 0.9.24 | [LFM2-2.6B-NPU2]() | | `lfm2-trans:2.6b` | 2.6B | Q4\_0 | 32768 | 1.8 | | 0.9.24 | [LFM2-2.6B-Transcript-NPU2]() | | `lfm2.5-it:1.2b` | 1.2B | Q4\_0 | 32768 | 0.94 | | 0.9.25 | [LFM2.5-1.2B-NPU2]() | | `lfm3:1.7b` | 1.7B | Q4\_0 | 32768 | 1.5 | reasoning, thinking toggle, tool-calling | 1.0.11 | [LFM3-1.7B-NPU2]() | | `lfm2.5-tk:1.2b` | 1.2B | Q4\_0 | 32768 | 0.94 | reasoning | 0.9.27 | [LFM2.5-1.2B-Thinking-NPU2]() | | `phi4-mini-it:4b` | 4B | Q4\_1 | 32768 | 3.4 | | 0.9.25 | [Phi4-mini-Instruct-NPU2]() | | `embed-gemma:300m` | 300M | none | 2048 | 0.61 | embeddings | 0.9.15 | [Embedding-Gemma-300M-NPU2]() | | `d3:edge` | 0.6B | Q4\_K | 32768 | 0.58 | decision | 1.0.12 | [D3-Edge-NPU2]() | | `d3:lite` | 0.8B | Q4\_K | 32768 | 0.72 | decision | 1.0.11 | [D3-Lite-NPU2]() | | `d3:nano` | 2B | Q4\_K | 32768 | 1.9 | decision | 1.0.11 | [D3-Nano-NPU2]() | | `d3:mini` | 4B | Q4\_K | 32768 | 3.2 | decision | 1.0.11 | [D3-Mini-NPU2]() | | `d3:flash` | 9B | Q4\_K | 32768 | 5.7 | decision | 1.0.12 | [D3-Flash-NPU2]() | | `d3:turbo` | 27B | Q4\_K | 32768 | 15.4 | decision | 1.0.11 | [D3-Turbo-NPU2]() | | `d3:ultra` | 27B | Q4\_K | 32768 | 15.4 | decision | 1.0.11 | [D3-Ultra-NPU2]() | | `whisper-v3:turbo` | 1B | Q4\_1 | 448 | 0.61 | audio, realtime-transcription, transcription | 0.9.14 | [Whisper-V3-Turbo-NPU2]() | | `gemma3:1b` | 1B | Q4\_1 | 32768 | 1.2 | | 0.9.20 | [Gemma3-1B-NPU2]() | | `gemma3:4b` | 4B | Q4\_1 | 65536 | 4.4 | vision | 0.9.23 | [Gemma3-4B-NPU2]() | | `translategemma:4b` | 4B | Q4\_1 | 65536 | 4.4 | vision | 0.9.34 | [Translategemma-4B-Instruct-NPU2]() | | `medgemma:4b` | 4B | Q4\_1 | 65536 | 4.4 | vision | 0.9.43 | [Medgemma-4B-NPU2]() | | `medgemma1.5:4b` | 4B | Q4\_1 | 65536 | 4.4 | vision | 0.9.43 | [Medgemma-1.5-4B-NPU2]() | | `llama3.2:1b` | 1B | Q4\_1 | 131072 | 1.2 | | 0.9.21 | [Llama-3.2-1B-NPU2]() | | `llama3.2:3b` | 3B | Q4\_1 | 65536 | 2.6 | | 0.9.21 | [Llama-3.2-3B-NPU2]() | | `llama3.1:8b` | 8B | Q4\_1 | 16384 | 5.4 | | 0.9.21 | [Llama-3.1-8B-NPU2]() | | `deepseek-r1:8b` | 8B | Q4\_1 | 16384 | 5.4 | reasoning | 0.9.43 | [Deepseek-R1-Distill-Llama-8B-NPU2]() | | `deepseek-r1-0528:8b` | 8B | Q4\_1 | 16384 | 5.6 | reasoning | 0.9.22 | [DeepSeek-R1-0528-Qwen3-8B-NPU2]() | | `qwen3:0.6b` | 0.6B | Q4\_1 | 32768 | 0.65 | reasoning, thinking toggle | 0.9.22 | [Qwen3-0.6B-NPU2]() | | `qwen3:1.7b` | 1.7B | Q4\_1 | 32768 | 1.6 | reasoning, thinking toggle | 0.9.22 | [Qwen3-1.7B-NPU2]() | | `qwen3:4b` | 4B | Q4\_1 | 32768 | 3.1 | reasoning, thinking toggle, tool-calling | 0.9.22 | [Qwen3-4B-NPU2]() | | `qwen3:8b` | 8B | Q4\_1 | 16384 | 5.6 | reasoning, thinking toggle, tool-calling | 0.9.22 | [Qwen3-8B-NPU2]() | | `qwen3-tk:4b` | 4B | Q4\_1 | 32768 | 3.1 | reasoning, tool-calling | 0.9.22 | [Qwen3-4B-Thinking-2507-NPU2]() | | `qwen3-it:4b` | 4B | Q4\_1 | 32768 | 3.1 | tool-calling | 0.9.22 | [Qwen3-4B-Instruct-2507-NPU2]() | | `gpt-oss:20b` | 20B | Q4\_1 | 8192 | 13.5 | reasoning | 0.9.20 | [GPT-OSS-20B-NPU2]() | | `gpt-oss-sg:20b` | 20B | Q4\_1 | 8192 | 13.5 | reasoning | 0.9.20 | [GPT-OSS-Safeguard-20b-NPU2]() | | `qwen2.5-it:3b` | 3B | Q4\_0 | 32768 | 2.4 | | 0.9.32 | [Qwen2.5-3B-Instruct-NPU2]() | | `qwen2.5vl-it:3b` | 3B | Q4\_1 | 32768 | 3.7 | vision | 0.9.32 | [Qwen2.5-VL-3B-Instruct-NPU2]() | # Program the NPU # Hello NPU This is the smallest complete NPU program: a buffer copied from host memory through a memory tile and back, with no compute kernel. Compiling and running it exercises the whole chain, from IRON Python through the MLIR-AIE compiler to an NPU binary dispatched by HRX. CI compiles and runs this exact file on an NPU. ## Run it Install the SDK ([Install]()), then download and run the program: ``` curl -fsSLO https://rocm.github.io/FastFlow-SDK/examples/hello_npu.py python hello_npu.py # PASS: 4096 int32 elements copied through the NPU ``` `python hello_npu.py --build-only` compiles without an NPU and prints the paths of the generated `xclbin` and instruction stream. Importing `aie` with the SDK installed selects the HRX runtime, so you do not need XRT. Values you set yourself for `NPU_RUNTIME` or `HRX_LIBHRX` take precedence. ## The program ``` #!/usr/bin/env python3 # Copyright Advanced Micro Devices, Inc. # SPDX-License-Identifier: MIT """Hello NPU: compile the smallest complete IRON design and run it on the NPU. The design is a pure-DMA memcpy, DDR -> MemTile -> DDR, with no compute kernel, so it covers the whole chain: IRON -> MLIR -> aiecc -> bootgen -> xclbin -> HRX -> NPU. python hello_npu.py # compile and run (needs an NPU) python hello_npu.py --build-only # compile only CI runs it with `python dev.py test-npu-jit [--build-only]`. For the programming abstractions (ObjectFifo, Worker, tiling, C++ kernels) and many more designs, see the iron-tools/MLIR-AIE programming guide and programming examples . """ import argparse import sys from pathlib import Path import aie.iron as iron import numpy as np from aie.iron import CompileTime, In, ObjectFifo, Out, Program, Runtime from aie.iron.device import NPU2, AnyShimTile LINE = 1024 SIZE = 4096 @iron.jit def memcpy_passthrough(src: In, dst: Out, *, n: CompileTime[int]): line_ty = np.ndarray[(LINE,), np.dtype[np.int32]] vec_ty = np.ndarray[(n,), np.dtype[np.int32]] of_in = ObjectFifo(line_ty, name="in") of_out = of_in.cons().forward() def sequence(a_in, c_out, in_handle, out_handle): in_handle.fill(a_in) out_handle.drain(c_out, wait=True) rt = Runtime( sequence, [ vec_ty, vec_ty, of_in.prod(tile=AnyShimTile), of_out.cons(tile=AnyShimTile), ], ) return Program(NPU2(), rt).resolve_program() def build_only(size: int) -> int: xclbin, insts = memcpy_passthrough.specialize(n=size).compile() for label, path in (("xclbin", xclbin), ("insts", insts)): if path is None or not Path(path).is_file() or Path(path).stat().st_size == 0: print(f"FAIL: compiler produced no usable {label} ({path})") return 1 print(f"PASS: compiled a {size} int32 memcpy design") print(f" xclbin: {xclbin} ({Path(xclbin).stat().st_size} bytes)") print(f" insts: {insts} ({Path(insts).stat().st_size} bytes)") return 0 def build_and_run(size: int) -> int: src = iron.arange(1, size + 1, dtype=np.int32, device="npu") dst = iron.zeros_like(src) memcpy_passthrough(src, dst, n=size) if np.array_equal(dst.numpy(), src.numpy()): print(f"PASS: {size} int32 elements copied through the NPU") return 0 differing = int(np.count_nonzero(dst.numpy() != src.numpy())) print(f"FAIL: {differing}/{size} elements differ") return 1 def main() -> int: parser = argparse.ArgumentParser(description=__doc__) parser.add_argument( "--build-only", action="store_true", help="compile the design but do not dispatch it (no NPU required)", ) parser.add_argument( "-n", "--size", type=int, default=SIZE, help=f"elements (default: {SIZE})" ) options = parser.parse_args() if options.size <= 0 or options.size % LINE: parser.error(f"--size must be a positive multiple of {LINE}") if options.build_only: return build_only(options.size) return build_and_run(options.size) if __name__ == "__main__": sys.exit(main()) ``` - `@iron.jit` compiles the function the first time it is called with a new compile-time value (`n`) and caches the result. - An `ObjectFifo` moves data between tiles; `.forward()` routes it through a memory tile. - The `Runtime` sequence fills the input from host memory and drains the output back. - `Program(NPU2(), rt)` targets the XDNA2 NPU and lets the placer choose shim tiles (`AnyShimTile`). - `iron.arange(..., device="npu")` and `iron.zeros_like` allocate buffers the NPU can read and write. ## Next steps - Add compute: the [MLIR-AIE programming guide]() introduces workers, kernels, and tiling. The [programming examples]() go from `passthrough_kernel` to matrix multiplication. They assume an MLIR-AIE checkout with Makefiles and XRT; with the SDK you already have the toolchain and runtime, so read the IRON design code and skip their setup. - Use tuned operators instead of writing kernels: the [IRON operators]() cover GEMM, attention, normalization, activations, and more, and one runs on the NPU in a dozen lines. - Put your kernels in a real model: [Replace Gemma 4 GEMM and dequant with IRON](). ## Limitations - The `@iron.jit` path this example uses runs an `xclbin` and an instruction stream, so its sequences cannot use `load_pdi` or `ScratchpadParameter`: that path carries no standalone PDIs, their relocations, or scratchpad metadata. An `iron.Graph` compiled to a [full ELF]() carries them. Running one needs NPU firmware 1.0.20.31 or later on Linux. On Windows it needs NPU driver 32.0.20101.3760 or later, or 32.0.203.376 or later on the 32.0.203 line; 32.0.203.329 and older refuse it. `fastflow probe` reports both versions. - NPU preemption is not supported on the HRX path. # IRON operators IRON is the operator and graph library on top of MLIR-AIE's `aie.iron`, and `fastflow-sdk` installs it with the compiler and the HRX runtime. An operator, such as `GEMM`, `RMSNorm` or `MHA`, is a class you construct by keyword. Called on device tensors, it compiles once and runs on the NPU; compiled images are cached by content under `NPU_CACHE_HOME` (default `~/.npu/cache`). A graph, a subclass of `iron.Graph`, records the steps of several operators and compiles them into one image, which is how `iron.lm` runs language models. ## Run an operator This is the first example of IRON's programming guide, [section 1](): ``` # SPDX-FileCopyrightText: Copyright (C) 2026 Advanced Micro Devices, Inc. All rights reserved. # SPDX-License-Identifier: Apache-2.0 """Section-1 example: one operator, called on its own, no graph. ``AXPY`` computes ``scalar_factor * a + b``. Construction is keyword-only and declares the shape; the first call compiles for the device, later calls with the same shape reuse that compile. Outside a graph, a call takes one device tensor per declared buffer, in order (every input, then every output). """ import argparse import aie.utils as aie_utils import numpy as np from aie.utils.verify import compare from ml_dtypes import bfloat16 from iron.operators import AXPY def main(argv=None): parser = argparse.ArgumentParser(description="Section 1: AXPY standalone") parser.add_argument("--size", type=int, default=2048) parser.add_argument("--scalar", type=float, default=1.5) args = parser.parse_args(argv) op = AXPY( size=args.size, num_aie_columns=1, tile_size=args.size, scalar_factor=args.scalar, ) rng = np.random.default_rng(0) a_np = rng.standard_normal(args.size).astype(bfloat16) b_np = rng.standard_normal(args.size).astype(bfloat16) reference = op.reference(a_np, b_np) Tensor = aie_utils.DEFAULT_TENSOR_CLASS a, b = Tensor(a_np), Tensor(b_np) y = Tensor(a_np.shape, dtype=a_np.dtype) op(a, b, y) result = y.numpy() verdict = compare(result, reference, op.resolved().tolerance()) print(f"AXPY vs. its own reference: {verdict.detail}") assert verdict, verdict.detail print("PASS!") if __name__ == "__main__": main() ``` - Construction declares the problem and touches no device. Parameters such as `size` fix the shape. Tunables such as `num_aie_columns` and `tile_size` choose how the work spreads over the array; leave them out and `op.resolved()` shows what the operator picks for your device. - A call takes one device tensor per declared buffer, in the order `op.buffers` lists them. `aie.utils.DEFAULT_TENSOR_CLASS` is the device tensor type of the host runtime: importing `aie` with `fastflow-sdk` installed selects HRX unless `NPU_RUNTIME` says otherwise. Wrap a NumPy array to upload it, or give a shape and dtype for a buffer the NPU writes. - `op.reference()` computes the expected result with NumPy, and `op.resolved().tolerance()` says how close the NPU must come. ## Compile without an NPU Bind the device before building anything, then compile. Only calling an operator needs an NPU: ``` import aie.utils as aie_utils from aie.iron.device import from_name from iron.operators import AXPY aie_utils.set_current_device(from_name("npu2", n_cols=8)) artifacts = AXPY(size=2048, scalar_factor=1.5).compile() ``` ## Go further IRON's programming guide, at the revision this SDK ships, continues from one operator to graphs and models: - [Section 0 — Getting started]() - [Section 1 — An operator on its own]() - [Section 2 — Your first graph]() - [Section 3 — Per-call values and bounds]() - [Section 4 — Weights and state]() - [Section 5 — Carried values and device loops]() - [Section 6 — The host reference and check mode]() - [Section 7 — Profiles and tunables]() - [Section 8 — From graphs to a language model]() The [IRON API reference]() documents every field of every operator, including the tunables. Agents writing or changing operators should follow IRON's [AGENTS.md](). The tables are generated from `iron/operators` at IRON `b7e8ea91eaad`, the revision this SDK ships. ## Operators | Operator | Description | Required parameters | Inputs | Outputs | Source | | --- | --- | --- | --- | --- | --- | | [`AXPY`]() | AIE-accelerated aX + Y operator. | `size` | `a`, `b` | `y` | [source]() | | [`Clamp`]() | `x` clamped to `[low, high]`, elementwise, the bounds rounded to bf16. | `size`, `low`, `high` | `x` | `y` | [source]() | | [`Copy`]() | A copy between two views, gathered by `src` and scattered by `dst`. | `input_buffer_size` | `x` | `y` | [source]() | | [`DepthwiseConv1d`]() | A causal depthwise convolution over time, five taps, channels last. | `rows`, `channels` | `x`, `weight` | `y` | [source]() | | [`ElementwiseAdd`]() | AIE-accelerated element-wise addition. | `size` | `a`, `b` | `y` | [source]() | | [`ElementwiseMul`]() | AIE-accelerated element-wise multiplication. | `size` | `a`, `b` | `y` | [source]() | | [`Emit`]() | Evaluate an emit program: the next call's scratchpad image and state. | `slots`, `carried`, `rows` | `program`, `planes` | `image`, `state` | [source]() | | [`GELU`]() | AIE-accelerated GELU. | `size` | `x` | `y` | [source]() | | [`GEMM`]() | `C = A @ B`, tiled m x k x n. | `M`, `K`, `N`, `precision` | `A`, `B` | `C` | [source]() | | [`GEMV`]() | `C = A @ B` as row-blocks of A per lane, `tile_size_input` rows per mv.cc call. | `M`, `K`, `num_matrices` | `A`, `B` | `C` | [source]() | | [`Gather`]() | `Copy(table[ids])` with `ids` per call: the rows a call names. | `rows`, `table_rows`, `row`, `words` | `table`, `control` | `y` | [source]() | | [`GatherWords`]() | A `Gather`'s control words for ids the device made, in a graph. | `rows`, `table_rows`, `row_bytes`, `words`, `pairs`, `record` | `ids` | `control` | [source]() | | [`LayerNorm`]() | AIE-accelerated Layer Normalization of each row (beta 0), optionally times a learned weight row (gamma). | `rows`, `tile_size` | `x`, `weight` | `y` | [source]() | | [`Limbs`]() | Each row of float32 as six planes of its bf16 limbs, for a float32 product by GEMM. | `rows`, `tile_size`, `line` | `x` | `y` | [source]() | | [`Log`]() | `log(x + offset)` of float32, rounded once to bf16. | `size` | `x` | `y` | [source]() | | [`MHA`]() | Fused attention over `(B_q, d)` Q, `(d, B_kv)` K and `(B_kv, d)` V blocks. | `num_heads`, `seq_pad`, `packed` | `Q`, `K`, `V` | `O` | [source]() | | [`Magnitude`]() | The magnitude of each row of complex float32 held as `[re \\| im]`. | `rows`, `tile_size`, `width` | `x` | `y` | [source]() | | [`Merge`]() | The row each position of `ids` takes from the text's embeddings and the towers' soft tokens. | `rows`, `placeholders`, `kinds` | `ids`, `before` | `merge` | [source]() | | [`PatchPositions`]() | Where each of `rows` patch rows of the vision tower comes from. | `rows`, `out_height`, `out_width` | | `xy`, `position_ids`, `order` | [source]() | | [`RMSNorm`]() | AIE-accelerated RMS Normalization of each row, optionally times a learned weight row. | `rows`, `tile_size` | `x`, `weight` | `y` | [source]() | | [`ReLU`]() | AIE-accelerated ReLU activation function. | `size` | `x` | `y` | [source]() | | [`Resample`]() | An image resized as torchvision's antialiased bicubic resize does it on the CPU. | `height`, `width`, `out_height`, `out_width` | `image`, `taps_w`, `taps_h` | `patches` | [source]() | | [`ResampleTaps`]() | The int16 filter table and precision torch resamples one axis with. | `in_size`, `out_size` | | `table` | [source]() | | [`RoPE`]() | AIE-accelerated RoPE: one core per column, each rotating rows of `cols`. | `rows`, `cols` | `x`, `angles` | `y` | [source]() | | [`RowwiseAdd`]() | Each row plus one row, `x + row`: a projection's bias. | `rows`, `tile_size` | `x`, `row` | `y` | [source]() | | [`RowwiseMul`]() | Each row times one row, `x * row`. | `rows`, `tile_size` | `x`, `row` | `y` | [source]() | | [`Sample`]() | Draw the next token from a row of logits (exact temperature/top-k). | `vocab` | `logits`, `draws`, `tokens` | `tokens`, `token` | [source]() | | [`SelectiveScan`]() | Each row `t` of `xbc` updates each head's state `(head_dim, state_size)` and reads it out. | `rows`, `heads`, `head_dim`, `state_size`, `inner`, `width`, `slice_state` | `xbc`, `dt`, `head`, `state` | `y`, `final` | [source]() | | [`SiLU`]() | AIE-accelerated SiLU activation function. | `size` | `x` | `y` | [source]() | | [`Sigmoid`]() | AIE-accelerated Sigmoid activation function. | `size` | `x` | `y` | [source]() | | [`Softmax`]() | Softmax over each row, one core per (column, channel), each taking a contiguous run of rows. | `rows`, `cols` | `x`, `addend` | `y` | [source]() | | [`Tanh`]() | AIE-accelerated Tanh activation function. | `size` | `x` | `y` | [source]() | ## FastFlowLM ports (`iron.operators.flm`) | Operator | Description | Required parameters | Inputs | Outputs | Source | | --- | --- | --- | --- | --- | --- | | [`DecodeLayer`]() | One Gemma 4 decode layer for one token, as FastFlowLM's engine drives it. | `geometry`, `layer_type`, `x_len`, `proj_len`, `rms_len`, `rope_rms_len`, `kv_len` | `x`, `proj`, `rms`, `rope_rms`, `kv` | `x`, `kv` | [source]() | | [`DequantBFP`]() | q4nx weights to bfp16, packed the way `flm.ProjectionGEMM` reads B. | `K`, `N`, `quantized_bytes`, `packed_blocks` | `qw` | `out` | [source]() | | [`LMHead`]() | Softcapped logits from a q4nx vocabulary, with the RMS norm folded in. | `dim`, `vocab`, `softcap`, `w_words`, `x_len` | `w`, `x` | `y` | [source]() | | [`PrefillAttention`]() | Causal prefill attention with a head dim of 512, from a KV cache. | `max_context`, `num_heads`, `num_kv_heads`, `head_dim`, `qo_len`, `kv_len` | `q`, `kv` | `o` | [source]() | | [`PrefillSlidingAttention`]() | Sliding-window causal prefill attention with a head dim of 256, from a KV cache. | `max_context`, `num_heads`, `num_kv_heads`, `head_dim`, `qo_len`, `kv_len` | `q`, `kv` | `o` | [source]() | | [`ProjectionGEMM`]() | AIE-accelerated bf16 GEMM on a 4-row grid, as wide as the device. | `M`, `K`, `N`, `packed_blocks`, `precision`, `b_dtype` | `A`, `B` | `C` | [source]() | # Replace Gemma 4 GEMM and dequant with IRON This example replaces only the projection GEMMs and their runtime dequantization in Gemma 4 E2B. FastFlowLM continues to run every other operator. The application source is available under [`examples/iron/gemma4_gemm_dequant`](). The example is adapted from IRON's [Gemma 4 engine](), which replaces every operator. This guide keeps the projection GEMMs and their runtime dequantization. ## Prerequisites Complete [Install the SDK]() and [Download Gemma 4 E2B]() from the full Gemma 4 example. Keep the virtual environment active and run the commands below from the FastFlow SDK repository root. If you downloaded the application source separately, set its path below to that directory instead. ## Set the build paths Linux: ``` export IRON_GEMM_DEQUANT_APP=$PWD/examples/iron/gemma4_gemm_dequant export FASTFLOW_SDK_ROOT=$(python -c \ 'import fastflow_sdk_runtime as p; print(p.package_root())') export FLM_GEMMA4_SOURCE=$(python -c \ 'import fastflow_sdk_fastflowlm as p; print(p.gemma4e_root())') export FLM_ENGINE_LIB_DIR=$(python -c \ 'import fastflow_sdk_fastflowlm as p; print(p.engine_lib_dir())') export FLM_ASSETS=$(python -c \ 'import fastflow_sdk_fastflowlm as p; print(p.xclbin_path())') export IRON_INCLUDE_DIR=$(python -c \ 'from pathlib import Path; import fastflow_sdk_compiler as p; print(Path(p.__file__).resolve().parent / "include")') export GEMM_DEQUANT_BUILD=$PWD/build/gemma4-gemm-dequant mkdir -p "$GEMM_DEQUANT_BUILD" ``` Windows: ``` $IronGemmDequantApp = Join-Path $PWD "examples\iron\gemma4_gemm_dequant" $FastFlowSdkRoot = python -c "import fastflow_sdk_runtime as p; print(p.package_root())" $FlmGemma4Source = python -c "import fastflow_sdk_fastflowlm as p; print(p.gemma4e_root())" $FlmEngineLibDir = python -c "import fastflow_sdk_fastflowlm as p; print(p.engine_lib_dir())" $FlmAssets = python -c "import fastflow_sdk_fastflowlm as p; print(p.xclbin_path())" $IronIncludeDir = python -c @' from pathlib import Path import fastflow_sdk_compiler as p print(Path(p.__file__).resolve().parent / 'include') '@ # Generated operator names require a short path on Windows. $GemmDequantBuild = Join-Path $HOME "g4gd" New-Item -ItemType Directory -Force $GemmDequantBuild | Out-Null ``` ## Compile the operators The build compiles 46 Gemma 4 GEMM and dequant configurations. It stages the replacement xclbins and instruction sequences under the build directory. Linux: ``` python "$IRON_GEMM_DEQUANT_APP/build.py" \ "$FLM_ASSETS/xclbins" "$GEMM_DEQUANT_BUILD" ``` Windows: ``` python "$IronGemmDequantApp\build.py" ` (Join-Path $FlmAssets "xclbins") $GemmDequantBuild ``` ## Build the model extension Configure the Gemma extension shipped by the FastFlowLM wheel. CMake copies the staged `Gemma4-E2B-IT-NPU2` tree, including `iron/`, into the bundle. This build also requires Rust and Cargo, as described in [Build the model extension](). Linux: ``` cmake -S "$FLM_GEMMA4_SOURCE" -B "$GEMM_DEQUANT_BUILD/engine" -G Ninja \ -DCMAKE_BUILD_TYPE=Release \ "-DFASTFLOW_SDK_ROOT=$FASTFLOW_SDK_ROOT" \ "-DFLM_ENGINE_LIB_DIR=$FLM_ENGINE_LIB_DIR" \ "-DFLM_IRON_INCLUDE_DIRS=$IRON_GEMM_DEQUANT_APP;$IRON_INCLUDE_DIR" \ -DFLM_EXTENSION_ENGINE_HEADER=overrides.hpp \ "-DFLM_GEMMA4_XCLBIN_DIR=$GEMM_DEQUANT_BUILD/xclbins/Gemma4-E2B-IT-NPU2" cmake --build "$GEMM_DEQUANT_BUILD/engine" --parallel 2 ``` Windows: ``` cmake -S $FlmGemma4Source -B "$GemmDequantBuild\engine" -G Ninja ` -DCMAKE_BUILD_TYPE=Release ` "-DFASTFLOW_SDK_ROOT=$FastFlowSdkRoot" ` "-DFLM_ENGINE_LIB_DIR=$FlmEngineLibDir" ` "-DFLM_IRON_INCLUDE_DIRS=$IronGemmDequantApp;$IronIncludeDir" ` "-DFLM_EXTENSION_ENGINE_HEADER=overrides.hpp" ` "-DFLM_GEMMA4_XCLBIN_DIR=$GemmDequantBuild\xclbins\Gemma4-E2B-IT-NPU2" cmake --build "$GemmDequantBuild\engine" --parallel 2 ``` ## Serve and verify Linux: ``` flm --model-extension "$GEMM_DEQUANT_BUILD/engine/bundle/extension.json" \ pull gemma4-open-it:e2b flm --model-extension "$GEMM_DEQUANT_BUILD/engine/bundle/extension.json" \ serve gemma4-open-it:e2b --prefill-chunk-len 512 --port 11434 ``` Windows: ``` $Extension = Join-Path $GemmDequantBuild "engine\bundle\extension.json" flm --model-extension $Extension pull gemma4-open-it:e2b flm --model-extension $Extension serve gemma4-open-it:e2b ` --prefill-chunk-len 512 --port 11434 ``` The server should report: ``` [info] IRON GEMM and dequant from .../xclbins/Gemma4-E2B-IT-NPU2/iron ``` Send the deterministic request from [the full Gemma 4 example](). The assistant response should contain `hello`. # Compile and serve the IRON Gemma 4 example This guide compiles the IRON operator overrides for Gemma 4 E2B, builds them into the `gemma4-open` model extension shipped by the SDK, and serves that plugin through FastFlowLM. The compiler, operator sources, runtime, and extension sources all come from one FastFlow SDK wheel release. Product `flm` keeps its prebuilt Gemma 4 engine. The FastFlowLM wheel also ships a prebuilt stock `gemma4-open` extension, without IRON overrides, built from the same sources. To serve it without building anything, pass its manifest to `flm`: ``` flm --model-extension "$(python -c \ 'import fastflow_sdk_fastflowlm as p; print(p.model_extension("gemma4-open"))')" \ serve gemma4-open-it:e2b ``` For a smaller example that replaces only projection GEMMs and runtime dequantization, see [Replace Gemma 4 GEMM and dequant with IRON](). The example targets Linux or Windows, Python 3.12, and an XDNA2 (NPU2) device. Compilation does not use the NPU, but serving and inference do. On Ubuntu, install the host build dependencies: ``` sudo apt-get update sudo apt-get install -y cmake g++ libdrm-dev ninja-build ``` On Windows, install CMake, Ninja, and Visual Studio 2022, then use an x64 Developer PowerShell so CMake can find MSVC. ## Install the SDK Install the latest [FastFlow SDK release](). The `fastflow-sdk` wheel contains the matching compiler, operators, runtime, and FastFlowLM. Linux: ``` python3.12 -m venv .venv source .venv/bin/activate python -m pip install fastflow-sdk ``` Windows: ``` py -3.12 -m venv .venv . .\.venv\Scripts\Activate.ps1 python -m pip install fastflow-sdk ``` On Windows, also set `CXX`. IRON compiles a small host dispatch library with the compiler named by `CXX`, or else `c++`, `g++`, or `clang++` on `PATH`. It does not find the MSVC `cl` that the Developer PowerShell provides on its own: ``` $env:CXX = "cl" ``` Keep this environment active for every command in the guide. Check the runtime and device before starting the larger compilation: ``` fastflow version fastflow doctor ``` ## Download Gemma 4 E2B `build.py` reads the model configuration and weights from `$FLM_MODEL_PATH/models/Gemma4-E2B-IT-NPU2`, so pull the built-in `gemma4-it:e2b` model first. `FLM_MODEL_PATH` is the directory above the `models` directory that FastFlowLM creates. Pulling requires network access to the model host. If the model is already cached elsewhere, point `FLM_MODEL_PATH` at that cache instead and skip the pull. The open catalog entry `gemma4-open-it:e2b` is pulled later, after the extension exists, because it is not in the built-in model list. Linux: ``` export FLM_MODEL_PATH=$HOME/.cache/fastflowlm mkdir -p "$FLM_MODEL_PATH" flm pull gemma4-it:e2b ``` Windows: ``` $env:FLM_MODEL_PATH = Join-Path $HOME ".cache\fastflowlm" New-Item -ItemType Directory -Force $env:FLM_MODEL_PATH | Out-Null flm pull gemma4-it:e2b ``` ## Select the IRON application source The operator wheel contains the release-matched Gemma application source. Use it by default. The [upstream application source]() is also available for browsing and development. Linux: ``` export IRON_GEMMA4_APP=$(python -c \ 'from pathlib import Path; import iron; print(Path(iron.__file__).resolve().parent / "operators/flm/gemma4_engine")') ``` Windows: ``` $IronGemma4App = python -c @' from pathlib import Path import iron print(Path(iron.__file__).resolve().parent / 'operators/flm/gemma4_engine') '@ ``` To modify or replace the example, point the application path at your own source directory. It should contain `build.py`, `overrides.hpp`, and any local helper files. The SDK installation supplies the IRON Python APIs and compiler, so a separate IRON checkout is not required. Linux: ``` export IRON_GEMMA4_APP=/path/to/application ``` Windows: ``` $IronGemma4App = "C:\path\to\application" ``` The packaged source is tested with its SDK release. User-provided sources must remain compatible with that release's compiler and runtime interfaces. ## Set the build paths The wheels expose the packaged FastFlowLM source and runtime paths through Python. The generated IRON sequence headers also need the compiler wheel's C++ headers. These paths do not change when using your own application sources; only the application path selected above changes. Linux: ``` export FASTFLOW_SDK_ROOT=$(python -c \ 'import fastflow_sdk_runtime as p; print(p.package_root())') export FLM_GEMMA4_SOURCE=$(python -c \ 'import fastflow_sdk_fastflowlm as p; print(p.gemma4e_root())') export FLM_ENGINE_LIB_DIR=$(python -c \ 'import fastflow_sdk_fastflowlm as p; print(p.engine_lib_dir())') export FLM_ASSETS=$(python -c \ 'import fastflow_sdk_fastflowlm as p; print(p.xclbin_path())') export IRON_INCLUDE_DIR=$(python -c \ 'from pathlib import Path; import fastflow_sdk_compiler as p; print(Path(p.__file__).resolve().parent / "include")') export GEMMA4_BUILD=$PWD/build/gemma4-iron mkdir -p "$GEMMA4_BUILD" ``` Windows: ``` $FastFlowSdkRoot = python -c "import fastflow_sdk_runtime as p; print(p.package_root())" $FlmGemma4Source = python -c "import fastflow_sdk_fastflowlm as p; print(p.gemma4e_root())" $FlmEngineLibDir = python -c "import fastflow_sdk_fastflowlm as p; print(p.engine_lib_dir())" $FlmAssets = python -c "import fastflow_sdk_fastflowlm as p; print(p.xclbin_path())" $IronIncludeDir = python -c @' from pathlib import Path import fastflow_sdk_compiler as p print(Path(p.__file__).resolve().parent / 'include') '@ # Keep this path short: generated operator names can exceed Windows path limits. $Gemma4Build = Join-Path $HOME "g4sdk" New-Item -ItemType Directory -Force $Gemma4Build | Out-Null ``` ## Compile the IRON operators `build.py` compiles 59 operator configurations for the Gemma 4 E2B text path. It stages replacement xclbins, instruction sequences, repacked weights, and generated C++ sequence builders under the build directory. The command can take several minutes. Linux: ``` ( cd "$IRON_GEMMA4_APP" python build.py --engine-xclbins "$FLM_ASSETS/xclbins" --out "$GEMMA4_BUILD" ) ``` Windows: ``` Push-Location $IronGemma4App try { python build.py --engine-xclbins (Join-Path $FlmAssets "xclbins") --out $Gemma4Build } finally { Pop-Location } ``` A successful build ends with a message like: ``` staged .../xclbins/Gemma4-E2B-IT-NPU2 ``` ## Build the model extension Configure the Gemma extension shipped by the FastFlowLM wheel against the installed runtime, the application override header, the generated sequence headers, and the xclbin tree `build.py` just staged. CMake copies that tree, including `iron/`, into the bundle. `flm` loads it from there. This step also requires Rust and Cargo on both platforms. Install them with [rustup](), using the `x86_64-pc-windows-msvc` toolchain on Windows. Ensure `rustc` and `cargo` are on `PATH` in the shell running CMake (the x64 Developer PowerShell on Windows). Cargo needs network access to download dependencies that are not already cached. Linux: ``` cmake -S "$FLM_GEMMA4_SOURCE" -B "$GEMMA4_BUILD/engine" -G Ninja \ -DCMAKE_BUILD_TYPE=Release \ "-DFASTFLOW_SDK_ROOT=$FASTFLOW_SDK_ROOT" \ "-DFLM_ENGINE_LIB_DIR=$FLM_ENGINE_LIB_DIR" \ "-DFLM_IRON_INCLUDE_DIRS=$IRON_GEMMA4_APP;$GEMMA4_BUILD/gen;$IRON_INCLUDE_DIR" \ -DFLM_EXTENSION_ENGINE_HEADER=overrides.hpp \ "-DFLM_GEMMA4_XCLBIN_DIR=$GEMMA4_BUILD/xclbins/Gemma4-E2B-IT-NPU2" cmake --build "$GEMMA4_BUILD/engine" --parallel 2 ``` Windows: ``` cmake -S $FlmGemma4Source -B "$Gemma4Build\engine" -G Ninja ` -DCMAKE_BUILD_TYPE=Release ` "-DFASTFLOW_SDK_ROOT=$FastFlowSdkRoot" ` "-DFLM_ENGINE_LIB_DIR=$FlmEngineLibDir" ` "-DFLM_IRON_INCLUDE_DIRS=$IronGemma4App;$Gemma4Build\gen;$IronIncludeDir" ` "-DFLM_EXTENSION_ENGINE_HEADER=overrides.hpp" ` "-DFLM_GEMMA4_XCLBIN_DIR=$Gemma4Build\xclbins\Gemma4-E2B-IT-NPU2" cmake --build "$Gemma4Build\engine" --parallel 2 ``` The extension bundle is: - Linux: `$GEMMA4_BUILD/engine/bundle/extension.json` - Windows: `$Gemma4Build\engine\bundle\extension.json` ## Serve and verify the result Pull and serve `gemma4-open-it:e2b` through that bundle. The plugin carries its own engine and the staged xclbins, so the loader path and `FLM_XCLBIN_PATH` stay unchanged. Linux: ``` flm --model-extension "$GEMMA4_BUILD/engine/bundle/extension.json" \ pull gemma4-open-it:e2b flm --model-extension "$GEMMA4_BUILD/engine/bundle/extension.json" \ serve gemma4-open-it:e2b --prefill-chunk-len 512 --port 11434 ``` Windows: ``` $Extension = Join-Path $Gemma4Build "engine\bundle\extension.json" flm --model-extension $Extension pull gemma4-open-it:e2b flm --model-extension $Extension serve gemma4-open-it:e2b ` --prefill-chunk-len 512 --port 11434 ``` The server log should identify the staged IRON instruction sequences: ``` [info] IRON operators from .../xclbins/Gemma4-E2B-IT-NPU2/iron ``` From another terminal, send a deterministic chat request. Linux: ``` curl -fsS http://127.0.0.1:11434/api/chat \ -H 'Content-Type: application/json' \ -d '{ "model": "gemma4-open-it:e2b", "stream": false, "temperature": 0, "top_k": 1, "messages": [ {"role": "user", "content": "Reply with only the word hello."} ], "options": {"num_predict": 8} }' ``` Windows: ``` $Body = @{ model = "gemma4-open-it:e2b" stream = $false temperature = 0 top_k = 1 messages = @( @{ role = "user"; content = "Reply with only the word hello." } ) options = @{ num_predict = 8 } } | ConvertTo-Json -Depth 4 Invoke-RestMethod -Uri "http://127.0.0.1:11434/api/chat" ` -Method Post -ContentType "application/json" -Body $Body ``` The response should contain an assistant message with `hello`. Stop the server with `Ctrl-C`. # Reference # `fastflow` CLI reference `fastflow` is the native runtime CLI in every FastFlow SDK release: the `fastflow-sdk` wheels put it on `PATH`, and the standalone archives ship it as `bin/fastflow`. It needs no Python. This page is generated from the CLI's source; [Runtime CLI behavior]() explains what each command does and does not change on the system. ## Help ``` Usage: fastflow [global-options] [global-options] Commands: version Report product, build, manifest, and HRX library information probe Collect platform, driver, firmware, device, and HRX facts powermode [mode] Report or set NPU power mode doctor Evaluate package, runtime, and device health self-test Dispatch the packaged bounded deterministic XADX test plugin list Discover external fastflow-* plugin executables without running them Execute the external fastflow- plugin Global options: --json Emit exactly one JSON report to stdout --runtime Use an explicit HRX library file or directory --verbose Include additional diagnostics --help, -h Show this help Power modes: default, powersaver, balanced, performance, turbo ``` ## Commands | Command | Description | Checks in its report | | --- | --- | --- | | `fastflow version` | Report product, build, manifest, and HRX library information | none | | `fastflow probe` | Collect platform, driver, firmware, device, and HRX facts | [`device.enumeration`]() | | `fastflow powermode [mode]` | Report or set NPU power mode | [`powermode.arguments`](), [`powermode.support`](), [`powermode.device_present`](), [`powermode.query`](), [`powermode.set`]() | | `fastflow doctor` | Evaluate package, runtime, and device health | [`package.manifest`](), [`device.enumeration`](), [`device.present`](), [`device.access`](), [`device.ioctl`](), [`runtime.library.present`](), [`runtime.library.load`](), [`runtime.symbols`](), [`runtime.abi`](), [`runtime.initialize`](), [`runtime.device_count`](), [`runtime.shutdown`]() | | `fastflow self-test` | Dispatch the packaged bounded deterministic XADX test | [`package.manifest`](), [`device.enumeration`](), [`device.present`](), [`device.access`](), [`device.ioctl`](), [`runtime.library.present`](), [`runtime.library.load`](), [`runtime.symbols`](), [`runtime.abi`](), [`runtime.initialize`](), [`runtime.device_count`](), [`runtime.shutdown`](), [`self_test.prerequisites`](), [`self_test.fixture`](), [`self_test.load`](), [`self_test.dispatch`](), [`self_test.cleanup`](), [`self_test.output`]() | | `fastflow plugin list` | Discover external fastflow-\* plugin executables without running them | [`plugin.discovery`]() | Every command can also report [`invocation.arguments`](), [`internal.error`](), [`plugin.dispatch`](). ## Exit status | Status | Meaning | | --- | --- | | `0` | The command completed and every required check passed. | | `1` | A health check or the self-test failed. | | `2` | Invalid input or an internal execution error. | ## Machine-readable output For a built-in command, `fastflow --json ` writes exactly one JSON report to standard output, with `schema_version`, `command`, `status`, `product`, `checks`, and, when the command has any, `data`. Invalid arguments also produce a report. `--help` prints the usage text even with `--json`. An external plugin writes its own output and sets the exit status; `fastflow` reports only when it cannot start one (`plugin.dispatch`). Parse the report instead of the human output; the [JSON contract]() defines it. For each check whose `status` is not `pass`, look up its `id` in [Troubleshooting](). ``` fastflow doctor --json ``` # Troubleshooting Start with the CLI. It reports every problem it finds as a check with a stable ID: ``` fastflow doctor --json # package, driver, device, and runtime health fastflow self-test --json # doctor, then a real dispatch on the NPU ``` Find each check whose `status` is `fail` or `error` below. After installing or changing an NPU driver, reboot before you debug further: a driver switch without a reboot can leave the device unhealthy even though the operating system reports the new driver. | Check | What it verifies | | --- | --- | | [`invocation.arguments`](<#invocation-arguments>) | The command line parsed: a known command, valid options, and valid arguments. | | [`internal.error`](<#internal-error>) | The command ran to completion without an unhandled error. | | [`package.manifest`](<#package-manifest>) | The installed product manifest exists, its version matches the `fastflow` executable, and every declared file matches its size and SHA-256. | | [`device.enumeration`](<#device-enumeration>) | Windows only: the operating system's device enumeration API answered. | | [`device.present`](<#device-present>) | At least one AMD NPU is visible to the operating system. | | [`device.access`](<#device-access>) | The current user can open at least one NPU device read/write. | | [`device.ioctl`](<#device-ioctl>) | Linux only: an opened NPU answered the diagnostic ioctls (DRM version, firmware version, AIE metadata, power mode). | | [`runtime.library.present`](<#runtime-library-present>) | An HRX runtime library file exists at one of the candidate paths. | | [`runtime.library.load`](<#runtime-library-load>) | The HRX runtime library loaded into the process. | | [`runtime.symbols`](<#runtime-symbols>) | Every public HRX C symbol the CLI needs resolved in the loaded library. | | [`runtime.abi`](<#runtime-abi>) | The loaded HRX runtime's major and minor ABI version match the headers the CLI was built with. | | [`runtime.initialize`](<#runtime-initialize>) | HRX initialized. | | [`runtime.device_count`](<#runtime-device-count>) | HRX reports one or more NPU devices. | | [`runtime.shutdown`](<#runtime-shutdown>) | HRX shut down cleanly after the doctor checks. | | [`self_test.prerequisites`](<#self-test-prerequisites>) | Every doctor check passed, so the self-test can dispatch. | | [`self_test.fixture`](<#self-test-fixture>) | The device is NPU2 and the packaged self-test fixture is intact and matches its provenance hashes. | | [`self_test.load`](<#self-test-load>) | The self-test could read its XADX and load the HRX runtime. | | [`self_test.dispatch`](<#self-test-dispatch>) | The packaged XADX loaded on the device and its dispatch completed. | | [`self_test.cleanup`](<#self-test-cleanup>) | Every buffer, executable, and device the self-test created was released. | | [`self_test.output`](<#self-test-output>) | The output bytes match the packaged golden result exactly. | | [`powermode.arguments`](<#powermode-arguments>) | The requested power mode is one of default, powersaver, balanced, performance, or turbo. | | [`powermode.support`](<#powermode-support>) | The platform's power-mode backend is available. | | [`powermode.device_present`](<#powermode-device-present>) | At least one NPU was found to query or set. | | [`powermode.query`](<#powermode-query>) | Every detected NPU reported its current power mode. | | [`powermode.set`](<#powermode-set>) | Every detected NPU reached the requested mode, confirmed by a second query. | | [`plugin.discovery`](<#plugin-discovery>) | Plugin discovery finished; the message gives the number of `fastflow-*` executables found. | | [`plugin.dispatch`](<#plugin-dispatch>) | An external `fastflow-` plugin was found and started. | ## `invocation.arguments` The command line parsed: a known command, valid options, and valid arguments. Reported by: any command. Run `fastflow --help` for the accepted commands and options. Global options (`--json`, `--runtime `, `--verbose`) can come before or after the command. `plugin` accepts only `list`, `powermode` accepts at most one mode, and the other built-in commands take no positional arguments. Exit status is 2. ## `internal.error` The command ran to completion without an unhandled error. Reported by: any command. The message carries the error text. Rerun with `--verbose --json` and file an issue with the full report. ## `package.manifest` The installed product manifest exists, its version matches the `fastflow` executable, and every declared file matches its size and SHA-256. Reported by: `fastflow doctor`, `fastflow self-test`. A missing manifest or a mismatch means the install is incomplete, modified, or mixes files from different releases. Reinstall one release into a clean environment, for example `python -m pip install "fastflow-sdk=="` (for a development build, add `--only-binary=:all: --extra-index-url https://rocm.github.io/FastFlow-SDK/simple`), or use a freshly extracted archive. Do not copy `fastflow` between installs. ## `device.enumeration` Windows only: the operating system's device enumeration API answered. Reported by: `fastflow probe`, `fastflow doctor`, `fastflow self-test`. `SetupDiGetClassDevsW` or `SetupDiEnumDeviceInfo` failed, so no device facts could be read. The details carry the Windows error code. Run from a normal (non-sandboxed) PowerShell session and retry. If it persists, reboot. ## `device.present` At least one AMD NPU is visible to the operating system. Reported by: `fastflow doctor`, `fastflow self-test`. On Linux, no `amdxdna` accelerator node exists under sysfs: check that the `amdxdna` kernel module is loaded (`lsmod | grep amdxdna`) and that `dmesg` shows it probing the NPU. On Windows, check that the NPU appears in Device Manager with the AMD NPU driver installed. The NPU can also be disabled in firmware setup. See [Hardware and drivers]() for the drivers each release was qualified on. ## `device.access` The current user can open at least one NPU device read/write. Reported by: `fastflow doctor`, `fastflow self-test`. On Linux, the `/dev/accel/accel` node exists but cannot be opened, or does not match its sysfs entry. The device's `access_error` in `fastflow probe --json` gives the reason. For a permission error, check the node's group with `ls -l /dev/accel/` and add your user to that group, then log in again. On Windows, update the NPU driver and reboot. ## `device.ioctl` Linux only: an opened NPU answered the diagnostic ioctls (DRM version, firmware version, AIE metadata, power mode). Reported by: `fastflow doctor`, `fastflow self-test`. The check passes when the device is usable even if some optional diagnostic ioctls are unavailable; `details.diagnostics_complete` says which case applies. It fails only when no accessible device accepted ioctls: update the `amdxdna` driver, then reboot. ## `runtime.library.present` An HRX runtime library file exists at one of the candidate paths. Reported by: `fastflow doctor`, `fastflow self-test`. The loader tries `--runtime`, then `HRX_LIBHRX`, then the packaged path next to the executable (`lib/libhrx.so.0` on Linux, `bin/hrx.dll` on Windows), then the system library path. `fastflow probe --json` lists the candidates under `data.runtime.candidates`. Reinstall the release, or point `--runtime` or `HRX_LIBHRX` at an existing library. ## `runtime.library.load` The HRX runtime library loaded into the process. Reported by: `fastflow doctor`, `fastflow self-test`. `details.errors` has the loader's error for each candidate. Common causes are a missing dependency of the library, an architecture mismatch, or a stale `HRX_LIBHRX` pointing at another build. Unset `HRX_LIBHRX` to use the packaged runtime. An explicit `--runtime` is authoritative; the CLI does not fall back to another candidate. ## `runtime.symbols` Every public HRX C symbol the CLI needs resolved in the loaded library. Reported by: `fastflow doctor`, `fastflow self-test`. `details.missing` lists the absent symbols. The loaded library is from a different HRX build than this CLI. Use the runtime that ships with the same release. ## `runtime.abi` The loaded HRX runtime's major and minor ABI version match the headers the CLI was built with. Reported by: `fastflow doctor`, `fastflow self-test`. `details.required` and `details.actual` show both versions. Install the CLI and runtime from the same release, or remove an `HRX_LIBHRX` or `--runtime` override that selects another HRX. ## `runtime.initialize` HRX initialized. Reported by: `fastflow doctor`, `fastflow self-test`. The message carries the HRX status. A failing `device.*` check in the same report usually explains it; fix that first. After a driver install or change, reboot and rerun `fastflow doctor`. ## `runtime.device_count` HRX reports one or more NPU devices. Reported by: `fastflow doctor`, `fastflow self-test`. The OS sees an NPU but HRX does not. Check that the driver is one this release was qualified on ([Hardware and drivers]()); then reboot and rerun `fastflow doctor`. ## `runtime.shutdown` HRX shut down cleanly after the doctor checks. Reported by: `fastflow doctor`, `fastflow self-test`. The message carries the HRX status. Rerun `fastflow doctor`. If it repeats, file an issue with `fastflow doctor --json --verbose` output. ## `self_test.prerequisites` Every doctor check passed, so the self-test can dispatch. Reported by: `fastflow self-test`. Fix the failing checks reported by `fastflow doctor` first. ## `self_test.fixture` The device is NPU2 and the packaged self-test fixture is intact and matches its provenance hashes. Reported by: `fastflow self-test`. The packaged fixture targets NPU2 (XDNA2). On NPU1, `probe` and `doctor` still apply but no self-test fixture ships. On NPU2, a fixture error means the files under `share/fastflow-sdk/self-test` are damaged or from another release: reinstall. ## `self_test.load` The self-test could read its XADX and load the HRX runtime. Reported by: `fastflow self-test`. Reinstall when `kernel.xadx` is missing or empty. If HRX could not be loaded, follow the `runtime.library.load` guidance. ## `self_test.dispatch` The packaged XADX loaded on the device and its dispatch completed. Reported by: `fastflow self-test`. The message names the failing HRX operation. After installing or changing a driver, reboot and retry: a package switch without a reboot can leave the device unhealthy even though the OS reports the new driver. If it persists, compare the driver with the qualified list in [Hardware and drivers](). ## `self_test.cleanup` Every buffer, executable, and device the self-test created was released. Reported by: `fastflow self-test`. The details list the release errors. Rerun `fastflow self-test`; if it repeats, reboot and file an issue with `fastflow self-test --json --verbose` output. ## `self_test.output` The output bytes match the packaged golden result exactly. Reported by: `fastflow self-test`. The dispatch ran but produced wrong data. Reboot and rerun. A repeat failure on a qualified driver is a bug: file an issue with `fastflow self-test --json --verbose` and `fastflow probe --json` output. ## `powermode.arguments` The requested power mode is one of default, powersaver, balanced, performance, or turbo. Reported by: `fastflow powermode`. Use one of `default`, `powersaver`, `balanced`, `performance`, `turbo`. ## `powermode.support` The platform's power-mode backend is available. Reported by: `fastflow powermode`. On Windows this needs the native KMT interface of the AMD NPU driver; update the driver. The details carry the enumeration error. ## `powermode.device_present` At least one NPU was found to query or set. Reported by: `fastflow powermode`. Follow the `device.present` guidance. ## `powermode.query` Every detected NPU reported its current power mode. Reported by: `fastflow powermode`. Follow the `device.access` guidance, then retry. ## `powermode.set` Every detected NPU reached the requested mode, confirmed by a second query. Reported by: `fastflow powermode`. Setting the power mode can need elevated privileges. On Linux the current `amdxdna` driver requires root, so run `sudo fastflow powermode `. On Windows, run from an elevated PowerShell. ## `plugin.discovery` Plugin discovery finished; the message gives the number of `fastflow-*` executables found. Reported by: `fastflow plugin`. This check always passes. If an expected plugin is missing, put its directory on `FASTFLOW_SDK_PLUGIN_PATH` or `PATH`; `data.search_paths` shows where the CLI looked. ## `plugin.dispatch` An external `fastflow-` plugin was found and started. Reported by: any command. `fastflow ` runs the `fastflow-` executable from `FASTFLOW_SDK_PLUGIN_PATH`, the CLI's directory, or `PATH`. Run `fastflow plugin list` to see what was found. `fastflow qualify` needs the `fastflow-sdk-qualification` package. # Native FastFlow SDK runtime CLI `fastflow` provides runtime discovery, health checks, NPU power-mode configuration, and a bounded device self-test on Linux and Windows. The executable is C++17 and does not require Python. HRX is loaded only when a command needs it. ## Commands and exit status - `fastflow version` reports build identity, package-manifest identity, and HRX discovery without initializing HRX or requiring hardware. - `fastflow probe` reports operating-system, driver, firmware, device, and HRX facts without applying product-support policy. It reports the current NPU power mode when the platform supports it. - `fastflow powermode` reports the current NPU power mode for detected NPUs. - `fastflow powermode ` sets the NPU power mode and then re-queries the device to confirm the requested mode. - `fastflow doctor` evaluates package, HRX, and device health. Release package manifests verify every declared file's size and SHA-256 digest. It initializes and shuts down HRX but does not dispatch an executable. - `fastflow self-test` runs doctor checks and then dispatches the packaged NPU2 integer XADX fixture. NPU1 devices remain supported by probe and doctor, but self-test reports that no validated NPU1 fixture is provided. Optional diagnostic ioctl failures do not prevent this authoritative HRX dispatch test. Output bytes are compared exactly. - `fastflow plugin list` discovers `fastflow-*` executables from `FASTFLOW_SDK_PLUGIN_PATH`, the CLI directory, and `PATH`. It does not execute plugin code. Exit status `0` means the command completed and required checks passed, `1` means a health check or test failed, and `2` means invalid input or an internal execution error. Global options may precede or follow the command: ``` --json --runtime --verbose --help ``` The [versioned JSON contract]() is intended for automation. Human output is informational and is not a stable parsing surface. ## Non-mutating behavior Probe, doctor, and `powermode` without a mode never create device nodes, change device permissions, modify drivers or firmware, alter process/system limits, or change NPU power mode. They only inspect existing package, runtime, driver, firmware, and device state. `fastflow powermode ` reports success only when a subsequent query confirms every reported NPU reached the requested mode. Some host drivers require elevated privileges to set power mode; permission failures are reported as command failures. Non-mutating power-mode reporting remains usable when the platform permits device access. ## HRX discovery Without an explicit override, the loader tries: 1. `HRX_LIBHRX` 2. the packaged path relative to the executable 3. the normal operating-system library search path `--runtime` is authoritative: if that candidate cannot be loaded or is incompatible, the command reports the failure instead of silently selecting a different runtime. It may name the library or its containing directory. The packaged layouts are `bin/fastflow` plus `lib/libhrx.so.0` on Linux and `bin/fastflow.exe` plus `bin/hrx.dll` on Windows. Missing required public C symbols are reported individually. The loader also requires the runtime's HRX major and minor ABI version to match the headers used to build the CLI. ## Packaging The runtime wheel contains a small Python console launcher that locates and executes the packaged native binary and returns its exit status. `python -m fastflow_sdk_runtime` uses the same path. Native ZIP installations run `bin/fastflow[.exe]` directly and require no Python installation. The self-test fixture is immutable product data under `share/fastflow-sdk/self-test`. The XADX is checked in because the runtime CLI must self-test without a compiler or Python installation; deterministic input and expected output bytes are generated from the manifest. Updating the XADX or generated buffer contract requires a deliberate compiler/runtime compatibility review and updated producer provenance. Before dispatch, the CLI validates every fixture hash, buffer dtype/shape/size, dispatch geometry, and the loaded export metadata against the manifest. Legacy XADX files that do not carry a reliable export binding count record that field as `null`; the CLI still validates buffer count, order, dtype, shape, and byte length from the fixture descriptors. External commands are resolved through the versioned executable plugin contract in `docs/contracts/plugin-api-v1.md`. The optional `fastflow-sdk-qualification` wheel provides `fastflow qualify`; see `docs/qualification.md`. # Hardware and drivers FastFlow SDK targets x86\_64 Linux and Windows machines with an AMD Ryzen AI NPU that implements XDNA2 (NPU2): Strix Point, Strix Halo, Krackan Point, and Gorgon Point. Windows means native PowerShell; WSL is not supported. NPU1 (Phoenix, Hawk Point) devices are reported by `fastflow probe` and `fastflow doctor`, but releases are not qualified on them. Check a machine with: ``` fastflow probe --json # OS, driver, firmware, devices, power mode fastflow self-test # a real dispatch on the NPU ``` After installing or changing a driver, run `fastflow self-test`. If it fails, reboot and retry before debugging further. ## Qualified systems for 0.1.0 This is the qualification summary published with [the release](). Other driver versions may work but were not validated. The release includes one candidate-bound aggregate containing 46 passing NPU2 runs: 23 extended runs and 23 fast runs across a full Windows driver matrix and Linux. Windows evidence sweeps the qualified AMD XDNA driver versions per silicon (Strix Point x6, Strix Halo x5 plus a second host on 32.0.20102.3930, Krackan Point x1, Gorgon Point x3 — every driver run fast + extended, 32 Windows cells total); Linux hosts run once on their active driver. | System | OS | NPU | Driver / KMD | Firmware evidence | Passing profiles | | --- | --- | --- | --- | --- | --- | | Strix Point | Windows 10.0.26100 | NPU2, PCI revision 0x10 | AMD XDNA 32.0.20101.3760 | Package candidates 1.1.2.73 / 1.1.2.64 / 1.1.2.65 / 1.5.5.391\* | extended (96/96), fast (69/69) | | Strix Point | Windows 10.0.26100 | NPU2, PCI revision 0x10 | AMD XDNA 32.0.20102.3930 | Package candidates 1.1.2.73 / 1.1.2.64 / 1.1.2.65 / 1.5.5.391\* | extended (96/96), fast (69/69) | | Strix Point | Windows 10.0.26100 | NPU2, PCI revision 0x10 | AMD XDNA 32.0.203.240 | Package candidates 1.0.0.256 / 1.0.0.63 / 1.0.0.166 / 1.5.2.380\* | extended (96/96), fast (69/69) | | Strix Point | Windows 10.0.26100 | NPU2, PCI revision 0x10 | AMD XDNA 32.0.203.280 | Package candidates 1.0.18.5 / 1.0.18.3 / 1.0.18.4 / 1.5.5.391\* | extended (96/96), fast (69/69) | | Strix Point | Windows 10.0.26100 | NPU2, PCI revision 0x10 | AMD XDNA 32.0.203.314 | Package candidates 1.0.21.51 / 1.0.21.43 / 1.0.21.44 / 1.5.5.391\* | extended (96/96), fast (69/69) | | Strix Point | Windows 10.0.26100 | NPU2, PCI revision 0x10 | AMD XDNA 32.0.203.329 | Package candidates 1.0.21.51 / 1.0.21.43 / 1.0.21.44 / 1.5.5.391\* | extended (96/96), fast (69/69) | | Strix Halo | Windows 10.0.26200 | NPU2, PCI revision 0x11 | AMD XDNA 32.0.20101.3760 | Package candidates 1.1.2.73 / 1.1.2.64 / 1.1.2.65 / 1.5.5.391\* | extended (96/96), fast (69/69) | | Strix Halo | Windows 10.0.26200 | NPU2, PCI revision 0x11 | AMD XDNA 32.0.20102.3930 | Package candidates 1.1.2.73 / 1.1.2.64 / 1.1.2.65 / 1.5.5.391\* | extended (96/96), fast (69/69) | | Strix Halo | Windows 10.0.26100 | NPU2, PCI revision 0x11 | AMD XDNA 32.0.20102.3930 | Package candidates 1.1.2.73 / 1.1.2.64 / 1.1.2.65 / 1.5.5.391\* | extended (96/96), fast (69/69) | | Strix Halo | Windows 10.0.26200 | NPU2, PCI revision 0x11 | AMD XDNA 32.0.20102.4480 | Package candidates 1.1.2.73 / 1.1.2.64 / 1.1.2.65 / 1.5.5.391\* | extended (96/96), fast (69/69) | | Strix Halo | Windows 10.0.26200 | NPU2, PCI revision 0x11 | AMD XDNA 32.0.203.314 | Package candidates 1.0.21.51 / 1.0.21.43 / 1.0.21.44 / 1.5.5.391\* | extended (96/96), fast (69/69) | | Strix Halo | Windows 10.0.26200 | NPU2, PCI revision 0x11 | AMD XDNA 32.0.203.329 | Package candidates 1.0.21.51 / 1.0.21.43 / 1.0.21.44 / 1.5.5.391\* | extended (96/96), fast (69/69) | | Krackan Point | Windows 10.0.26100 | NPU2, PCI revision 0x20 | AMD XDNA 32.0.20102.4480 | Package candidates 1.1.2.73 / 1.1.2.64 / 1.1.2.65 / 1.5.5.391\* | extended (96/96), fast (69/69) | | Gorgon Point | Windows 10.0.26100 | NPU2, PCI revision 0x10 | AMD XDNA 32.0.20102.3930 | Package candidates 1.1.2.73 / 1.1.2.64 / 1.1.2.65 / 1.5.5.391\* | extended (96/96), fast (69/69) | | Gorgon Point | Windows 10.0.26100 | NPU2, PCI revision 0x10 | AMD XDNA 32.0.20102.4480 | Package candidates 1.1.2.73 / 1.1.2.64 / 1.1.2.65 / 1.5.5.391\* | extended (96/96), fast (69/69) | | Gorgon Point | Windows 10.0.26100 | NPU2, PCI revision 0x10 | AMD XDNA 32.0.203.329 | Package candidates 1.0.21.51 / 1.0.21.43 / 1.0.21.44 / 1.5.5.391\* | extended (96/96), fast (69/69) | | Strix Point | Linux 7.3.0-rc4-perfopt+ | NPU Strix, revision 0x10 | amdxdna source 88D618CB80FFA90B940034B | Loaded firmware 1.1.2.64 | extended (95/96), fast (68/69) | | Strix Halo | Linux 7.0.0-30-generic | RyzenAI-npu5, revision 0x11 | amdxdna source E4FC5AFFF53D21BC6AFDAE3 | Loaded firmware 1.1.2.65 | extended (95/96), fast (68/69) | | Strix Halo | Linux 7.0.0-34-generic | RyzenAI-npu5, revision 0x11 | amdxdna source 4612EC552523E4C8FB4B5E5 | Loaded firmware 1.1.2.65 | extended (95/96), fast (68/69) | | Strix Halo | Linux 6.14.0-1018-oem | NPU Strix Halo, revision 0x11 | amdxdna source EB10BAAFFA174A6D602FA28 | Loaded firmware 255.0.11.71 | extended (95/96), fast (68/69) | | Krackan Point | Linux 7.0.0-34-generic | RyzenAI-npu6, revision 0x20 | amdxdna source 4612EC552523E4C8FB4B5E5 | Loaded firmware 1.1.2.64 | extended (95/96), fast (68/69) | | Krackan Point | Linux 7.2.10 | NPU Krackan 1, revision 0x20 | amdxdna source CEAE025A317872A9A6B3FC8 | Loaded firmware 1.1.2.64 | extended (95/96), fast (68/69) | | Gorgon Point | Linux 7.1.0-070100rc7-generic | RyzenAI-npu4, revision 0x10 | amdxdna source 30045E35896E6BCDE3AF13F | Loaded firmware 1.1.2.64 | extended (95/96), fast (68/69) | \*Windows evidence inventories the firmware images shipped in the active driver package. The Windows probe cannot prove which image the KMD loaded. Linux evidence reports the firmware version returned by the device. Linux runs report `powermode-roundtrip` as unsupported, so their passing totals are 95 and 68. Windows includes that case, so its totals are 96 and 69. The packaged release policy (at least one Windows fast run and one Linux fast run on npu2) is satisfied by 16 Windows fast runs and 7 Linux fast runs. Candidate manifest SHA-256: `2b23e5c32663c730ba8a3e500ae98e7abc4de0cce8f1d32caf7bc5e522f06d33` Aggregate evidence SHA-256: `0fc07be362489d5b85e6b9fa6c7093f8c428360305713d82820e6c32ac38d1ad` Install the qualification tooling only if you want to verify the evidence: ``` python -m pip install --find-links . fastflow-sdk-qualification==0.1.0 ``` Verify the aggregate after downloading its ZIP, checksum, index, and candidate manifest: ``` fastflow qualify verify --input qualification-evidence-0.1.0.zip --candidate-manifest candidate-manifest.json --json ``` # Component versions This site documents FastFlow SDK at `main`, built from source at these pins, recorded in [`manifests/versions.toml`](), which also explains each pin and its patches. Upstream documentation, such as the MLIR-AIE programming guide and examples, describes its default branch; use the pinned revision below when an example must match what the SDK ships. | Component | Source | Pinned revision | Branch | Provides | | --- | --- | --- | --- | --- | | ROCm LLVM | [ROCm/llvm-project]() | [`bdf04ebb32d7`]() | `amd-staging` | | | iron-tools (MLIR-AIE) | [Xilinx/mlir-aie]() | [`e5a3fa14879d`]() | | `aie-opt`, `aie-translate`, `aiecc`, `IRON python`, `bootgen`, `aie_api`, `aie-rt`, `xclbinutil (vendored third_party/hrx-xclbinutil)` | | aiebu | [Xilinx/aiebu]() | [`f8d3c3286124`]() | `main-ge` | `aiebu-asm` | | IRON operator library | [amd/IRON]() | [`b7e8ea91eaad`]() | `devel` | `iron.operators (GEMM, MHA, RMSNorm, elementwise, flm ports, ...)`, `iron.Graph (multi-operator full ELFs)` | | Peano (llvm-aie) | [wheel index]() | `llvm-aie==22.0.0.2026102001+4f5df13d` | | | | HRX runtime | [ROCm/hrx-system]() | [`2a08124b4465`]() | `users/jtuyls/amdxdna-hal-native-rel` | | | FastFlowLM | [ROCm/FastFlowLM]() | [`07defcb8cb9a`]() | `main` | | | eudsl-python-extras | [find-links]() | `eudsl-python-extras==0.1.0.20261001.532+c60cea4` | | | ## Python | Wheels | Requires-Python | | --- | --- | | Compiler (`fastflow-sdk-compiler`, IRON operators) | `>=3.12,<3.15`: CPython 3.12, 3.13, 3.14, one `cp312-abi3` build | | Runtime and FastFlowLM | `>=3.11` | The release base version is `0.1.0`. # FastFlow SDK external plugin API v1 `fastflow ...` resolves and directly executes `fastflow-` (`fastflow-.exe` on Windows). Built-in commands always win. Names are limited to lowercase ASCII letters, digits, and dashes. Resolution order is: 1. `FASTFLOW_SDK_PLUGIN_PATH` 2. the directory containing the native `fastflow` executable 3. `PATH` Empty path entries are ignored, so the current working directory is never searched implicitly. An explicit current-directory entry is a deliberate trust decision. Duplicate names use the first resolved executable. `plugin list` reports later candidates as shadowed. Plugins are child executables, not shared libraries. The core never invokes a shell and does not execute Windows `.cmd` or `.bat` files. Standard input, standard output, standard error, and normal process exit codes are preserved. POSIX termination signals are forwarded to the child process group; Windows console control propagation is best effort through the shared console. An explicit `--runtime` is authoritative and must load successfully before the plugin starts; it is never silently replaced by an installed default. Core-side discovery, validation, and launch failures are emitted as one native report when JSON output is requested. The child receives: - `FASTFLOW_SDK_PLUGIN_API=1` - `FASTFLOW_SDK_CORE_VERSION` - `FASTFLOW_SDK_CORE_EXECUTABLE` as an absolute path - `FASTFLOW_SDK_RUNTIME_PATH` when a packaged or explicit HRX runtime resolves - `FASTFLOW_SDK_OUTPUT_FORMAT=human|json` Plugins must reject absent or unsupported protocol versions. `--json` is a core global option and is removed from plugin arguments; its canonical value is communicated through `FASTFLOW_SDK_OUTPUT_FORMAT`. Therefore `--json` before and after the external command is equivalent. Plugin search paths are executable-code trust boundaries. Administrators must not place attacker-writable directories before trusted installation directories. The core rejects a resolved plugin that aliases its own executable. # Qualification evidence contract v1 A qualification run writes a portable directory containing: - `evidence.json`: overall subject, platform, model, and test results - `candidate-manifest.json`: a sanitized identity projection of the supplied release candidate, or an explicit ad-hoc placeholder - `core-version.json`, `probe.json`, `doctor.json`, and `self-test.json`: native CLI reports - `artifacts/native/powermode-before.json`: raw CLI report proving passive powermode reporting worked - `artifacts/native/powermode-set-balanced.json`, `artifacts/native/powermode-after-balanced.json`, `artifacts/native/powermode-set-performance.json`, `artifacts/native/powermode-after-performance.json`, `artifacts/native/powermode-set-turbo.json`, `artifacts/native/powermode-after-turbo.json`, `artifacts/native/powermode-restore.json`, and `artifacts/native/powermode-final.json`: raw CLI reports backing the native mutating powermode roundtrip test when the host supports unprivileged power-mode changes - `xadx-report.json`: schema-v1 XADX identity, per-case metrics, structured phase/round failures, `unique_xclbin_context_soak` (the counted `unique-xclbin-context-soak` test: 33 distinct images in one runtime), and `subbuffer_binding` (the counted `subbuffer-binding` test: one shipped kernel dispatched with each buffer bound at a byte offset) - `profile.json`: either the exact versioned `profile-v1` executed (curated `fast` / `default` / `extended` runs) or a `diagnostic-sweep` descriptor (`kind: "diagnostic-sweep"`) recording what a sweep actually ran (name, bench context, and the selected tags with their test names). The `--all-models` sweep records `name: "all-models"`; the measurement-only `--bench all` sweep records `name: "bench-all"` and its `bench_iterations`; `--bench dev` records `name: "bench-dev"` and its `bench_iterations`. A diagnostic-sweep descriptor is never a packaged contract: it pins no files or XCLBINs and is always ad-hoc (`candidate_bound: false`), so intake refuses it. - `models.json`: model source, revision, pull state, and content hashes - `junit.xml`: CI-compatible passed and failed test cases - `report.md`: optional human-readable HRX overlay written for sweeps. It is covered by `SHA256SUMS` but is not schema-validated and carries no intake semantics; profile runs omit it. When `--bench --xrt-flm ` or `--all-models --xrt-flm ` runs, the decode benchmark table and the Embedding/ASR probe tables widen to a side-by-side HRX-vs-XRT comparison. `--all-models --xrt-flm` also emits a greedy numerical-match table (exact `Model RAW Output` equality on the single-prompt run). - `logs/pull/` and `logs/tests/`: redacted subprocess transcripts - `SHA256SUMS`: every other evidence file in deterministic path order `evidence.json` conforms to `tools/fastflow-sdk-qualification/python/fastflow_sdk_qualification/schemas/evidence-v1.schema.json`. Status is written as `running` before device work begins and updated as results arrive, so interrupted and failed runs retain useful partial evidence. Both successes and failures remain in the final bundle. An optional `--bench --xrt-flm ` or `--all-models --xrt-flm ` comparison never adds test entries: each model's XRT result is folded into the matching HRX record under the free-form `metrics.xrt` object (`status`, measurements, `match` / `matched_outputs` for the single-prompt greedy text, log/artifact references, or `status: "unavailable"` with an error). Chat models fold greedy match onto the single-prompt `run` record and fold decode metrics onto the `bench` record; embed/ASR models fold onto the `serve` record. This keeps XRT strictly informational -- it never changes the run's `pass`/`fail` and needs no schema change. When the flag is given, the diagnostic-sweep `profile.json` records the requested path, the resolved XRT entrypoint, and the host `XILINX_XRT` prefix (or `status: "unavailable"` with an error if the build or host XRT could not be resolved). An unresolved `--xrt-flm` still stamps `metrics.xrt` unavailable on every model so the report keeps XRT columns. The subject records exact versions for `fastflow-sdk-runtime`, `fastflow-sdk-fastflowlm`, and `fastflow-sdk-qualification`, the native core source revision, and the candidate manifest hash. Model identities always include a source, revision label, approved registry digest, and SHA-256 inventory of observed model-cache files. Candidate-backed runs verify installed package manifests and their complete declared file inventories before device work. The candidate-v1 qualification contract binds the kernel-recipe-v1 digest, generator and serializer revisions, transaction hashes, source-XCLBIN hashes, serialized XADX hashes, and lifecycle, resident, and readback round counts. Candidate v1 also binds the required NumPy/ml-dtypes versions. Each run records the installed wheel tags, RECORD SHA-256, and verified payload SHA-256 in its evidence subject. Linux supplies the canonical qualification wheel; Windows-local generation may be exercised for platform validation, but it must match the canonical wheel's member names, uncompressed bytes, and normalized modes before its evidence can stand in for a run against the canonical wheel. Evidence intentionally excludes complete environment dumps. Known bearer tokens, token query parameters, passwords, secrets, and API keys are redacted from captured logs. ## Transport archive `fastflow qualify run --bundle-output`, or the recoverability command `fastflow qualify pack`, seals a finalized directory as a deterministic `.evidence.zip`. The archive has sorted normalized POSIX member names, fixed timestamps and permissions, no explicit directory entries, and contains exactly the files covered by the internal `SHA256SUMS`. It does not wrap them in an additional top-level directory. `fastflow qualify verify` accepts either the directory or archive form. It checks complete and exclusive checksums, safe paths and regular-file types, bounded expansion, canonical JUnit projection, evidence/sidecar consistency, artifact references, pass/fail semantics, and candidate identity. Candidate-bound verification compares the sanitized embedded candidate with the supplied canonical manifest and rechecks candidate wheel hashes when those wheels remain under the canonical manifest root. A passing run must use the exact resolved profile and policy recorded from the candidate qualification wheel, bind platform facts exactly to `probe.json`, match every model source, revision, registry digest, and file hash, and contain every expected test iteration, native check, XCLBIN inventory, and packaged XADX case. Passing evidence must contain every raw native and XADX report; report status, identity, case order, metrics, and round counts must agree with `tests.json` and the candidate qualification contract. The native powermode roundtrip is verified from its raw artifacts: baseline query, set/query confirmation for `balanced`, `performance`, and `turbo`, restore, and final restore confirmation must agree with the single `powermode-roundtrip` native test record. Linux runs may mark only this native record `unsupported`, because current AMDXDNA drivers require root privileges for power-mode sets; such evidence must still contain a passing `powermode-before.json` baseline report, and every other expected test must pass. The `shared-code-memory-reclaim` native test is required on every platform. Its raw JSON artifact (`schema_version` 2) records whether the native driver exposes a bounded shared code-memory budget and how many instruction bytes were allocated. On bounded drivers the device must advertise a nonzero retained command-code ceiling; the test churns at least four ceilings of retained command buffers interleaved with long-lived buffers, releases the retained ones, and must then allocate one instruction buffer of three quarters of the budget. It then exhausts the budget through the recoverable allocation path, releases capacity, and successfully allocates again. On other drivers it executes the same instruction-allocation path as a smoke test. The XADX report records exact recipe and executable provenance and one result per case: dispatch/readback counts, validated bytes, duration, mismatch count, first mismatch, and structured failures. Runtime-generated buffer contracts, sizes, and digests keep deterministic materialization auditable without packaging the generated input files. Verification does not execute device code. ## Intake index `fastflow qualify intake` preserves verified input archives unchanged under `runs/.evidence.zip` and writes `qualification-index.json` conforming to `qualification-index-v1.schema.json`. Each sorted run entry records the source bundle name and digest, status, profile, timestamps, normalized platform facts, source revision, and candidate digest. The index also records the selected qualification policy, each matched run digest, and satisfaction. Aggregate `SHA256SUMS` covers the index and every preserved bundle; the aggregate ZIP is deterministic and has a separate `.sha256` release-asset checksum. `fastflow qualify verify` validates that external checksum, the aggregate layout and index, every nested evidence bundle, and their shared candidate. Candidate release intake rejects ad-hoc or mixed-candidate evidence and fails when any qualification-wheel policy requirement is absent. Aggregate verification independently reevaluates that packaged policy against every nested run. Signing, uploading, publication, and long-term storage remain manual responsibilities outside this contract. # Native runtime CLI JSON contract `fastflow --json ` writes exactly one UTF-8 JSON document followed by a newline to standard output. Diagnostics that are not part of the report are written to standard error. A failed health check or self-test still produces a complete report. If `--json` is present but invocation parsing fails, the CLI emits an `invocation` report containing `invocation.arguments` and exits 2. `--help` prints the usage text instead of a report. An external plugin that starts writes its own output and sets the exit status; the CLI reports `plugin.dispatch` only when it cannot start one. Consumers must use `schema_version` before interpreting a report. Version 1 has a stable envelope with these top-level members: - `schema_version`: integer, currently `1` - `command`: command name - `status`: `pass`, `fail`, or `error` - `product`: object with `version`, `source_revision`, and `build_platform` - `checks`: array of check result objects - `data`: optional command-specific object Each check result has `id`, `status`, and `message` fields. Check IDs are lowercase dotted identifiers such as `runtime.library.load`. Checks may include a `details` object for structured diagnostics. Adding optional fields inside `data` or check `details` is compatible. New commands and new check IDs are compatible when existing command behavior is unchanged. Removing or renaming required envelope fields, changing their types, or changing status semantics requires a new `schema_version`. Changing or removing an existing check ID is breaking for automation and must be handled as an explicit compatibility change, but does not by itself require a new envelope schema version. The order of JSON object members is not part of the contract. ## Common report ``` { "schema_version": 1, "command": "doctor", "status": "pass", "product": { "version": "0.1.0.dev0", "source_revision": "0123456789abcdef", "build_platform": "Linux-x86_64" }, "checks": [] } ``` Statuses are `pass`, `fail`, or `error`. `fail` means the command completed but a health assertion or output comparison failed. `error` means the invocation could not be completed because its input or execution was invalid. Stable doctor check IDs include: - `package.manifest` - `device.enumeration` - `runtime.library.present` - `runtime.library.load` - `runtime.symbols` - `runtime.abi` - `device.present` - `device.access` - `device.ioctl` - `runtime.initialize` - `runtime.device_count` - `runtime.shutdown` Power-mode reporting and setting use `powermode.device_present`, `powermode.query`, `powermode.set`, and `powermode.support`. `powermode.support` reports whether platform power-mode setting is available. `powermode.arguments` reports an invalid mode that reaches the command; the invocation parser normally rejects one first with `invocation.arguments`. Self-test adds `self_test.prerequisites`, `self_test.fixture`, `self_test.load`, `self_test.dispatch`, `self_test.cleanup`, and `self_test.output`. Plugin discovery uses `plugin.discovery`, and a plugin that cannot be started reports `plugin.dispatch`. Unhandled execution failures use `internal.error`. [Troubleshooting]() explains each check ID and what to do when it does not pass; it is generated from `tools/fastflow/checks.toml`. # Releases and building # Release notes Every FastFlow SDK release is on [GitHub Releases]() with its wheels, standalone archives, checksums, and qualification evidence. Install a specific release from PyPI by pinning its version: ``` python -m pip install "fastflow-sdk==" ``` Development builds, versions with a `.dev` suffix, are not on PyPI; install them from the FastFlow SDK package index: ``` python -m pip install --only-binary=:all: --extra-index-url https://rocm.github.io/FastFlow-SDK/simple "fastflow-sdk==" ``` ## 0.1.0 Published 2026-11-23. [Release page and assets](). This release advances `main` by 13 commits beyond `fastflow-sdk-v0.1.0.dev202611160006` and ships FastFlowLM 1.0.14. - Pin HRX scheduler-timeout recovery (\#151) and the AIE4 single DMA patch (\#152). - Bump IRON to b7e8ea9 and mlir-aie to e5a3fa1 (\#153), and compile IRON's Gather operators (\#154). - Bundle LLVM libomp so the Linux FastFlowLM wheel is `manylinux_2_28` (\#160). - Verify product files past MAX\_PATH on Windows (\#157) and keep the standalone archive's report when its command fails (\#155). - Keep the Gemma 4 extension sources buildable from deeper installs (\#158) and fix the Windows Gemma 4 guide commands (\#154). - Add a documentation site with generated reference pages and `llms.txt` (\#156, \#159). - Add the stable `github-release` publish target (\#161) and build single-wheel `fastflow-sdk` packages for PyPI from the release wheels (\#162, \#163). - The qualification tooling now pins NumPy 2.5.3 and ml-dtypes 0.6.0, the versions the compiler bindings pin, and so requires CPython 3.12 through 3.14 (\#162). The runtime and FastFlowLM wheels are unchanged in this respect. ## 0.1.0.dev202611160006 Published 2026-11-17. [Release page and assets](). This release advances `main` by two commits beyond `fastflow-sdk-v0.1.0.dev202611100004` and ships FastFlowLM 1.0.14. - Add FastFlowLM model extension support (\#149). - Qualify HRX large control code, shared program images, and FastFlowLM 1.0.14 (\#150). All other packaging, install, and qualification behaviour carries forward unchanged from the previous prerelease. ## 0.1.0.dev202611100004 Published 2026-11-10. [Release page and assets](). FastFlowLM is 1.0.12 (`f06f11eb`). HRX is `aa6bcdd5`. - The release now includes the top-level `fastflow-sdk` meta-package. It installs FastFlowLM, the runtime, compiler, and IRON operators at the exact matching version. - HRX bounds shape-varying command, context, executable, and host-allocation retention. Recreated executables can reuse compatible retired native commands, and a device-owned executable cache reuses matching single-XCLBIN direct-transaction executables across producers. The cache is bounded to 4096 entries and an estimated 112 MiB of host descriptor storage. - FastFlowLM supplies a compute-once XCLBIN content identity through HRX's versioned executable-create parameters, preserving the executable-reuse hot path without retaining unbounded executable generations in FastFlowLM. - Windows Path-B command-aperture staging now reclaims the oldest idle retained command when needed and explicitly evicts cacheable aperture lines before non-temporal stores. This preserves publication coherency across the qualified Windows driver matrix. - FastFlowLM 1.0.12 adds the LFM3 1.7B registry entry used by extended qualification. - Fast and extended qualification now exercise repeated executable recreation, three shape windows around the bounded command cache, 105 continuously novel Gemma shapes, an LFM3 changing-prefill soak, and Llama 3.1 8B multi-turn and context coverage. - The SDK includes end-to-end IRON Gemma 4 documentation and a GEMM dequant example. - The repository now supports publishing a PEP 503 FastFlow SDK package index from GitHub Releases. ## 0.1.0.dev202610230003 Published 2026-10-23. [Release page and assets](). FastFlowLM is 1.0.10 (`e2d0144f`). HRX is `dbd9a414`. - Linux NPU engines are rebuilt for manylinux 2.28 and need at most glibc 2.22 and libstdc++ 3.4.21. The Linux runtime wheel bundles libcurl, libboost\_container, and libedit. libstdc++, libgcc\_s, libgomp, and glibc libmvec remain host libraries. - The Linux CLI uses libedit. When stdin is not a terminal, it prints the `>>>` prompt and reads the piped command, so scripted sessions continue. - A bound sub-buffer shares its parent allocation. Flush and invalidate apply to that slice. - The FastFlowLM wheel and standalone archive include the Gemma 4 engine sources and the q4nx and mha libraries. The ops wheel includes the IRON files for that engine. Windows delay-loads engine DLLs, and the launcher keeps the caller's PATH ahead of the directories beside `flm`, so a rebuilt engine DLL is selected first. The MiniCPM-V 4.7 NPU engine is linked and delay-loaded the same way. - The HRX Linux device heap grows past one 64 MiB chunk when a buffer needs it. Instruction buffer objects record their Linux dependencies. Completion batches are released before a queue is destroyed. Model unload cleans up that model, and the command cache is keyed by shape. - The runtime wheel and the standalone archive ship the HRX headers, CMake package, and Windows import library, so a custom engine can use `find_package(hrx)`. - Compiler-core wheels are smaller without a change to the public tool names: Windows 632,790,558 to 330,061,997 bytes, and Linux 469,932,885 to 303,792,202 bytes. The duplicate versioned `libLLVM-.so` is also removed, which drops another 42,746,553 bytes from the current Linux wheel. The standalone archive's Python module is `fastflow_sdk_archive`. IRON operator builds use iron-tools 1.4.4. ## 0.1.0.dev202610050001 Published 2026-10-06. [Release page and assets](). Linux and Windows prerelease wheels for the FastFlow SDK compiler, runtime, FastFlowLM, and qualification tooling. Compiler bindings support CPython 3.12, 3.13, and 3.14. Source ref: 87c3b2a Source commit: 87c3b2a056996b9a44eb3815f5d88c8b280c706b Workflow run: https://github.com/ROCm/FastFlow-SDK/actions/runs/37330208992 # FastFlow SDK wheel releases > [!NOTE] > > This document is the **release-operator** policy for versioning, validating, and publishing wheels. To *install* a published build, use the [install guide](). FastFlow SDK compiler, ops, runtime, and FastFlowLM wheels use [PEP 440]() versions. The release train targets one stable version while development and release-candidate builds approach that version: ``` .dev rc1 rc2 ``` Development releases may continue for as long as needed. Do not advance the patch component merely to publish another development build. Advance it only after a stable release when beginning a new patch train. ## Version authority `release.toml` is the single source of truth for the current wheel release train. To begin a new train, change only: ``` [wheel_release] base_version = "" compiler_python_stable_abi = "3.12" compiler_python_versions = ["3.12", "3.13", "3.14"] ``` The release tooling reads this value when it generates an automatic development version. Workflows and documentation must not duplicate the current numeric base version. The top-level `schema_version` identifies the policy format, not the wheel version. `compiler_python_stable_abi` sets the bindings ABI floor, and `compiler_python_versions` lists the supported interpreters. An explicit `package_version` supplied to a manual workflow dispatch overrides automatic development-version generation. Use that override for release candidates and stable releases. Explicit versions must be the configured base version, `rcN`, or `.devN`; versions from another train and alpha, beta, post, or local versions are rejected. Automated GitHub publication is currently disabled. Development and RC versions may use `publish_target=github-prerelease` to build the attested release payload. The stable base version uses `publish_target=github-release` instead, which requires an explicit `package_version` and rejects development and RC versions; `github-prerelease` rejects the stable version. Neither mode creates a tag or release while the publication gate is disabled. Local non-release wheel builds use a commit-derived development version. That fallback identifies an individual checkout and is intentionally separate from the published release train. ## Cross-platform releases Windows and Linux wheels participating in one coordinated release use the same version. FastFlowLM requires the runtime wheel at exactly that version. Never replace or reuse a published version; produce a new development or release candidate version instead. `fastflow-sdk-qualification` is `py3-none-any` and requires `fastflow-sdk-fastflowlm` at exactly the same version plus NumPy 2.5.3 and ml-dtypes 0.6.0, the versions the compiler bindings pin. Pip resolves the numeric wheels from the package index for CPython 3.12 through 3.14 on Linux and Windows. Candidate v1 binds the required versions, and qualification evidence records the installed wheel tags, RECORD digest, and verified payload digest. Linux and Windows generate the qualification wheel independently from the same source pins. Linux publishes the canonical wheel. Windows NPU jobs currently install the Windows-local wheel to avoid depending on Linux artifact scheduling; those runs remain platform validation, not canonical candidate evidence. When the canonical artifact is supplied, Windows must match its qualification contract and XADX provenance before using it. The platform-native builds therefore remain parallel. The qualification wheel is an optional GitHub Release asset; installing the runtime or FastFlowLM products does not install qualification. The qualification wheel owns compiler-free XADX executables. FastFlowLM wheels continue to own the raw XCLBINs used for inference and do not carry a second XADX representation. A release consequently contains the raw XCLBIN and its embedded XADX copy because the two consumers require different formats; moving XADX into the FastFlowLM wheel would not remove that duplication. XADX generation needs initialized FastFlowLM headers, engine libraries, and production XCLBINs plus an installed HRX serializer, but not a built `flm` executable. Both Linux runtime wheels are tagged `manylinux_2_28_x86_64` because their native closures satisfy that policy. The FastFlowLM wheel loads `libhrx.so.0` from the runtime wheel, which it pins exactly, so its audit treats the runtime wheel's libraries as provided. FastFlowLM's engine libraries are built with GCC OpenMP, but manylinux does not include `libgomp`; the packager relinks them against LLVM's `libomp`, built from the pinned `llvm-project`, and ships it in the FastFlowLM wheel and the Linux archive. The compiler is a coordinated split distribution: - `fastflow-sdk-compiler` is the platform-neutral user-facing meta-package. - `fastflow-sdk-compiler-core` contains the LLVM/MLIR/IRON tools, headers, Peano payload, and Python-independent native libraries once per platform. - `fastflow-sdk-compiler-bindings` contains the `aie` Python package and native extensions built once against CPython 3.12's stable ABI. Its wheel tag is `cp312-abi3`, which supports the validated Python 3.12 through 3.14 range. Both the meta-package and bindings require the matching core at exactly the same version. Moving the 127 MB `AIEAggregateCAPI` library into the core avoids duplicating it in every CPython bindings wheel. Importing `aie` activates the core wheel's native-library directory before loading its extension modules. On Windows, packaging replaces byte-identical Peano multicall aliases with small native launchers that preserve each Clang, LLD, or readelf driver flavor. It keeps one full `clang++.exe`, `lld.exe`, and `llvm-readobj.exe`; a changed upstream alias fails packaging instead of being silently replaced. Compiler wheels use maximum DEFLATE compression to reduce release and PyPI storage. The Windows wheel audit compiles, preprocesses, and links through the forwarded Clang, GNU LLD, COFF LLD, and readelf modes, and checks the Darwin and WebAssembly LLD flavor selection. Linux packaging similarly replaces the large LLD and readelf multicall copies with flavor-preserving shell launchers. It removes the byte-identical versioned `libLLVM-.so` copy only after comparing it with the retained `libLLVM.so`, and strips unneeded symbols from staged ELF executables and shared libraries. The installed-wheel audit exercises each forwarded alias in its intended driver flavor and validates the ELF dependency closure after these transformations; the manylinux policy audit then checks the finished wheels. When `fastflow-sdk-runtime` is also installed, the same import selects HRX for in-process IRON (`NPU_RUNTIME`, `IRON_RUNTIME`, and `HRX_LIBHRX` from `fastflow_sdk_runtime.libhrx_path()`) if those variables are unset. Compiler wheels do not depend on the runtime package; a compiler-only install skips the hook. Importing `fastflow_sdk_runtime` performs the same HRX selection. `fastflow-sdk-ops` is `py3-none-any` and requires `fastflow-sdk-compiler` at exactly the same version. It ships the IRON `iron` package, so `from iron.operators import ElementwiseAdd` works after a wheel install. It ships no kernel sources: the kernel factories compile from the compiler's own `include/aie_kernels`, which `fastflow_sdk_ops.kernels_root()` returns. The wheel is compile-oriented: it does not depend on torch. `verify-ops-wheels` imports every module under the `iron.operators` packages, checks that every `iron.operators.CATALOG` entry is a class those modules define, and fails if any import pulled in torch. CI then installs that wheel into the Python 3.12 compiler verify venv and compiles every operator in `build_tools.iron.host_compile_suite()` in parallel (the same small shapes as `test-iron-ops`, so `generic/` and `aie2p/` kernels both go through Peano). The compiler wheel includes `aiebu-asm`; the dynamic strided-copy row compiles an `iron.Graph` whose copy offset is a scratchpad parameter into one full ELF, and the fused add-to-ReLU row compiles a two-design graph (multi-PDI reconfiguration and an intermediate scratch buffer) into one. NPU CI does not run iron-ops pytest: it dispatches the prebuilt `npu-test-package` for operators that have `CASE_GENERATORS`. `dev.py test-npu-iron-ops` is local and still compiles inside `run_test`; CPU CI is the off-device drift gate. 3.13/3.14 already proved the abi3 compiler; ops is `py3-none-any`. Linux publishes the canonical ops wheel with the compiler wheel family (same artifact name; ops files are listed explicitly); Windows still packages and compile-checks it so a packaging bug cannot hide on one host. Release collection still resolves the compiler meta-wheel and that ops wheel with `python -m build_tools.resolve_release_wheel` for every `compiler_python_versions` interpreter on Linux and Windows (pip `--platform` / `--abi`, not an import). `fastflow-sdk` is the `py3-none-any` one-step install. It ships no code (its only package is the empty `fastflow_sdk_meta`) and requires `fastflow-sdk-fastflowlm`, `fastflow-sdk-compiler`, and `fastflow-sdk-ops` at exactly the same version, so it inherits the compiler's Python range. The Linux compiler job packages it with `dev.py package-sdk-wheel`, and both release collection workflows resolve it against the collected payload with `resolve_release_wheel --product sdk`. Releases before `0.1.0.dev202610230003` do not include it. The unified workflow builds and validates Linux and Windows wheels from one source commit. An operator may publish the validated payload manually under `fastflow-sdk-v` after evidence intake succeeds. ## Manual workflow The `Release FastFlow SDK Wheels` workflow defaults to validation only. With `publish_target=none`, it builds and validates both platform wheel sets and uploads a temporary Actions artifact. `publish_target=github-prerelease` (for development and RC versions) and `publish_target=github-release` (for the stable version) also build and attest the same release payload, but the GitHub publication job is disabled; it does not create or push a tag. The same payload includes the tested standalone FastFlowLM + HRX runtime archives (`fastflow-sdk-linux-x86_64.tar.zst` and `fastflow-sdk-windows-x86_64.zip`), checksum sidecars, and detached bundle provenance manifests. Compiler CI also builds relocatable product archives (`fastflow-sdk-compiler-linux-x86_64.tar.gz` / `fastflow-sdk-compiler-windows-x86_64.tar.zst`) for packaging and verification, but only compiler, ops, and `fastflow-sdk` wheels are collected into this release payload. The ops wheel is the canonical Linux `py3-none-any` file from the Linux compiler-wheels artifact. Release assembly rejects runtime archives whose embedded version, source revision, platform, or archive digest does not match the resolved release. Pull-request CI builds one stable-ABI bindings wheel per platform and validates that same wheel on Python 3.12, 3.13, and 3.14. The workflow resolves the requested ref once and passes its immutable commit SHA through build, NPU validation, manifest generation, and release assembly. The human-readable source ref remains in the release metadata. Validation-only runs may be dispatched from a pull-request branch and have read-only permissions; they do not request an OIDC token or create attestations. Publication runs must be dispatched from `main`, and the resolved source commit must be an ancestor of `origin/main`. Only those publication builds receive attestation permissions. Qualification candidate and evidence publication is deliberately manual. Release collection emits one self-contained candidate containing every Linux and Windows runtime/FastFlowLM wheel, the shared qualification wheel, `candidate-manifest.json`, and `SHA256SUMS`. Every operator machine runs against that same manifest. The operator collects deterministic `.evidence.zip` bundles, transfers them to an intake machine, runs `fastflow qualify verify` and `fastflow qualify intake --policy release --require-status pass`, and reviews the recorded policy satisfaction in `qualification-index.json`. The GitHub publication job is currently disabled. It runs for both `github-prerelease` and `github-release` only when the repository variable `FASTFLOW_SDK_ENABLE_GITHUB_PRERELEASE` is `true`, and then creates a draft release marked as a prerelease for development and RC versions, or as the latest release for the stable version. Until then, download the complete collected Actions artifact, create the draft release and tag manually, then run `fastflow qualify stage-release` to assemble a single flat upload directory from that payload plus the intake aggregate (`qualification-evidence-.zip`), sidecar, and `qualification-index.json` into an empty output directory. Upload every top-level file from that directory (wheels including ops and `fastflow-sdk`, native archives, metadata, checksums, candidate manifest, and the three evidence attachments). Do not upload nested `simple/` trees. Before publishing, recheck that every staged wheel still has the hash recorded in the candidate manifest. Any rebuilt or replaced wheel invalidates the evidence and requires a new candidate plus new runs. Verify the aggregate ZIP with `fastflow qualify verify` before staging or manually publishing. No workflow creates or publishes the release, transfers manual evidence, or signs evidence. `SHA256SUMS` covers the prepared top-level product assets. `candidate-SHA256SUMS` separately covers `candidate-manifest.json` and its qualification wheels without replacing the release checksum. The nested PEP 503 `simple/` index in the complete Actions artifact covers only that payload; the public index is published separately (see [Package index](<#package-index>)). ## Package index `https://rocm.github.io/FastFlow-SDK/simple/` is a PEP 503 simple index built from the wheels attached to every published, non-draft `fastflow-sdk-v*` release. Its links point at the release download URLs and carry the asset's GitHub SHA-256 digest, falling back to the release `SHA256SUMS`. Wheels are never copied to Pages. Each project page lists every release that ships that project, so `fastflow-sdk` starts at `0.1.0.dev202610230003`. The index is published together with the documentation site, because every Pages deployment replaces the whole site, and the site documents a release, not `main`. After publishing a release, run the `Publish FastFlow SDK docs and simple index` workflow (`.github/workflows/publish_fastflow_sdk_pages.yml`) from `main` (Actions → Run workflow). It rebuilds the whole index from the releases API (`build_tools/publish_fastflow_sdk_simple_index.py`), builds the documentation at the latest stable release's tag (the latest prerelease's while no release is stable), or at the `ref` input, into the same site, and deploys both. For a stable release, run it only after the [PyPI upload](<#pypi-wheel>), because the documentation installs from PyPI. A ref without `zensical.toml`, such as a release from before the documentation site, publishes the index alone with a warning; run it with `ref: main` to publish the documentation of `main` instead. The repository's Pages source must be set to GitHub Actions. Development builds install from this index with `--pre`. Stable releases also appear on it, but users install them from PyPI as the single wheel described in [PyPI wheel](<#pypi-wheel>). Each wheel uses Core Metadata 2.4 with an SPDX license expression and copies all applicable license and notice files under `.dist-info/licenses/`. It also contains a CycloneDX 1.6 SBOM under `.dist-info/sboms/`; the SBOM and the package-local manifest retain source, dependency, toolchain, binary-closure, and per-file provenance for the shipped product. Tests validate each SBOM against the official CycloneDX 1.6 schema and require its file hashes to match the package manifest and wheel `RECORD`. The FastFlowLM SBOM also records its exact runtime-wheel dependency. After publication and the index workflow, validate the package index end to end from clean Linux and Windows virtual environments. Installing `fastflow-sdk` pulls FastFlowLM, the runtime, the compiler, and ops: ``` py -m pip install --no-cache-dir --only-binary=:all: ` --extra-index-url https://rocm.github.io/FastFlow-SDK/simple ` "fastflow-sdk==" py -m pip check py -c "import fastflow_sdk_runtime, aie; from iron.operators import ElementwiseAdd; print(ElementwiseAdd.__name__)" flm version aie-opt --version aiecc --help ``` ``` python3 -m pip install --no-cache-dir --only-binary=:all: \ --extra-index-url https://rocm.github.io/FastFlow-SDK/simple \ "fastflow-sdk==" python3 -m pip check python3 -c "import fastflow_sdk_runtime, aie; from iron.operators import ElementwiseAdd; print(ElementwiseAdd.__name__)" flm version aie-opt --version aiecc --help ``` Also check that an unpinned `--pre` install of `fastflow-sdk` resolves to the new version. ## PyPI wheel PyPI hosts only stable releases, as one `fastflow-sdk` wheel per platform: `cp312-abi3-manylinux_2_28_x86_64` for Linux and `cp312-abi3-win_amd64` for Windows. Each repacks a published release's component wheels unchanged (`build_tools/fastflow_sdk_pypi_wheel.py`), without rebuilding anything: - Every component wheel must be listed in the release `SHA256SUMS`, match its own `RECORD`, and share the release version. Every payload file is copied byte for byte with its mode, and two components may not ship the same path. - The merged metadata pins the union of the components' external requirements and intersects their `Requires-Python`. A requirement on a component that is not bundled, or two requirements that conflict, fails the build. - Each component's licenses and SBOM are kept under `.dist-info/licenses//` and `.dist-info/sboms/.cyclonedx.json`. `.dist-info/fastflow-sdk-components.json` records each bundled wheel's name, version, and SHA-256, and `fastflow qualify` reads its versions from there. - Linux inputs must already be manylinux; the wheel takes the most restrictive component tag, and `auditwheel` must confirm it. Candidate-bound qualification still requires the component wheels, so release evidence is always collected from them, not from the PyPI wheel. CI repacks, audits, and checks every collected release the same way, in the collect job (`collect_fastflow_sdk_ci_release.yml`), after uploading the unchanged release payload. After merge to `main`, and in the release workflow below, `verify_fastflow_sdk_pypi_wheels.yml` also installs the result on Linux and Windows with Python 3.12 and 3.14, in the `manylinux_2_28` container on the Linux NPU runner, and on the Windows NPU runner. Pull requests skip those installs, which download the large wheels to shared runners. The same steps run locally: ``` python dev.py package-pypi-wheel --release-dir --platform linux python dev.py package-pypi-wheel --release-dir --platform windows python dev.py audit-pypi-wheel build/pypi-wheel/fastflow_sdk--cp312-abi3-manylinux_2_28_x86_64.whl python dev.py verify-pypi-wheel build/pypi-wheel --require-hardware ``` `verify-pypi-wheel` installs the host's wheel into a clean virtual environment, then runs `pip check`, the imports, the runtime self-test, every console script, and the `fastflow` reports; `--require-hardware` adds `flm version` and `examples/hello_npu.py` on an NPU. To publish a stable release: 1. Publish the GitHub release after qualification, as for any release. 2. Run the `Build FastFlow SDK PyPI wheels for a release` workflow (`.github/workflows/release_fastflow_sdk_pypi_wheels.yml`) from `main` with the release tag. It downloads the release wheels and `SHA256SUMS`, verifies each wheel's build-provenance attestation, repacks, audits, runs `twine check --strict`, attests the two PyPI wheels, and runs the install and NPU checks above. It does not upload anything. 3. Download its `fastflow-sdk-pypi-wheel-linux` and `fastflow-sdk-pypi-wheel-windows` artifacts, check each wheel with `gh attestation verify --repo ROCm/FastFlow-SDK`, and upload both wheels with a PyPI API token scoped to the `fastflow-sdk` project: ``` python -m twine upload --repository pypi fastflow_sdk--*.whl ``` 1. In a clean virtual environment, check that `pip install fastflow-sdk` installs the new version and that `fastflow self-test` passes. 2. Run the documentation workflow from [Package index](<#package-index>). The release workflow creates GitHub build-provenance attestations for published wheels and standalone runtime archives in each native platform build job, before artifact upload. Publication still waits for the Linux and Windows NPU jobs to validate the wheel-installed runtime and CLI on hardware. # Build FastFlow SDK from source Use this guide to build FastFlow SDK from this checkout instead of installing a release. The steps below build the runtime (HRX and FastFlowLM): a minimal HRX with the `amdxdna` HAL and the pinned FastFlowLM app, which can pull `qwen3:0.6b` and run a smoke test. The compiler-stack instructions cover the source-built LLVM/IRON toolchain and the IRON end-to-end artifact checks. Ubuntu prerequisites: ``` sudo apt-get install -y \ bash build-essential ca-certificates curl git libdrm-dev \ linux-libc-dev make nasm perl pkg-config python3 python3-venv unzip zip curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | \ sh -s -- -y --profile minimal --default-toolchain 1.97.0 export PATH="$HOME/.cargo/bin:$PATH" ``` Extra Linux packaging prerequisites: ``` sudo apt-get install -y patchelf zstd ``` Windows prerequisites (PowerShell, no WSL): ``` winget install --exact --id Microsoft.VisualStudio.2022.BuildTools ` --override "--wait --passive --add Microsoft.VisualStudio.Workload.VCTools --includeRecommended" winget install --exact --id Python.Python.3.12 winget install --exact --id Git.Git winget install --exact --id Rustlang.Rustup rustup toolchain install 1.97.0 --profile minimal rustup default 1.97.0 git config --global core.longpaths true ``` On Linux and Windows, `dev.py setup --profile fastflowlm` installs the pinned Python and native dependencies into gitignored repository caches. The host package manager supplies only build tools and platform interfaces. CMake and Ninja come from `requirements/fastflowlm.lock`. Python environment manifests live under `requirements/`. Each editable `.txt` source has a generated, hash-pinned `.lock` companion; setup profiles select the smallest environment that supports their build or test responsibility. This checkout pins Rust 1.97.0 for the FastFlowLM tokenizer build. HRX is installed to a clean prefix and FastFlowLM consumes its exported `hrx::hrx` CMake target. No HRX source or build-tree paths are part of the FLM build contract. ## Build the runtime and FastFlowLM Run the runtime and FastFlowLM workflow on either platform. Use the matching native command shell: Windows (PowerShell): ``` git clone https://github.com/ROCm/FastFlow-SDK.git cd fastflow git submodule update --init projects/hrx git submodule update --init --recursive projects/FastFlowLM python dev.py setup --profile fastflowlm python dev.py doctor fastflowlm python dev.py build hrx --fresh python dev.py build fastflowlm --fresh python dev.py test-fastflowlm ``` Linux (Bash): ``` git clone https://github.com/ROCm/FastFlow-SDK.git cd fastflow git submodule update --init projects/hrx git submodule update --init --recursive projects/FastFlowLM python3 dev.py setup --profile fastflowlm python3 dev.py doctor fastflowlm python3 dev.py build hrx --fresh python3 dev.py build fastflowlm --fresh python3 dev.py test-fastflowlm ``` `build fastflowlm-xrt` builds a diagnostic, XRT-backed FastFlowLM into a separate `build/FastFlowLM-xrt-install/` tree (never shipped in the HRX wheels). It links the host XRT install discovered from `$XILINX_XRT`, the platform default (`/opt/xilinx/xrt` on Linux; Program Files or `C:\Xilinx\XRT` on Windows), or an XRT runtime already on `PATH`. It installs an FHS `bin/flm` tree; it does not bundle a relocatable XRT runtime. Point `fastflow qualify --bench --xrt-flm ` or `fastflow qualify --all-models --xrt-flm ` at this tree for the optional HRX-vs-XRT comparison (decode metrics on `--bench`; greedy numerical match of the single-prompt run on `--all-models`). Qualification sets `XILINX_XRT` and the loader path (`LD_LIBRARY_PATH` on Linux, `PATH` on Windows) only on that comparison child. ``` python3 dev.py build fastflowlm-xrt --fresh ``` `package-fastflowlm` creates a relocatable Windows `.zip` or Linux `.tar.zst`, verifies it, and re-extracts it under `build/FastFlowLM-extracted/`. To recheck the packaging prerequisites and create the archive, run: ``` python3 dev.py doctor fastflowlm-packaging python3 dev.py package-fastflowlm ``` To recheck the extracted archive later, run: ``` python3 dev.py verify-fastflowlm ``` The smoke test requires the amdxdna driver and an NPU. It prints the FastFlowLM transcript, rejects HRX runtime errors, requires the exact raw smoke phrase and a coherent benchmark summary, and validates the benchmark CSV under `build/FastFlowLM-smoke/`. ## Build the compiler stack Use this path when you need the source-built LLVM/IRON toolchain and the IRON end-to-end artifact checks. Use `python3` on Linux and `python` on Windows. `python dev.py --help` (Windows) or `python3 dev.py --help` (Linux) is the canonical, generated inventory of developer commands; use the same interpreter prefix with `dev.py COMMAND --help` for command flags. The stack, built from source against one ROCm LLVM except for the Peano wheel: ``` LLVM+MLIR (ROCm amd-llvm pin, LLVM 24) ──┐ ├─ iron-tools/IRON design ─ .xclbin Peano (llvm-aie wheel, AIE codegen) ─────┘ │ hrx-xclbinutil (xclbin packaging; vendored in mlir-aie) ───────────┘ ─ HRX amdxdna HAL extracts PDI ``` `hrx-xclbinutil` lives inside iron-tools at `projects/iron-tools/third_party/hrx-xclbinutil` (vendored in-tree). `dev.py build hrx-xclbinutil` builds that tree. Additional Linux prerequisites for the compiler-stack flow (CMake and Ninja come from the uv-managed environment after setup): ``` sudo apt-get install -y gcc g++ python3-dev git make libssl-dev ``` Linux uses **gcc** by default. To build with clang locally, install `clang lld` and set `CC=clang CXX=clang++`. On Windows, open Git Bash from a Visual Studio developer environment and use the MSVC toolchain with `clang-cl`. Install the OpenSSL development files and set `OPENSSL_ROOT_DIR` to their installation. CMake and Ninja come from the Python environment on both platforms. On Windows, configure Git before initializing the submodules: ``` git config --global core.autocrlf false git config --global core.eol lf git config --global core.longpaths true ``` These settings keep the source and patch files in LF format and allow long Windows paths. Set `CC` and `CXX` to `clang-cl` in the Visual Studio developer environment before running the Windows commands below. Linux: ``` git submodule update --init --recursive projects/iron-tools python3 dev.py doctor compiler-stack # quick post-setup check: prereqs, pins, patches, prefetch python3 dev.py doctor compiler-stack --deep # also replay every patch series in a temporary Git index python3 dev.py setup # .venv + cached uv install; cmake/ninja/Peano from wheels python3 dev.py build hrx-xclbinutil python3 dev.py build llvm # LLVM+MLIR from the amd-llvm pin python3 dev.py build iron-tools # aie-opt/aie-translate/bootgen against build/llvm python3 dev.py build hrx # the amdxdna HAL (IREE runtime) python3 dev.py build all # native CLI + compiler stack + HRX, in order python3 dev.py test [DESIGN] # e2e build test, no NPU run python3 dev.py test-npu-jit --build-only # compiler + IRON JIT smoke, no NPU run python3 dev.py test-iron-ops [OP] # build the iron-ops operators, no NPU run python3 dev.py deps # print requirements/compiler-stack.txt ``` Windows (Git Bash): ``` git submodule update --init --recursive projects/iron-tools python dev.py doctor compiler-stack # quick post-setup check: prereqs, pins, patches, prefetch python dev.py doctor compiler-stack --deep # also replay every patch series in a temporary Git index python dev.py setup # .venv + cached uv install; cmake/ninja/Peano from wheels python dev.py build hrx-xclbinutil python dev.py build llvm # LLVM+MLIR from the amd-llvm pin python dev.py build iron-tools # aie-opt/aie-translate/bootgen against build/llvm python dev.py build hrx # the amdxdna HAL (IREE runtime) python dev.py build all # native CLI + compiler stack + HRX, in order python dev.py test [DESIGN] # e2e build test, no NPU run python dev.py test-npu-jit --build-only # compiler + IRON JIT smoke, no NPU run python dev.py test-iron-ops [OP] # build the iron-ops operators, no NPU run python dev.py deps # print requirements/compiler-stack.txt ``` The Windows CI uses the quick compiler-stack doctor check above; the `--deep` patch replay is currently part of the Linux validation path. Use `dev.py COMMAND --help` for the available options. Build-only works on a host without an NPU. The **e2e test** builds an iron-tools IRON design (`programming_examples/basic/matrix_scalar_add` by default) end-to-end to a `.xclbin` with the source toolchain, then verifies that the amdxdna HAL extracts the same PDI bytes as bootgen. Running on hardware needs the amdxdna driver and an NPU. Another design can be passed as `DESIGN`, but it must be Peano-capable and use `makefile-common`'s `jit_xclbin` rule. The `jit_xclbin_elf` designs additionally emit `insts.elf` using the pinned `aiebu-asm` built by `dev.py build all` and shipped in the compiler product. **`test-iron-ops`** builds the same chain from the other direction: the `iron-ops` operator library (`ElementwiseAdd`, ...) rather than an iron-tools example, compiling mlir-aie's `aie_kernels/*.cc` through Peano. iron-ops is developed against the `mlir_aie` *wheel*, so this is what catches its drift from our source pin, without an NPU. Which operators it covers is [`build_tools/iron.py`]() `OPERATORS`; adding a row extends it. On a machine **with** an NPU, `dev.py test-npu` dispatches an iron-tools design through the HAL, `dev.py test-npu-jit` compiles and dispatches the `@iron.jit` smoke design, and `dev.py test-npu-iron-ops` runs the iron-ops operators' own tests on the device (their references, their tolerances) with `NPU_RUNTIME=hrx`. The latter needs their test deps: `dev.py setup --iron-ops-tests` (torch, pytest -- see [`requirements/iron-ops-test.txt`](); the build path does not need them). # FastFlow SDK model qualification The `fastflow-sdk` release wheel from PyPI includes qualification. For a development build, install the optional qualification product from the [FastFlow SDK package index](): ``` python -m pip install --extra-index-url https://rocm.github.io/FastFlow-SDK/simple \ "fastflow-sdk-qualification==" ``` Candidate-bound runs (`--candidate-manifest`) check each installed component wheel against the candidate, so they need these component packages rather than the PyPI wheel, which `fastflow qualify` rejects for them. The package depends on the exact same-version `fastflow-sdk-fastflowlm`, which in turn depends on `fastflow-sdk-runtime`, and pins NumPy 2.5.3 and ml-dtypes 0.6.0. Pip resolves those binary dependencies from the package index. The candidate manifest binds their required versions, while each evidence bundle records the installed wheel tags, RECORD digest, and verified payload digest. Only the runtime wheel owns the `fastflow` entry point. The qualification wheel installs `fastflow-qualify`, discovered through the external plugin protocol. CI resolves Linux and Windows dependencies for every supported CPython ABI from the single numeric-runtime contract. Release assembly validates that complete dependency matrix without publishing the third-party wheels. List and run profiles through the native core: ``` fastflow plugin list --json fastflow qualify --list-profiles --json fastflow qualify --output qualification-evidence ``` Profiles are package JSON data conforming to `profile-v1.schema.json`. With no profile option, qualification runs the comprehensive `default` suite: Qwen3 0.6B, content-pinned Qwen3.5 0.8B, and LFM2 1.2B multi-turn, bounded-soak, and 1k/4k benchmark cases. Its measured warm-cache NPU2 runtime is kept below 15 minutes. `--fast` runs the CI gate: five fresh Qwen3 processes with two deterministic turns each, the production XCLBIN inventory, the 1k benchmark/CSV checkpoint, native self-test, the native powermode set/query checks for `balanced`, `performance`, and `turbo` with baseline restore, and the embedded FastFlowLM XADX stress set. `--profile extended` is an opt-in default-suite superset adding revision-pinned Llama 3.1 8B multi-turn, soak, and 1k/4k coverage, and a Qwen3.5 0.8B `vision`-kind test that sends a sequence of generated solid-colour images, up to 8k prompt tokens, through `flm serve` at original size, failing on HRX runtime errors, short prompts, or a wrong colour answer. Its Gemma 4 E2B soak serves `gemma4-open-it:e2b` through the `gemma4-open` model extension that the FastFlowLM wheel ships, so it covers the source-built engine rather than the prebuilt one. CI selects only `--fast`; default and extended are explicit qualification profiles for broader local or release validation. `--all-models` runs a complete sweep over *every* model in the installed FastFlowLM registry instead of a curated profile. Models are discovered dynamically from `model_list.json` at runtime, so their per-file and XCLBIN digests are not pre-pinned (identity still comes from the registry URL: `/resolve/` pins an immutable revision, other URLs are content-sourced). Each chat model runs a single-prompt turn, a five-turn multi-turn conversation, and a benchmark/CSV checkpoint; embed and ASR models are exercised through a `flm serve` probe (`serve`-kind evidence). The benchmark stage defaults to 8k context (a three-iteration `bench_8k_smoke.json` sweep) and can be set to `1k`, `4k`, or `8k` with `--bench-context`. Per-model timeouts scale with the model footprint and with the benchmark context length, and the sweep implies `--keep-going` so one failing model does not abort the run. Because it is a dynamic diagnostic sweep rather than a pinned profile, `--all-models` is meant for broad local coverage and is not a candidate-bound release path. `--bench` runs a measurement-only variant of the sweep. `MODE` selects the coverage; `--bench all` (the mode used when the flag is given bare) covers *every* model in the installed registry, but drops the correctness stages: chat models run *only* the on-NPU decode benchmark (no single-prompt or multi-turn turns), and embed/ASR models run *only* their serve-probe (the same encode-tok/s, RTF, and WER measurements the complete sweep records). It defaults to a `1k` context benchmark of five iterations; tune the context with `--bench-context <1k|4k|8k>` and the iteration count with `--bench-iterations ` (a positive integer). Pass `--models=[,...]` to narrow `--bench all` to an explicit subset of registry tags (tags absent from the installed registry are skipped with a warning); it has no effect without `--bench`. Like `--all-models`, `--bench` is a dynamic diagnostic sweep (not pinned, not candidate-bound) and implies `--keep-going`. `--bench dev` is the fast development variant of `--bench all`. It runs the same measurement stages with the same `--bench-context`/`--bench-iterations` tuning and the same `--models` and `--xrt-flm` modifiers, but over a curated set of chat tags (including the large `gpt-oss` and `qwen3.6-moe` MoE; never embed/ASR) instead of the whole registry. Curated tags absent from the installed registry are skipped with a warning. `--models` then further restricts that curated set: an installed tag that is not curated is skipped as missing from the curated set, not as missing from the registry. The speedup is fewer FastFlowLM tags -- native checks and the XADX kernel recipe still run at the same soak depth as `--bench all` (5/20/32). `--bench` already drops functional chat stages; XADX is a separate envelope. `--xrt-flm ` (meaningful with `--bench` or `--all-models`; Linux and Windows, requires a host XRT install) additionally exercises each model through an XRT-backed FastFlowLM build. `--bench` widens the report to a side-by-side HRX-vs-XRT metric comparison. `--all-models --xrt-flm` runs the single-prompt greedy chat on XRT and records an exact numerical match of `Model RAW Output` text. For chat models the benchmark table gains an XRT Status column plus XRT metric columns (`Model | XRT Status | XRT TTFT s | HRX TTFT s | XRT prefill tok/s | HRX prefill tok/s | XRT decode tok/s | HRX decode tok/s`); for embed/ASR models the Embedding and ASR probe tables gain XRT status and measurement columns (encode tok/s; RTF and WER). It is off by default -- simply supplying the path is what enables the comparison (there is no separate enable flag). Because the shipped wheel only bundles the HRX runtime, point `--xrt-flm` at a separately built XRT entrypoint (`bin/flm.exe` on Windows, `bin/flm` on Linux, or its FHS install root) produced by `python dev.py build fastflowlm-xrt`, which links the host XRT install discovered from `$XILINX_XRT`, the platform default (`/opt/xilinx/xrt` on Linux; Program Files or `C:\Xilinx\XRT` on Windows), or an XRT runtime already on `PATH`. Qualification sets `XILINX_XRT` and the loader path (`LD_LIBRARY_PATH` on Linux, `PATH` on Windows) only on that comparison child. XRT is strictly best-effort: the status column is `PASS`, `FAIL`, or `N/A` (unavailable build or host XRT); metric cells are `N/A` unless the comparison passed. Numerical-match cells are `MATCH`, `MISMATCH`, `FAIL`, or `N/A`. XRT never emits a separate test and never changes the run's pass/fail (so a fully passing HRX sweep still passes even when XRT is unavailable, fails, or mismatches). An unresolved `--xrt-flm` still stamps `unavailable` on every model so the XRT columns remain. In addition to the machine-readable bundle, the `--all-models` and `--bench` sweeps write a human-readable `report.md` into the output directory. It contains an environment header (OS, NPU device/driver/firmware candidates, target family, FLM and package versions), a per-model functional matrix (single-prompt, five-turn multi-turn, and whether the multi-turn run passed) where those turns ran, and an on-NPU benchmark table with the FLM-averaged TTFT, prefill, and decode throughput for each model. By default only HRX numbers are reported. The context stage and the iteration count the averages span (for example `HRX, 8k, averaged over 3 iterations`) are stated in the benchmark section heading rather than repeated per row. Profile runs (`--fast`, `--profile`) do not emit `report.md`; they produce only the evidence bundle (`evidence.json`, `tests.json`, `junit.xml`, and the summary). Qualification first validates plugin protocol and exact package versions, then runs native `version`, `probe`, `doctor`, and `self-test` through the absolute executable provided by the core. After those passive native checks pass, it records the baseline NPU powermode. On non-Linux hosts, qualification sets and queries back `balanced`, `performance`, and `turbo`, restores the baseline mode, and queries again. On Linux, qualification skips the mutating roundtrip by default because current AMDXDNA drivers require root privileges for power-mode sets; the passive `powermode` report still has to pass and is written as `artifacts/native/powermode-before.json`. It inspects the configured model cache and runs `flm pull ` when a model is missing. Pull and test output is captured in the evidence logs. `--no-pull` fails instead of downloading. `--offline` never invokes the network-backed `flm check` or `flm pull`. It resolves the model-specific directory and required files from the installed registry, applies offline and proxy-denial controls to inference, and fails if that local contract is incomplete. Linux powermode roundtrip records appear as `unsupported` in `tests.json` and as skipped in `junit.xml`; this is the only native skip that can coexist with an overall passing qualification run. Use `fastflow powermode ` manually, or run a non-Linux qualification host, when the mutating roundtrip itself must be exercised. The output directory is a complete report bundle. `evidence.json` records the overall result, package and candidate identity, source revision, observed driver/firmware/platform provenance, content-pinned model inventories, and every native, XADX, run, soak, and benchmark result. Successful native checks are recorded as tests, not merely omitted. `junit.xml` mirrors test outcomes; `core-version.json`, `probe.json`, `doctor.json`, `self-test.json`, `artifacts/native/powermode-*.json`, benchmark CSVs, per-command logs, and `SHA256SUMS` retain the underlying details. Useful options include: - `--model-cache ` - `--candidate-manifest ` - `--keep-going` - `--bench-context <1k|4k|8k>` (with `--bench` or `--all-models`; default `1k` for `--bench`, `8k` for `--all-models`) - `--bench [all|dev]` (measurement-only sweep; `all` covers the whole registry, `dev` a curated set of chat tags) - `--bench-iterations ` (decode-benchmark iterations per chat model for `--bench`; a positive integer, default `5`) - `--models [,...]` (restrict a `--bench` or `--all-models` sweep to explicit tags; with `dev`, further restricts the curated set; ignored without `--bench` or `--all-models`) - `--xrt-flm ` (with `--bench` or `--all-models`; Linux and Windows; add a best-effort HRX-vs-XRT comparison against a host XRT install, including greedy numerical match on the `--all-models` single-prompt run; off by default) - `--json` Profiles support ad-hoc diagnostics and candidate-bound release runs. Packaged profiles pin a canonical-JSON model registry digest and model file digests; the qualification wheel also contains a 53-case NPU2 kernel recipe covering seven distinct production implementations plus explicit execution variants. Those XADX executables embed the production XCLBIN and serialized control transactions. Inputs and expected outputs are generated deterministically at runtime from the qualification-owned capability contract. Reports bind the exact per-case dispatch/readback schedule, validated byte count, and deduplicated materialization inventory. Default 32x256 Q4NX parity is converter-backed; 32x128 and 16x128 are measured-fact C++/Python interpreter agreement, with the 53-case device run serving as the independent authority. See the [qualification evidence v1 contract]() for the exact identity, archive, and verification rules. ## Detached evidence collection and intake Linux publishes the canonical `py3-none-any` qualification wheel. Windows independently generates the same wheel. While Linux artifact scheduling is constrained, Windows NPU jobs install that Windows-local wheel; those runs validate the platform build but do not replace canonical candidate evidence. When a canonical artifact is explicitly supplied, the Windows workflow first matches normalized case, source-XCLBIN, transaction, serializer, and XADX hashes. Release assembly creates one candidate from all Linux and Windows runtime/FastFlowLM wheels and the canonical wheel: ``` fastflow qualify candidate \ --wheel-dir candidate/wheels \ --output candidate/candidate-manifest.json \ --expected-source-revision --json ``` The command infers the source revision from every wheel and rejects disagreement. It writes the strict candidate v1 `candidate-manifest.json` plus `candidate-SHA256SUMS`; the manifest and all FastFlow SDK wheels must share one artifact root. Transfer that complete release-wide candidate artifact to every manual hardware machine without rebuilding or selecting only one platform's identities. Treat `candidate-SHA256SUMS` as the publication commit marker: consumers must require it and verify every listed path before using `candidate-manifest.json`. Collect and seal one run in a single command: ``` fastflow qualify run \ --candidate-manifest candidate/candidate-manifest.json \ --model-cache \ --output-dir machine-run \ --bundle-output machine-run.evidence.zip --json ``` The directory remains available for diagnosis. Finalized pass, fail, and interrupted directories can also be sealed later with: ``` fastflow qualify pack \ --input machine-run --output machine-run.evidence.zip --json ``` ZIP output is deterministic and contains the finalized evidence files exactly as covered by the internal `SHA256SUMS`. Verify transferred evidence without NPU hardware, the core plugin environment, network access, or repository build tools: ``` fastflow qualify verify \ --input machine-run.evidence.zip \ --candidate-manifest candidate/candidate-manifest.json --json ``` Verification applies the archive, candidate, profile, model, platform-probe, execution-inventory, and checksum rules defined by the evidence contract. After transferring independently collected machine bundles into one directory, assemble release intake with: ``` fastflow qualify intake \ --input-dir incoming \ --candidate-manifest candidate/candidate-manifest.json \ --output-dir assembled \ --bundle-output qualification-evidence-.zip \ --policy release --require-status pass --json ``` Intake re-verifies every original bundle, preserves it unchanged under its SHA256 name, rejects duplicates and mixed/ad-hoc candidates, writes the versioned `qualification-index.json` and aggregate `SHA256SUMS`, then emits a deterministic aggregate ZIP and an external `qualification-evidence-.zip.sha256`. The checked-in `release` policy requires passing NPU2 `fast` evidence from both Windows and Linux and records the matched run digests in the index. Verify the final asset itself with: ``` fastflow qualify verify \ --input qualification-evidence-.zip \ --candidate-manifest candidate/candidate-manifest.json --json ``` Artifact transfer and publication remain manual. See [wheel releases]() for the operator flow; rebuilding any candidate wheel invalidates all collected evidence. Stage the flat GitHub-upload directory from the CI release payload plus intake outputs. The command copies exactly the product files listed in payload `SHA256SUMS` (including `SHA256SUMS` itself), the separate `candidate-manifest.json` / `candidate-SHA256SUMS` pair, ignores nested trees such as `simple/`, adds the aggregate ZIP, its `.sha256` sidecar, and `qualification-index.json`, re-verifies the aggregate, and fails if anything is missing or unexpected. The aggregate basename must be `qualification-evidence-.zip`, and `--output-dir` must be empty (or absent), matching intake: ``` fastflow qualify stage-release \ --payload-dir release \ --aggregate qualification-evidence-.zip \ --index assembled/qualification-index.json \ --output-dir github-upload \ --json ``` Upload every top-level file from `github-upload/` to the draft release. For a shared cache across worktrees: ``` $cache = 'C:\path\to\fastflow-sdk\.cache\FastFlowLM-models' fastflow qualify --model-cache $cache --output qualification-evidence fastflow qualify --profile extended --model-cache $cache --output extended-evidence fastflow qualify --all-models --model-cache $cache --output all-models-evidence fastflow qualify --all-models --bench-context 1k --model-cache $cache --output all-models-1k-evidence fastflow qualify --bench all --model-cache $cache --output bench-all-evidence fastflow qualify --bench all --bench-context 4k --bench-iterations 20 --model-cache $cache --output bench-all-4k-evidence # HRX-vs-XRT comparison against a host XRT install (Linux and Windows) # fastflow qualify --bench all --xrt-flm C:\path\to\build\FastFlowLM-xrt-install --model-cache $cache --output bench-all-xrt-evidence # fastflow qualify --all-models --models=qwen3:0.6b,llama3.2:1b --bench-context 1k --xrt-flm C:\path\to\build\FastFlowLM-xrt-install --model-cache $cache --output all-models-xrt-evidence fastflow qualify --bench dev --model-cache $cache --output bench-dev-evidence fastflow qualify --offline --no-pull --model-cache $cache --output offline-evidence ``` On Linux, use the equivalent absolute path. `FLM_MODEL_PATH` may be set instead of passing `--model-cache`. Diagnostics answer whether the package and bounded native dispatch work. Qualification executes profile-defined installed-product model cases and produces structured evidence. Release acceptance is a later policy and signing decision; a passing evidence bundle does not publish or accept a release by itself. # Third-party notices ## JSON for Modern C++ The native `fastflow` executable incorporates JSON for Modern C++, version 3.12.0, from https://github.com/nlohmann/json. Copyright © 2013-2025 Niels Lohmann. It is distributed under the MIT License. Products containing `fastflow` include the complete license as `licenses/nlohmann-json-LICENSE.MIT`. Vendored-file provenance and update instructions are recorded in [`third_party/nlohmann_json/README.md`](). ## LLVM OpenMP runtime The Linux FastFlowLM wheel and the Linux standalone archive include `libomp.so`, the LLVM OpenMP runtime, built from the `llvm-project` commit pinned in `manifests/versions.toml` (https://github.com/ROCm/llvm-project). FastFlowLM's engine libraries use it in place of the GCC OpenMP runtime. It is distributed under the Apache License v2.0 with LLVM Exceptions. Those products include the complete license as `licenses/llvm-openmp-LICENSE.TXT`.