[ROCm][ [Perf] sparse attention optimization on minimax-m3 (#46546)

Signed-off-by: Hongxia Yang <hongxia.yang@amd.com>
Signed-off-by: tjtanaa <tunjian.tan@embeddedllm.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: yueliu14 <yue.liu4@amd.com>
Co-authored-by: tjtanaa <tunjian.tan@embeddedllm.com>
This commit is contained in:
Hongxia Yang
2026-06-25 16:56:00 +08:00
committed by GitHub
co-authored by Claude Opus 4.8 yueliu14 tjtanaa
parent 638b1a99cc
commit c63cd4906c
5 changed files with 1238 additions and 36 deletions
@@ -24,12 +24,21 @@ from vllm.config import VllmConfig
from vllm.config.cache import CacheDType
from vllm.forward_context import get_forward_context
from vllm.logger import init_logger
from vllm.models.minimax_m3.common.ops.sparse_attn import (
SPARSE_BLOCK_SIZE,
minimax_m3_sparse_attn,
minimax_m3_sparse_attn_decode,
)
from vllm.models.minimax_m3.common.ops.sparse_attn import SPARSE_BLOCK_SIZE
from vllm.platforms import current_platform
# AMD/ROCm uses the gfx942/gfx950-optimized block-sparse kernels in amd.ops;
# every other platform uses the generic common.ops implementation.
if current_platform.is_rocm():
from vllm.models.minimax_m3.amd.ops.sparse_attn import (
minimax_m3_sparse_attn,
minimax_m3_sparse_attn_decode,
)
else:
from vllm.models.minimax_m3.common.ops.sparse_attn import (
minimax_m3_sparse_attn,
minimax_m3_sparse_attn_decode,
)
from vllm.v1.attention.backend import (
AttentionBackend,
AttentionCGSupport,