Repository navigation
[HIP] [gfx950] Context-parallel block selection for the MiniMax-M3 indexer - #6359
Conversation
…exer Signed-off-by: ukannika_amdeng <[email protected]>
🏷️ CI GuideRuns automatically on every PR:
Extended tests (opt-in via labels):
One backend per PR: PR title tags & labels: |
|
test_msa_block_select.py only checks the score shard, one rank at a time on one GPU. pa_sparse_block_topk_cp is never called, and the 8-GPU job was skipped. There is no barrier: a lane spins on the generation in the top 8 bits of the block id, so ranks that do not make the same number of calls hang. One multi-rank run should show the selected blocks match the single-GPU top-k, per head. |
|
@ukannika let @kaiyang-1 know once this one validated in vllm |
Added
TP8 case currently not supported and added a check on host side. Here's the e2e results updated in this PR: vllm-project/vllm#57909 |
ChuanLi1101
left a comment
There was a problem hiding this comment.
Thanks. The new test calls pa_sparse_block_topk_cp and checks each owned head against the single-GPU top-k, including the page table. That covers the comment. Please add the ci:multi-gpu label so the 8-GPU job runs this file. LGTM.
|
@ukannika Lingpeng asked to let @kaiyang-1 know once this is validated in vLLM. The #57909 numbers are already on this thread. Please ping @kaiyang-1. |
Summary
Adds
pa_sparse_block_topk_cp, a context-parallel block selector for theMiniMax-M3 lightning indexer, and gives the decode scoring pass
rank/worldparameters so a rank can score a shard of the context instead of all of it.
Nomination, cross-rank exchange and merge happen in one kernel launch with no
collective and no barrier.
Motivation
The indexer's index cache is replicated on every tensor-parallel rank, so each
rank re-reads the whole of it every decode step. That read is the only part of
the indexer that scales with context.
Tensor parallelism does not help, because it splits the head axis and the cache
is shared by all heads (MQA: one index KV head feeding four index query heads).
Inverting the split does. Each rank projects every index head but scores
1/worldof the 128-token blocks, which turns the replicated read into1/worldof the bytes.Performance
MI355X (gfx950), 4 ranks, 4 index heads, top-16, fp8 e4m3 index cache, 128-token
blocks. Decode scoring, whole-context pass against the slowest rank's shard,
measured cold (argument rotation on, since in a real model every indexer layer
owns its own index cache and no layer's shard is still resident when the next
layer's score pass starts).
Scoring kernel
Reproduced with:
python op_tests/test_msa_block_select.py --cp-only -H 4 -w 4 \ -b 8 16 32 64 128 -c 8192 16384 32768 65536 131072