Skip to content

Commit aba3812

Browse files
Merge pull request #776 from SKaiNET-developers/docs/architecture-codegen-siblings
docs(readme): frame StableHLO/MLIR as a sibling code-gen backend
2 parents c785151 + 3ce56eb commit aba3812

1 file changed

Lines changed: 24 additions & 9 deletions

File tree

README.md

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -145,26 +145,41 @@ Quick local replay:
145145
## Architecture goal
146146

147147
SKaiNET is built around one path: **a model is defined once in the Kotlin DSL,
148-
then either compiled to native code or executed eagerly — without rewriting it.**
148+
then either compiled or executed eagerly — without rewriting it.**
149149

150150
1. **Define** the model with the DSL (`nn { }` / `dag { }`).
151-
2. **Capture** it as a *tape* (traced execution) or a *DAG* (explicit graph).
151+
2. **Capture** it as a *tape* (traced execution) or a *DAG* (explicit graph) — a `ComputeGraph`.
152152
3. **Run** it one of two ways:
153-
- **Compile** — lower the graph to MLIR / StableHLO (`HloGenerator`) and
154-
compile to **native** code (IREE-compatible) for native / edge targets.
153+
- **Compile** — lower the captured `ComputeGraph` through one of several
154+
**sibling code-generation backends**, each emitting code for a different target
155+
from the *same* graph:
156+
- **StableHLO / MLIR** (`HloGenerator`) → IREE-compilable, for native / edge /
157+
accelerator targets and the wider MLIR ecosystem.
158+
- **Arduino / C99** → standalone, statically-allocated C for microcontrollers.
159+
- **Minerva** → a secure-MCU bundle (weights + firmware skeleton + fingerprinted
160+
manifest).
155161
- **Eager** — execute directly on an available backend. On the **JVM this is
156162
the primary, go-to path.**
157163

164+
StableHLO/MLIR is therefore **one code-generation backend among siblings** — the
165+
IREE/native path next to the C99/Arduino and Minerva MCU paths — not a separate
166+
pipeline.
167+
158168
```mermaid
159169
flowchart LR
160-
DSL["Model — Kotlin DSL"] --> Graph["Tape / DAG"]
161-
Graph --> HLO["MLIR / StableHLO"]
170+
DSL["Model — Kotlin DSL"] --> Graph["Tape / DAG (ComputeGraph)"]
162171
Graph --> Eager["Eager backend (JVM, …)"]
163-
HLO --> Native["Native code"]
172+
Graph -->|code generation| HLO["StableHLO / MLIR"]
173+
Graph -->|code generation| C99["Arduino / C99"]
174+
Graph -->|code generation| Minerva["Minerva"]
175+
HLO --> Native["IREE → native / edge / accelerator"]
176+
C99 --> MCU["Microcontroller"]
177+
Minerva --> SecMCU["Secure-MCU bundle"]
164178
```
165179

166-
The same DSL model feeds both paths — eager execution for development and JVM
167-
deployment, the StableHLO path for native and edge targets.
180+
The same DSL model feeds every path: eager execution for development and JVM
181+
deployment, and the code-generation backends — StableHLO/MLIR (→ IREE), Arduino/C99,
182+
and Minerva — as **sibling alternatives** for native, edge, and secure-MCU targets.
168183

169184
---
170185

0 commit comments

Comments
 (0)