Skip to content

Commit 7bc29b5

Browse files
authored
[xpu] fix interrupt error (#7805)
1 parent 12c6ae0 commit 7bc29b5

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

fastdeploy/worker/xpu_model_runner.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1300,6 +1300,10 @@ class at the server level, which is too granular for ModelRunner.
13001300
# 2. Padding inputs for cuda grph
13011301
self.padding_cudagraph_inputs()
13021302

1303+
num_tokens = self.share_inputs["ids_remove_padding"].shape[0]
1304+
if not self.parallel_config.enable_expert_parallel and num_tokens <= 0:
1305+
return None
1306+
13031307
# NOTE(wufeisheng): If `not_need_stop`` is False, it means the current worker is in an idle state.
13041308
# This logic is not used in TP (Tensor Parallelism) mode. However, in EP (Expert Parallelism) mode,
13051309
# when there is data on other runner, the current runner is required to execute part of the model.

0 commit comments

Comments
 (0)