[Bugfix] Capture prefill kernels for mixed FULL graphs (#58275)

Signed-off-by: Andreas Karatzas <Andreas.Karatzas@amd.com>
Co-authored-by: OpenAI Codex <codex@openai.com>
This commit is contained in:
Andreas Karatzas
2026-09-24 02:05:07 -07:00
committed by GitHub
co-authored by OpenAI Codex
parent bbc4ddeca9
commit 23110a0c9e
4 changed files with 117 additions and 16 deletions
+5 -1
View File
@@ -704,7 +704,7 @@ class ModelCudaGraphManager(CudaGraphManager):
attn_groups,
kv_cache_config,
full_cudagraph=desc.cg_mode == CUDAGraphMode.FULL,
max_query_len=desc.max_query_len,
max_query_len=desc.max_query_len or desc.uniform_token_count,
pcp_manager=pcp_manager,
)
@@ -775,6 +775,10 @@ def prepare_inputs_to_capture(
max_query_len: int | None = None,
pcp_manager: "PCPManager | None" = None,
) -> AttentionState:
if full_cudagraph and max_query_len is None:
# Mixed graphs can replay a single prefill spanning the entire batch,
# even when the dummy batch distributes one token to each request.
max_query_len = num_tokens
input_batch = InputBatch.make_dummy(
num_reqs, num_tokens, input_buffers, max_query_len=max_query_len
)