Expand description
Native compute-graph op-node kernels — WGSL templates emitted directly from a graph
node (not delegated to a legacy BuiltinKernel emitter, since these op-classes have
no legacy standalone kernel). Each carries an exact CPU oracle and a GPU differential
certify, exactly like the rest of the forge.
Phase 2 lands the LLM-normalization building blocks: reduce (RMSNorm variance /
softmax max+denominator) and broadcast (scale/bias fanout). They are lowered from
OpNode::Reduce / OpNode::Broadcast by the WGSL graph lowerer. See
[docs/plans/dag-ir-forge.md].
Modules§
- broadcast
- Native
Broadcastop-node — tile a vector across a larger output by index remap (out[i] = input[i % in_len]). This is RMSNorm/bias scale-fanout: a per-feature vectorscale[d]expanded across tokens soout[t*d + j] = scale[j]. No arithmetic, one invocation per output element. - elementwise
- Native
Elementwiseop-node — per-element maps, the LLM activation/arithmetic kit. - executor
- Multi-node graph executor — the keystone that runs a whole [
ComputeGraph] on the GPU with intermediates kept device-side, plus a topologically-composed CPU oracle. This is what unblocks softmax, RMSNorm, the SwiGLU-FFN block, and the full LLM decode DAG. See [docs/plans/dag-ir-forge.md] §7–§9. - gather_
dequant - Native
GatherDequantop-node — on-the-fly ternary weight dequant producing an f32 tensor that a downstreamMatMulconsumes (the{GatherDequant → MatMul}split, plan §2 / P4b). This is the LLM weight-decompression primitive: BitNet-style 2-bit ternary codes unpacked to{0, +1, −1}and scaled per row. - neighbor
- Native
Neighborop-node — spatial proximity queries (Frnn/Knn/Range): the SPH / N-body cutoff and the ANN/kNN candidate-generation primitive (plan §2/§6, P7). - p64_
bridge - p64 → forge bridge: read a transcoded model’s role-tagged weights out of a p64 volume as f32, laid out for the forge decode-layer graph.
- reduce
- Native
Reduceop-node — the first compute-graph node the WGSL backend emits from scratch (Phase 1’s gemm/gemv/fft delegate to legacy emitters; there is no legacy standalone reduce, so this is a real graph-template lowering). - scatter
- Native
ScatterAccumop-node — scattersrc[p]intooutput[idx[p]]with an associative accumulate (plan §2 / P7): the SPH density/force deposit and N-body short-range gather. - slice
- Native
Sliceop-node — extract a contiguous sub-rangeinput[offset .. offset+len]. - stencil
- Native
Stencilop-node — local neighbourhood maps over a 1-D grid (plan §2 / P7). The seed kind is the Laplacianout[i] = in[i-1] − 2·in[i] + in[i+1]with zero (Dirichlet) boundaries — the discrete Poisson operator under fluid pressure-solve / diffusion, and theReduce-free half of a stencil sweep. - vision
- Vision op-node kernels (V3b): Pool2D, Resize2D, Conv2D — WGSL + CPU oracles.