A DSL compiler for high-performance ML kernels.
Write plain scalar loops — no intrinsics, no CUDA, no shader code.
The compiler turns them into hardware-optimized kernels across every backend.
If these numbers match the workloads you care about, we'd like to hear from you.
The kernel defines what to compute. The schedule defines how fast.
kernel.blz
fn kernel_main(A: array[f32],
B: array[f32], C: array[f32],
M: i32, N: i32, K: i32) {
for (var i = 0i; i < M; i = i + 1i)
for (var j = 0i; j < N; j = j + 1i)
for (var k = 0i; k < K; k = k + 1i)
C[i*N+j] = C[i*N+j]
+ A[i*K+k] * B[k*N+j];
}
Plain scalar loops. No intrinsics.
matmul.lum
schedule MatMul(blaze.loop_nest) {
tile [64, 64, 64]
parallel
unroll j 4
microkernel f32 [32]
}
Controls tiling, parallelism, vectorization.
terminal
$ blaze matmul.blz \
--schedule matmul.lum \
--emit-mlir -o kernel.o
$ gcc -shared -o kernel.so \
kernel.o -lblaze_runtime
1024×1024 f32 matmul
1045 GFLOPS (99% peak)
Same source. Any backend.
Measured on Zen 4 (8 cores pinned) and RTX 4090. Qwen numbers use SDK-built kernels and Q4_K_M GGUF weights.
Prefill rates are reported with prompt shape: 9B uses 256 prompt tokens and chunk 256; 27B uses 2048 prompt tokens, chunk 2048, and max_seq 4096. Decode rows use 16 generated tokens.
One kernel source. Five hardware targets.
AVX-512 · VNNI · OpenMP
NEON · SME · M-series
Tensor Cores · PTX · CUDA Graph
Compute shaders · Apple GPU
Experimental · Private API
The compiler auto-detects loop nests from plain scalar code — no annotations, no pragmas, no intrinsics. The Lum schedule is the tuning surface.
schedule QwenDecode(blaze.loop_nest) {
// Shape dispatch — each matvec gets optimal tiling
where bounds = [3584, 18944] {
tile [1, 3584, 592]
parallel
unroll j 4
microkernel q4k [32]
weight_format "q4k"
}
where bounds = [18944, 3584] {
tile [1, 18944, 448]
parallel
unroll j 4
microkernel q4k [32]
weight_format "q4k"
}
}
schedule BF16Matmul(blaze.loop_nest) {
tile [128, 128, 32]
gpu_threads [16, 16]
warp_tiles [1, 8]
tile [8, 8, 1] register
maxnreg 160
}
// 127.6 TFLOPS at 4096×4096
// m16n8k16 BF16 MMA
// cp.async + ldmatrix.trans