[Bugfix][ROCm][MiniMax-M3] Reject unbuilt index-head counts in the AITER indexer (#60990)

Signed-off-by: Andreas Karatzas <akaratza@amd.com>
Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
Andreas Karatzas
2026-10-14 14:13:48 -05:00
committed by GitHub
co-authored by Claude
parent 21e207efa1
commit e96c822660
3 changed files with 39 additions and 3 deletions
+7 -2
View File
@@ -67,6 +67,8 @@ MSA_TOPK_BLOCKS = 16
MSA_SCORE_TYPE = "max"
MSA_SPARSE_BLOCK_SIZE = 128
MSA_INDEX_HEAD_DIM = 128
# Index head counts the score kernels are instantiated for.
MSA_NUM_INDEX_HEADS = (1, 2)
# Wave width the top-k is written against: it gives one lane per output slot and
# reads the score row in wave-wide strips.
WAVE_SIZE = 64
@@ -181,8 +183,11 @@ def aiter_indexer_unsupported_reason(
f"needs index_head_dim={MSA_INDEX_HEAD_DIM}, "
f"got index_head_dim={index_head_dim}"
)
if num_index_heads > MFMA_COLS:
return f"num_index_heads={num_index_heads} exceeds the {MFMA_COLS} MFMA columns"
if num_index_heads not in MSA_NUM_INDEX_HEADS:
return (
f"needs num_index_heads in {MSA_NUM_INDEX_HEADS}, "
f"got num_index_heads={num_index_heads}"
)
# A decode row's whole query shares one MFMA tile, one column per (token,
# head) pair, so spec decode trades columns against the head count.
if num_index_heads * max_decode_query_len > MFMA_COLS:
@@ -125,7 +125,9 @@ def minimax_m3_use_aiter_sparse_pa(
raise ValueError(
"MiniMax M3 AITER sparse paged attention requires "
f"num_kv_heads == 1 per tensor-parallel rank, got {num_kv_heads}, "
"unless the indexer emits the attend's page table."
"unless the AITER indexer emits the attend's page table. It is not "
"in use here; the 'MiniMax M3 indexer: AITER unavailable' log line "
"says why."
)
return requested