Yimin Gao

Yimin Gao

Ph.D. Student
University of Virginia
yg9bq@virginia.edu

FlexNPU

An open, end-to-end NPU research platform, from PyTorch to RTL on an FPGA

Running end-to-end on FPGA · open-source release planned

An NPU is only as fast as the operators it can’t run. Every operator that falls back to the host CPU costs a round trip: data out to the CPU, compute on a core that was never meant for it, data back. On an edge SoC, those fallbacks can end up dominating the whole model.

FlexNPU’s goal is to run the full ML operator set on the accelerator, so a model never has to go back to the CPU. The other goal is to expose the whole stack, from the PyTorch model down to the RTL, so other researchers can build on it.

Full operator coverage

Each class of operator has a home on the NPU.

Every operator class maps to a unit on the NPU Three operator classes on the left map to three units inside the NPU: GEMM and convolution to the matrix engine, reductions such as softmax and normalization to the vector unit, and everything else to the RISC-V core. The host CPU is drawn faded at the bottom with a crossed-out fallback path. ML operators GEMM · convolution softmax · norms · reductions control · everything else FlexNPU matrix engine (systolic) vector unit (reduction path) RISC-V core host CPU no fallback
GEMM goes to the matrix engine, reductions to the vector unit, and the rest to the RISC-V core, so nothing has to go back to the host CPU.

The matrix engine is a systolic array for GEMM and convolution. The vector unit provides the reduction path, for operators like softmax and normalization. A RISC-V core inside the NPU handles control and the remaining operators that fit neither. Data moves through on-chip scratchpad memory with dedicated load and store DMA engines.

Several ML models already run end-to-end on the FPGA. Coverage isn’t at 100% yet, and closing that gap is the current work.

From PyTorch to RTL

FlexNPU is one flow, not a hardware demo and a software demo side by side. A PyTorch front end feeds custom MLIR/IREE passes that lower each operator onto its unit. A C/C++ runtime on the Zynq’s ARM host launches the compiled program. The design itself is RTL running on a Xilinx Kria KV260. Custom quantization is supported through the whole flow.

The compiler reaches the hardware through a register and DMA interface rather than a fixed tile size. You can swap an RTL datapath variant without rebuilding the compiler or recompiling the model, so a single design change can be measured end-to-end in isolation.

Built to be tuned

The platform exposes knobs at every layer, and it lets you see what they do:

NPU design space exploration

With counters on the board and a simulator next to it, FlexNPU supports design space exploration of the whole NPU and its host. Tools like Timeloop and MAESTRO model the accelerator in isolation and leave the host out. One thing whole-system exploration shows: growing the matrix engine can shift the bottleneck somewhere else, so the best use of area interleaves sizing the array with widening operator coverage.

Running end-to-end on FPGA. Ongoing project; open-source release planned.


© 2026 Yimin Gao · Last updated November 2026 · Powered by Jekyll and Minimal Light