Cormorant: neural networks on a board that costs 250 EUR
Within the dAIEDGE programme, funded by the European Union, we built Cormorant: an open-source path from a trained neural network to a low-cost FPGA board, with every step of the data movement under our control and a scheduler whose correctness is proven.
- ×60 peak convolution throughput on the board, 0.031 to 1.903 GOps/s
- 220/s MNIST inferences at 98.92% top-1 accuracy
- 0.387 W the whole accelerator: four kernels, bus and on-chip memory
- 5 of 6 project KPIs met; the sixth met in part
Why it matters
Running AI on a device, rather than in a data centre, usually means expensive hardware or a closed accelerator you cannot look inside. Cormorant shows another way: a board that costs about 250 EUR, an accelerator that draws 0.387 W, and code that anyone can read, change and reuse.
A new model does not need new hardware. The chip is configured once, and switching to another network is a recompilation that takes minutes. The part that decides how data moves is proven correct, so the results can be trusted and repeated.
- Hardware under 250 EUR instead of costly accelerator cards
- 0.387 W for the whole accelerator, about 3.1 W for the board
- Open code under Apache 2.0, free to use commercially
- A new model in minutes, without rebuilding the hardware
- A scheduler verified in Lean 4, with a guide to reproduce every measurement
Who it is for
Engineers who want to run a trained ONNX model on an affordable FPGA board and keep control over every step between the model and memory.
Researchers working on edge AI, data movement or verified scheduling, who need an open, reproducible baseline they can measure and extend.
Teams for whom power matters: devices on batteries or in places where a few watts make the difference.
Universities and training programmes that teach hardware for AI and need a complete example from a model file down to the kernels on the chip.
The task
A neural network is millions of numbers called weights. On a low-cost FPGA board the chip has little memory of its own, so the model does not fit. The weights stay in external DDR memory and have to be brought onto the chip in portions, again and again, while the network runs.
Our assignment in Challenge 9 of the dAIEDGE Open Call was to optimise exactly this movement: which portions to bring, in which order and at what moment. The board is an AMD Kria KV260, which costs about 250 EUR.
Why we built our own
We tried existing tools first, twice. AMD's own accelerator for neural networks works well, and we deployed it and profiled three models end to end: latency per layer, DDR traffic and power. Those measurements became the baseline we compared against. But it is closed: we could measure it, not steer it, and our task was about what happens inside.
Then we took FPGAConvNet, an open academic project, brought it up on a current toolchain, synthesised a fragment of VGG16 and ran it on the board. That works too, and we published the updated port. But the project was built for a different class of devices and a generation of tools that no longer exists.
Both experiments gave the same answer: you cannot optimise what you do not control.
What we built
Cormorant takes a trained model in the standard ONNX format. Its scheduler decides what to load and when, where each tensor lives and which memory can be reused. The output is a generated C project that drives four HLS kernels on the board: convolution, matrix multiplication, pooling and vector operations.
The hardware is synthesised once. A new model is a software recompilation that takes minutes, not a hardware rebuild that takes hours. There is no closed vendor block between the model and external memory.
ONNX model
Schedulerverified in Lean 4
FPGA, four HLS kernels
- convolution
- matrix multiply
- pooling
- vector ops
External memory
- Peak convolution throughput
- 0.031 → 1.903 GOps/s
- MobileNetV1 memory pool
- 27.3 → 11.1 MiB
- MNIST top-1, full test set
- 98.92%
- Programmable logic power
- 0.387 W
A scheduler that is proven, not assumed
The scheduler builds a producer and consumer graph over the ONNX model. Independent operators run at the same time on different kernels. Memory is recycled as soon as a tensor is no longer needed: for MobileNetV1 this cut the memory pool from 27.3 to 11.1 MiB.
The correctness of the scheduling and of the buffer reuse is formalised and mechanically verified in Lean 4. Testing shows that the cases we tried work; the proof covers every case.
Inside the kernels
The convolution kernel is a five-stage dataflow pipeline: weight stream, line buffer, patch stream, sixteen multiply-accumulate units and an UltraRAM accumulator. Sixteen parallel multiply-accumulate units cut simulated time by 21.8%, weight caching by 31.7% and the patch stream by 30.2%. Together the optimisations reduced total simulated time by 63.9%.
Moving the accumulator to UltraRAM lowered block RAM use from 45% to 27%, and 16×16 multiplication instead of 32×32 let the design meet its timing.
The design on the chip
All four kernels sit on one bus in one bitstream that stays loaded. The design runs at 100 MHz with a timing margin of +1.285 ns, and the chip stays at 32 °C against a limit of 78 °C. About a third of the chip is in use.
| Resource | Used | Available |
|---|---|---|
| LUT | 41 691 | 117 120 (35.6% used) |
| DSP | 368 | 1 248 (29.5% used) |
| UltraRAM | 16 | 64 (25.0% used) |
Measured results
Unless stated otherwise, the figures were measured on the physical board, not in simulation.
| Metric | Before | After |
|---|---|---|
| Peak convolution throughput | 0.031 GOps/s | 1.903 GOps/s (×60) |
| The same 3×3 convolution, 1 to 32 channels, 28×28 map | 14.58 ms | 5.96 ms |
| Pooling kernel bandwidth | 0.036 GB/s | 0.133 GB/s |
| Convolution kernel, RTL simulation | 2.8× faster overall, 7.0× on the heaviest case | |
| MobileNetV1 memory pool | 27.3 MiB | 11.1 MiB |
| MNIST, full 10 000-image test set | 98.92% top-1, 4.546 ms per image, about 220 per second | |
| LeNet variant | 97.35% top-1, about 18 per second |
Power: the accelerator is the cheap part
Under load the board's silicon draws 3.108 W. The ARM processor cluster, the DDR controller and the processor-side bus take 2.417 W of that. All of our programmable logic, the four kernels with their bus and on-chip memory, takes 0.387 W: six times less than the processor side.
The accelerator the project was about costs almost nothing in power. The system around it pays.
Programmable logic: clocks 0.065 W, logic 0.086 W, signals 0.104 W, block RAM 0.048 W, UltraRAM 0.013 W, DSP 0.071 W; device static power 0.304 W. The board's own sensor reads 3.2 to 3.4 W.
How we checked it
- 1 301 scheduler tests in continuous integration
- 148 kernel tests in C simulation and cycle-accurate RTL simulation
- A 48-case integrated testbench through the shared AXI bus
- A 48-case benchmark on the physical board
- Scheduling and buffer-reuse correctness verified in Lean 4
Three demonstrators on hardware
- Batch MNIST recognition
- ImageNet classification with MobileNetV1, MobileNetV2 and ResNet-18
- Live MobileNetV1 classification from an Intel RealSense camera, running on Cormorant's own kernels with no vendor accelerator in the path
What is left
The target of 15 images per second is met on MNIST (220 per second) and LeNet (18 per second). It is not yet met on large ImageNet networks with 224×224 images, which run at 0.4 to 0.5 per second.
The cause is measured: the design uses 368 of the chip's 1 248 DSP blocks, and the convolution performs 16 multiplications per cycle where the silicon allows 128. The room for the fix is already on the chip.
- Restructure the convolution as a true two-dimensional multiply-accumulate array, with an expected gain of about ×8
- Run 1×1 convolutions as dense matrix multiplication; a prototype is built
- Add an on-chip tensor cache and a controller on the FPGA side to remove round trips to DDR between layers
Project and team
Cormorant was developed by GradeBuilder S.L. within the dAIEDGE Open Call Programme, Open Call 2, Challenge 9, as project Simfero (dAI2OC10), funded by the European Union under Horizon Europe grant agreement No 101120726. The team: Oksana Dikareva, Iuliia Gorshkova and Ivan Gubochkin.
The code is open under Apache 2.0: kernels, scheduler, build scripts and a guide to reproduce the results. Anyone with a Kria KV260 and a model in ONNX format can use it, including commercially.
- Cormorant on GitHub Source code under Apache 2.0, with instructions to reproduce the results.
- dAIEDGE: winners of the second open call GradeBuilder SL is listed for Challenge 9 under the project acronym Simfero.
Questions and answers
What is Cormorant?
An open-source framework (Apache 2.0) by GradeBuilder S.L. that runs neural network models in ONNX format on an AMD Kria KV260 FPGA board, which costs about 250 EUR.
What problem does it solve?
On a low-cost FPGA the model does not fit in on-chip memory, so weights have to be moved from external memory in portions. Cormorant's scheduler decides what moves, in which order and when, and reuses memory once a tensor is no longer needed.
How is Cormorant different from FINN, hls4ml or FPGAConvNet?
The hardware is synthesised once and a new model is a software recompilation, not a hardware rebuild. The scheduler is formally verified in Lean 4.
What does "verified in Lean 4" mean?
The arguments for the correctness of the parallel scheduling and of the buffer reuse are written as formal statements and checked by the Lean 4 proof assistant, so they hold for every case, not only for the tested ones.
How fast is it?
Peak convolution throughput rose from 0.031 to 1.903 GOps/s. MNIST runs at about 220 images per second with 98.92% top-1 accuracy. Large ImageNet networks run at 0.4 to 0.5 images per second today; the next step is expected to give about ×8 on convolution.
Who funded the work?
The European Union, through the dAIEDGE Open Call Programme under Horizon Europe grant agreement No 101120726.
Read the code, reproduce the numbers
The repository contains the framework, the tests and the steps to repeat the measurements on a Kria KV260.
Looking for the courses? gradebuilder.tech
Products
Impact