For the complete documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /get-started.md).
Mojo struct
MatmulSwiGLU
struct MatmulSwiGLU
Fused GEMM+SwiGLU on SM100 for BF16 inputs.
Computes output[m, h] = silu(x @ W_gate[h, :]) * (x @ W_up[h, :])
in a single SM100 kernel. The weight b must be pre-permuted on its N
axis so that gate/up column pairs are adjacent (sigma permutation:
sigma(2i)=i, sigma(2i+1)=H+i where H=N/2).
Output shape is [M, H] where H = N/2, saving the slice+silu+mul
elementwise kernel entirely.
Implemented traitsโ
Methodsโ
executeโ
static def execute(output: T, a: T, b: T, ctx: DeviceContext)