Skip to main content

Module fuse

Module fuse 

Source
Expand description

Kernel fusion via runtime WGSL codegen — the seed of Ferric’s optimizing compiler. An elementwise expression over input tensors is compiled to ONE WGSL kernel and dispatched once: no per-op intermediate buffers, no per-op dispatch/readback. E::input(0).silu().mul(&E::input(1)) (a SwiGLU gate) becomes a single kernel instead of two ops + a temp. SSA codegen with common-subexpression sharing (each DAG node emitted once). This is what closes the perf gap with hand-fused C++/CUDA.

Structs§

E
An elementwise expression (a DAG over input tensors). Build it, then eval compiles + runs it.

Functions§

eval
Compile the expression to one kernel and run it over inputs (all same shape). Returns one tensor.