[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:
co-authored by
Claude Opus 4.8
parent
61e10f0116
commit
de6ec294ef
@@ -254,12 +254,12 @@ class CudaGraphManager:
|
||||
|
||||
if mixed_mode:
|
||||
# for PIECEWISE graphs there is no limit on requests when replaying
|
||||
# i.e. no request padding is needed
|
||||
# so we leave it as None
|
||||
# i.e. no request padding is needed, so we leave it as None.
|
||||
# For breakable PW graphs, break-point kernels read the real batch
|
||||
# from the forward context; in-graph kernels handle the token padding
|
||||
# themselves from the padded slot_mapping (rows with slot == -1).
|
||||
num_reqs = None
|
||||
if mixed_mode == CUDAGraphMode.FULL or (
|
||||
mixed_mode == CUDAGraphMode.PIECEWISE and self.use_breakable_cg
|
||||
):
|
||||
if mixed_mode == CUDAGraphMode.FULL:
|
||||
num_reqs = min(num_tokens, self.max_num_reqs)
|
||||
desc = BatchExecutionDescriptor(
|
||||
cg_mode=mixed_mode,
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user