Knok: Tensor Graphs as Rust Build Artifacts
Rust Machine Learning MLIR IREEKnok is a static-shape tensor graph compiler for Rust. You define a graph in build.rs; Knok traces it during cargo build, lowers it to MLIR, compiles it with IREE, and generates a typed Rust wrapper around the result.
If those names are unfamiliar, MLIR is compiler infrastructure for representing and transforming programs at several levels, while IREE is an ML compiler and runtime built on top of it. In Knok, MLIR is the intermediate form where tensor operations can be checked and optimized, and IREE turns that graph into executable code for a CPU or GPU and provides the runtime used to load and run it.
Read more...