refactor : merge max_prompt_len into max_seq_len, replace assert with raise

- Engine/Scheduler/TaskManager: merge max_prompt_len into max_seq_len
- train.py: replace bare assert with ValueError/FileNotFoundError
- server.py: add --max_seq_len CLI option
- engine.py: remove dead page_size param
This commit is contained in:
2026-07-27 08:05:11 +08:00
parent 05c7432964
commit 53c804e233
12 changed files with 27 additions and 21 deletions
+8 -3
View File
@@ -402,15 +402,20 @@ def train(
decay_steps: int,
**kwargs,
):
assert train_type in [
if train_type not in [
"seq",
"sft",
"dpo",
"grpo",
"online_grpo",
"online_dpo",
]
assert os.path.exists(param_path)
]:
raise ValueError(
f"Invalid train_type '{train_type}'. "
f"Must be one of: seq, sft, dpo, grpo, online_grpo, online_dpo"
)
if not os.path.exists(param_path):
raise FileNotFoundError(f"Model directory not found: {param_path}")
if nprocs > 1 and parallel_mode == "none":
raise ValueError(
"--nprocs > 1 requires --parallel_mode to be 'ddp', 'fsdp', or 'fsdp2'"