IMPORTANT: To view this page as Markdown, append `.md` to the URL (e.g. /max/get-started.md). For the complete documentation index, see llms.txt.
Skip to main content
For the complete documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /max/get-started.md).

Mojo struct

MatmulSwiGLUBias

struct MatmulSwiGLUBias

Fused GEMM+SwiGLU+bias on SM100 for BF16 inputs.

Like mo.matmul_swiglu but adds a 1D bias vector before the activation. The bias must be sigma-permuted to match the weight layout: even element bias[2h] is added to the gate column and odd element bias[2h+1] to the up column before silu(gate) * up is computed.

Implemented traitsโ€‹

AnyType, ImplicitlyDeletable

Methodsโ€‹

executeโ€‹

static def execute[target: StringSlice[ImmStaticOrigin]](output: ManagedTensorSlice[IOSpec[_, _].Output, static_spec=output.static_spec], a: ManagedTensorSlice[IOSpec[_, _].Input, static_spec=a.static_spec], b: ManagedTensorSlice[IOSpec[_, _].Input, static_spec=b.static_spec], bias: ManagedTensorSlice[IOSpec[_, _].Input, static_spec=bias.static_spec], ctx: DeviceContext)

Was this page helpful?