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/<path> |
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¶
- Install from PyPI. Use
python -m pip install fastflow-sdkwith 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. - Do not install XRT or upstream
mlir-aiewheels into the same environment. The SDK ships its own compiler and the HRX runtime, and importingaieselects HRX. - Check the machine with JSON, not text. Run
fastflow doctor --json(orfastflow self-test --jsonfor a real dispatch). Readstatusand eachchecks[].id; look up every check that is notpassin Troubleshooting. Exit status is0for pass,1for a failed check,2for invalid input. Human output is not stable. - To run a supported model, serve it; do not write kernels. Start
flm serve <tag>and use the OpenAI API athttp://127.0.0.1:52625/v1with any API key. Tags are on Models. See Run and serve models. - 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(). - 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.
- Know the limits. NPU2 (XDNA2) only. Linux or native Windows, not WSL.
No
load_pdiorScratchpadParameterin@iron.jitsequences; aniron.Graphcompiled 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. - 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": "<version>", "source_revision": "<commit>", "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.