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 module

iglp

IGroupLP sched_group_barrier aggregate-pair helpers for AMD MHA.

Comptime-recursive expansions of the reference's sched_barrier_pairs<Pairs, VALU_CNT, Group> and sched_barrier_exp_pairs<...> C++ templates (see the reference attn/gqa_causal/kernel.cpp:44-56).

These helpers prescribe IGroupLP groupings to LLVM's AMDGPU instruction scheduler via the llvm.amdgcn.sched.group.barrier intrinsic. They were defined identically across several attention kernels and pulled here to a shared module: one place to fix as the language evolves, no duplication. Current consumers: mha_prefill_v2, mla_prefill, mla_prefill_v2, mla_components.

Per-kernel hint-pair parameters (which N, M for QK / PV / EXP cluster types) are tuned via parameter sweep at the kernel. Only the helper expansion logic is shared; the per-cluster (N, M) defaults belong with each kernel (they're shape-dependent and kernel-specific).

Structs​

Functions​