diff --git a/vllm_ascend/worker/model_runner_v1.py b/vllm_ascend/worker/model_runner_v1.py index 4ab4f06d..9ab91214 100644 --- a/vllm_ascend/worker/model_runner_v1.py +++ b/vllm_ascend/worker/model_runner_v1.py @@ -1008,8 +1008,9 @@ class NPUModelRunner(GPUModelRunner): # TODO: We should make this official ASAP. Also note that if we pad here, # the builders won’t need to add any extra padding. + max_decode_tokens = self.scheduler_config.max_num_seqs * self.uniform_decode_query_len if self.compilation_config.cudagraph_mode.decode_mode() == CUDAGraphMode.FULL and \ - uniform_decode and num_input_tokens <= self.cudagraph_batch_sizes[-1]: + uniform_decode and self.uniform_decode_query_len <= num_input_tokens <= max_decode_tokens: num_reqs_padded = num_input_tokens // self.uniform_decode_query_len pad_size = num_reqs_padded - num_reqs if pad_size > 0: