Skip to content

Commit 05d8b6a

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 d0b8fd3 commit 05d8b6a

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
@@ -277,9 +277,10 @@ def pin_lora(self, lora_id: int) -> bool:
277277

278278
def execute_dummy_batch(self) -> None:
279279
runner = self.model_runner
280-
assert runner.dp_size > 1, "Dummy batch execution should only be " \
281-
"performed with data parallelism enabled, but got " \
282-
f"dp_size={runner.dp_size}."
280+
if runner.dp_size <= 1:
281+
raise ValueError("Dummy batch execution should only be "
282+
"performed with data parallelism enabled, but got "
283+
f"dp_size={runner.dp_size}.")
283284

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

0 commit comments

Comments
 (0)