From e6cf26efb707a9d296afff51843d3182c7f33421 Mon Sep 17 00:00:00 2001 From: ChipMates <156656427+ChipMates@users.noreply.github.com> Date: Wed, 22 Apr 2026 05:04:54 +0200 Subject: [PATCH] [Qwen3TTS][Bugfix] Guard inner CUDA graph replay during outer capture (#2910) Signed-off-by: ChipMates --- .../models/qwen3_tts/cuda_graph_decoder_wrapper.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/vllm_omni/model_executor/models/qwen3_tts/cuda_graph_decoder_wrapper.py b/vllm_omni/model_executor/models/qwen3_tts/cuda_graph_decoder_wrapper.py index 8f7eeb542..26d69fe22 100644 --- a/vllm_omni/model_executor/models/qwen3_tts/cuda_graph_decoder_wrapper.py +++ b/vllm_omni/model_executor/models/qwen3_tts/cuda_graph_decoder_wrapper.py @@ -141,6 +141,15 @@ class CUDAGraphDecoderWrapper: if not self.enabled or not self._warmed_up or codes.shape[0] != 1: return self.decoder(codes) + # Inner CUDA graph replay is illegal while an outer stream capture is + # active (e.g. vLLM's cudagraph_mode=FULL warmup on Stage 1). Fall back + # to eager in that case so the outer capture can complete. The guard is + # a no-op at runtime: is_current_stream_capturing() returns False + # outside the startup capture window, so normal inference still hits + # the graph fast path. + if torch.cuda.is_current_stream_capturing(): + return self.decoder(codes) + actual_size = codes.shape[-1] padded_size = self._get_padded_size(actual_size)