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
mha_decode_partition_heuristic
Split-K partition-count heuristics for MHA and MLA decode kernels.
Exposes per-backend functions that decide how many partitions the decode split-K loop should run across, plus num_keys-independent upper bounds used to launch graph-stable decode grids whose extra partitions early-return in the kernel. CUDA uses a simple SM-fill target clamped to the single-warp reducer limit; HIP (MI355X) uses a wave-aligned formula tuned for both MHA and MLA decode shapes.
Functionsβ
- β
cuda_mha_decoding_max_num_partitions: Returns the num_keys-independent upper bound on CUDA decode split-K partitions. - β
cuda_mha_decoding_num_partitions: Returns the CUDA decode split-K partition count for the given shape. - β
hip_mha_decoding_num_partitions: Wave-aligned split-K target for MI355X MHA + MLA decode. - β
mha_decoding_max_num_partitions: Returns the num_keys-independent upper bound onmha_decoding_num_partitions. - β
mha_decoding_num_partitions: Dispatches to the backend-specific decode split-K partition heuristic.
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!