Skip to content

Commit c1feccd

Browse files
committed
fix: change assertion to exception for dummy batch execution in NPUWorker
Signed-off-by: Jade Zheng <zheng.shoujian@outlook.com>
1 parent 99c8489 commit c1feccd

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

vllm_ascend/worker/worker_v1.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -247,9 +247,10 @@ def pin_lora(self, lora_id: int) -> bool:
247247

248248
def execute_dummy_batch(self) -> None:
249249
runner = self.model_runner
250-
assert runner.dp_size > 1, "Dummy batch execution should only be " \
251-
"performed with data parallelism enabled, but got " \
252-
f"dp_size={runner.dp_size}."
250+
if runner.dp_size <= 1:
251+
raise ValueError("Dummy batch execution should only be "
252+
"performed with data parallelism enabled, but got "
253+
f"dp_size={runner.dp_size}.")
253254

254255
# If torchair graph is enabled, notify the other DP ranks that this is a
255256
# dummy run by using '-1' as a flag for num_tokens. This will be

0 commit comments

Comments
 (0)