Skip to main content

Module shaders

Module shaders 

Source
Expand description

WGSL compute shaders for GPU operations

Modules§

backward
WGSL backward (gradient) shaders for training

Constants§

CAUSAL_ATTENTION_SHADER
Causal multi-head attention (WGSL) — scaled dot-product with GQA
COLUMN_GATHER_SHADER
Column gather shader — extracts columns from a wide matrix into a chunk.
COLUMN_SCATTER_SHADER
Column scatter shader — copies chunk columns into a wider row-major matrix.
LORA_ADDMM_SHADER
Fused LoRA addmm: output += (input @ A) @ B * scale
MATMUL_SHADER
Matrix multiplication compute shader (WGSL) — tiled shared memory
TILED_GEMM_SHADER
CUTLASS-style tiled GEMM compute shader (WGSL) — 64×64 output tiles
TRANSPOSE_SHADER
Scaled transpose: B[j,i] = scale * A[i,j] Contract: wgsl-transpose-v1