[AMD] Enable BCG on ROCm + route aiter prefill via MHA during PCG/BCG capture for Kimi-2.5 (#27833)

Co-authored-by: sogalin_codegen <39478626+sogalin@users.noreply.github.com>
This commit is contained in:
karverma-amd
2026-06-23 18:22:41 -07:00
committed by GitHub
co-authored by sogalin_codegen
parent 5338e44483
commit 20b2817bdf
2 changed files with 187 additions and 0 deletions
@@ -1,6 +1,9 @@
from sglang.srt.layers.attention.tbo_backend import TboAttnBackend
from sglang.srt.layers.utils.cp_utils import mla_use_prefill_cp
from sglang.srt.model_executor.forward_context import get_attn_backend
from sglang.srt.model_executor.runner_backend_utils.breakable_cuda_graph import (
is_in_breakable_cuda_graph,
)
from sglang.srt.model_executor.runner_backend_utils.tc_piecewise_cuda_graph import (
is_in_tc_piecewise_cuda_graph,
)
@@ -150,6 +153,11 @@ def handle_attention_tokenspeed_mla(attn, forward_batch):
def handle_attention_aiter(attn, forward_batch):
# During PCG/BCG capture on ROCm, aiter fp8 MLA prefill has no capture
# kernels; route through the MHA path (radix_attention swaps attn_mqa for
# its attn_mha companion) so capture/replay use valid head/dim metadata.
if is_in_tc_piecewise_cuda_graph() or is_in_breakable_cuda_graph():
return AttnForwardMethod.MHA
if forward_batch.forward_mode.is_extend_without_speculative():
return AttnForwardMethod.MHA
else: