Architecture
Source, to graph,
to silicon.
flowg has two halves that share one vocabulary: the graph
VM that executes and lowers a FunctionGraph,
and the model zoo of imperative
inference runtimes that prove the op kernels. Both denominate cost in picojoules.
1
Front-ends Lux · JMax · Joule · PyTorch FX · GGUF
Each lowers its own surface into the one graph type. Languages differ in syntax, not in target.
2
Unified IR lux_flowg::graph::FunctionGraph
Nodes + resource-semantic wires. A DAG of ~28 node kinds, 11 wire kinds, Custom(op) as the open extension point.
3
Execute flowg-vm-scheduler
One async task per node. A placement pass routes each op to the lowest-joule backend; uncovered ops fall through to a CPU reference path.
4
Lower flowg-emit-*
Source-to-source emitters: WGSL, WASM, ONNX, StableHLO, MLIR-linalg, Triton, and flowg’s own .fg binary.
5
Devices CPU · Metal · AMX · MPS · CUDA · WebGPU · Wasm
Heterogeneous op kernels (flowg-op-*). The same graph runs native and in the browser.
6
Receipt EnergyEstimate { picojoules, measured }
Every dispatch carries a cost; placement prefers measured calibration over the analytical prior.
Heterogeneous by default
Each kernel claims one or more ops. The placement pass selects among the ones available on the machine by joules — CPU is the fallback link, never the default.
op-blas
matmul → Accelerate / OpenBLAS / MKL
op-metal
fused MSL kernels (silu, rms_norm, matmul/swiglu)
op-qmm
quantized matmul direct from GGUF blocks
op-mps
MetalPerformanceShaders matmul
op-cuda
cuBLAS via the CUDA driver API
op-amx
Apple AMX coprocessor GEMM tiles
op-ssm
fused Mamba-2 selective scan
op-attention
fused scaled dot-product attention
op-moe
top-K mixture-of-experts router
What runs today
Model runtimes, op kernels, emitters, .fg formatrunning
VM backends — CPU, WebGPU, Wasmrunning
Capability runtime (Ed25519 delegation)running
Energy routing — the placement decisionrunning
Device execution via the full Backend HALin progress
Cross-substrate measured calibration tablein progress
Typed (non-string) graph IRplanned