Coral NPU Full Stack Documentation

The Coral NPU stack spans three repositories that together form a complete pipeline for compiling and running ML models on Google’s Coral Neural Processing Unit:

Component Purpose Language

SKaiNET

Type-safe tensor DSL, computation graph construction, StableHLO MLIR export, optimization passes

Kotlin Multiplatform

iree-tools

StableHLO MLIR parser, C code generator, Bazel integration, simulator driver

Python (uv)

coralnpu

Hardware design (Chisel/Verilog), Bazel cross-compiler toolchain, MPACT behavioral simulator, bare-metal CRT

C / SystemVerilog / Python

coralnpu (Bazel)

iree-tools (Python)

SKaiNET (Kotlin)

.mlir

.cc + BUILD

Tensor DSL
dag { ... }

Tape Recording

StableHLO Export

MLIR Parser

C Code Generator

Bazel Builder

RV32 Cross-Compile

Bare-Metal ELF

MPACT Simulator

Documentation Structure (Diataxis)

This documentation follows the Diataxis framework:

Explanation (understanding-oriented)

Deep technical analysis of why the architecture works the way it does. Written for experienced ML engineers and data scientists who need to understand the compilation pipeline, hardware constraints, and design trade-offs.

Start here if you want to understand the full stack.

Tutorials (learning-oriented)

Step-by-step walkthroughs that take you from zero to a running model on the simulator. Follow along exactly to build working results.

Grayscale to Simulator — the canonical end-to-end example.

How-to Guides (task-oriented)

Concise recipes for specific tasks. Assumes you understand the basics and need to accomplish something concrete. Targeted at Android/Java developers integrating with the stack.

Set Up Java/Android Dev Environment is a good starting point for Android developers.

Reference (information-oriented)

Precise technical specifications — ISA details, memory maps, CLI flags, module inventories. Consult when you need exact values.

iree-tools CLI Reference documents every subcommand.

Quick Start

# 1. Export StableHLO MLIR from SKaiNET
cd SKaiNET
./gradlew :skainet-apps:skainet-grayscale-cli:run \
  --args="--input photo.jpg --model RGB2GRAYSCALE --verbose"

# 2. Transpile MLIR to C, build ELF, run on simulator
cd ../iree-tools
uv run python main.py run-all rgb2grayscale.mlir

Prerequisites

Tool Version Install

uv

Latest

curl -LsSf https://astral.sh/uv/install.sh | sh

jenv

Latest

git clone https://github.com/jenv/jenv.git ~/.jenv

JDK

21+

jenv add /path/to/jdk-21 after installing via your package manager

Bazel

7.4.1

Via Bazelisk: npm install -g @aspect-bazel/bazelisk

Python

3.11+

Managed by uv — no system install needed