feat: enable piecewise prefill graph for Kimi K2.5/K2.7 (#30889)

This commit is contained in:
Mick
2026-07-13 08:37:30 +08:00
committed by GitHub
parent b94ac87e0c
commit 7da30f4e55
3 changed files with 73 additions and 0 deletions
@@ -1752,6 +1752,7 @@ piecewise_cuda_graph_disabled_model_archs = [
# cleanly (vision encoder runs eagerly outside the graph via general_mm_embed_routine).
multimodal_piecewise_cuda_graph_supported_model_archs = [
"Cohere2VisionForConditionalGeneration",
"KimiK25ForConditionalGeneration",
"MiniMaxM3SparseForCausalLM",
"MiniMaxM3SparseForConditionalGeneration",
]
+15
View File
@@ -3495,6 +3495,21 @@ class ServerArgs:
"""
if (Phase.PREFILL, "backend") in self._cuda_graph_config_locked:
return
# Breakable is the general CUDA default, but it is not compatible with
# multimodal prefill. Models on this allowlist have had their decoder
# prefill validated under tc_piecewise; the vision encoder remains
# eager outside the captured LM forward.
if (
self.cuda_graph_config.prefill.backend == Backend.BREAKABLE
and self.get_model_config().is_multimodal_piecewise_cuda_graph_supported
):
logger.info(
"Using tc_piecewise CUDA graph for validated multimodal "
"decoder prefill."
)
self.cuda_graph_config.prefill.backend = Backend.TC_PIECEWISE
if self.cuda_graph_config.prefill.backend == Backend.TC_PIECEWISE:
self._disable_tc_piecewise_cudagraph_if_incompatible()
elif self.cuda_graph_config.prefill.backend == Backend.BREAKABLE: