From f70c7a9250f9fbd444d70e6fd0e8dc41cf2cc8ba Mon Sep 17 00:00:00 2001 From: zzzzwwjj <1183291235@qq.com> Date: Thu, 3 Jul 2025 12:12:13 +0800 Subject: [PATCH] [bugfix] fix graph_batch_sizes padding bug Signed-off-by: zzzzwwjj <1183291235@qq.com> --- vllm_ascend/worker/model_runner_v1.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/vllm_ascend/worker/model_runner_v1.py b/vllm_ascend/worker/model_runner_v1.py index c474c5ae62..f8dcc6ad6e 100644 --- a/vllm_ascend/worker/model_runner_v1.py +++ b/vllm_ascend/worker/model_runner_v1.py @@ -2101,7 +2101,8 @@ def check_torchair_graph_batch_sizes(self): if self.parallel_config.enable_expert_parallel: new_graph_batch_sizes = [] for graph_batch_size in self.torchair_graph_batch_sizes: - cur_graph_batch_size = graph_batch_size + tp_size - graph_batch_size % tp_size + cur_graph_batch_size = math.ceil( + graph_batch_size / tp_size) * tp_size if cur_graph_batch_size not in new_graph_batch_sizes: new_graph_batch_sizes.append(cur_graph_batch_size) self.torchair_graph_batch_sizes = new_graph_batch_sizes