Skip to content

Commit 55cafcb

Browse files
committed
[FIX] assert -> raise ValueError
Modify assert according to code review comments Signed-off-by: Csrayz <[email protected]>
1 parent 8e0adbe commit 55cafcb

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
@@ -68,8 +68,15 @@ def __post_init__(self) -> None:
6868
self.long_prefill_token_threshold = \
6969
max(1, int(self.max_model_len * 0.04))
7070

71-
assert (self.max_long_partial_prefills > 0)
72-
assert (self.long_prefill_token_threshold > 0)
71+
if self.max_long_partial_prefills <= 0:
72+
raise ValueError(
73+
f"max_long_partial_prefills must be positive, but got "
74+
f"{self.max_long_partial_prefills}")
75+
if self.long_prefill_token_threshold <= 0:
76+
raise ValueError(
77+
f"long_prefill_token_threshold must be positive, but got "
78+
f"{self.long_prefill_token_threshold}")
79+
7380
if self.policy != "fcfs":
7481
raise NotImplementedError(
7582
f"currently AscendScheduler only supports fcfs policy, got {self.policy}"

0 commit comments

Comments
 (0)