Skip to content

Commit 70fb9db

Browse files
committed
[FIX] assert -> raise ValueError
Modify assert according to code review comments Signed-off-by: Csrayz <[email protected]>
1 parent 76f90f5 commit 70fb9db

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

vllm_ascend/core/schedule_config.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,15 @@ def __post_init__(self) -> None:
7878
self.long_prefill_token_threshold = \
7979
max(1, int(self.max_model_len * 0.04))
8080

81-
assert (self.max_long_partial_prefills > 0)
82-
assert (self.long_prefill_token_threshold > 0)
81+
if self.max_long_partial_prefills <= 0:
82+
raise ValueError(
83+
f"max_long_partial_prefills must be positive, but got "
84+
f"{self.max_long_partial_prefills}")
85+
if self.long_prefill_token_threshold <= 0:
86+
raise ValueError(
87+
f"long_prefill_token_threshold must be positive, but got "
88+
f"{self.long_prefill_token_threshold}")
89+
8390
if self.policy != "fcfs":
8491
raise NotImplementedError(
8592
f"currently AscendScheduler only supports fcfs policy, got {self.policy}"

0 commit comments

Comments
 (0)