[Bugfix] Fix DSA crash under breakable piecewise cudagraphs (#49302)

Signed-off-by: Nick Hill <nickhill123@gmail.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Nick Hill
2026-07-21 18:28:13 +01:00
committed by GitHub
co-authored by Claude Opus 4.8
parent 61e10f0116
commit de6ec294ef
3 changed files with 30 additions and 12 deletions
+1 -5
View File
@@ -5,7 +5,6 @@ from typing import Any
import torch
import torch.nn as nn
from vllm.compilation.breakable_cudagraph import is_breakable_cudagraph_enabled
from vllm.config import VllmConfig
from vllm.config.compilation import CUDAGraphMode
from vllm.v1.core.sched.output import NewRequestData
@@ -140,10 +139,7 @@ class DefaultModelState(ModelState):
kv_cache_config: KVCacheConfig,
for_capture: bool = False,
) -> dict[str, Any]:
if cudagraph_mode == CUDAGraphMode.FULL or (
cudagraph_mode == CUDAGraphMode.PIECEWISE
and is_breakable_cudagraph_enabled()
):
if cudagraph_mode == CUDAGraphMode.FULL:
# Use padded sizes - padding is handled by model_runner.prepare_attn.
num_reqs = input_batch.num_reqs_after_padding
num_tokens = input_batch.num_tokens_after_padding