agentscope-ai / agentscope-ai/Trinity-RFT

[FEATURE] Prompt-length dataset pre-filtering safeguard or check `max_model_len` before forward

未关闭
#287 2 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
enhancement
主要语言
Python
星标
701
派生
79
平均合并
8 小时 7 分钟
30 天内合并 PR
1

描述

Otherwise, one can get an exception / training crash when some outlier prompt happens to be too long.

Part of the root cause:
- https://github.com/vllm-project/vllm/issues/16732

```
(WorkflowRunner pid=42768) ERROR 09-18 02:43:09 [workflow_runner.py:163] File "/tmp/ray/session_2025-09-18_02-35-21_268823_22052/runtime_resources/working_dir_files/_ray_pkg_83ec426c3cf029b3/.venv/lib/python3.12/site-packages/vllm/v1/engine/async_llm.py", line 237, in add_request
(WorkflowRunner pid=42768) ERROR 09-18 02:43:09 [workflow_runner.py:163] prompt_str, request = self.processor.process_inputs(
(WorkflowRunner pid=42768) ERROR 09-18 02:43:09 [workflow_runner.py:163] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
(WorkflowRunner pid=42768) ERROR 09-18 02:43:09 [workflow_runner.py:163] File "/tmp/ray/session_2025-09-18_02-35-21_268823_22052/runtime_resources/working_dir_files/_ray_pkg_83ec426c3cf029b3/.venv/lib/python3.12/site-packages/vllm/v1/engine/processor.py", line 266, in process_inputs
(WorkflowRunner pid=42768) ERROR 09-18 02:43:09 [workflow_runner.py:163] self._validate_model_inputs(processed_inputs, lora_request)
(WorkflowRunner pid=42768) ERROR 09-18 02:43:09 [workflow_runner.py:163] File "/tmp/ray/session_2025-09-18_02-35-21_268823_22052/runtime_resources/working_dir_files/_ray_pkg_83ec426c3cf029b3/.venv/lib/python3.12/site-packages/vllm/v1/engine/processor.py", line 365, in _validate_model_inputs
(WorkflowRunner pid=42768) ERROR 09-18 02:43:09 [workflow_runner.py:163] self._validate_model_input(decoder_inputs,
(WorkflowRunner pid=42768) ERROR 09-18 02:43:09 [workflow_runner.py:163] File "/tmp/ray/session_2025-09-18_02-35-21_268823_22052/runtime_resources/working_dir_files/_ray_pkg_83ec426c3cf029b3/.venv/lib/python3.12/site-packages/vllm/v1/engine/processor.py", line 418, in _validate_model_input
(WorkflowRunner pid=42768) ERROR 09-18 02:43:09 [workflow_runner.py:163] raise ValueError(
(WorkflowRunner pid=42768) ERROR 09-18 02:43:09 [workflow_runner.py:163] ValueError: The decoder prompt (length 1282) is longer than the maximum model length of 1280. Make sure that `max_model_len` is no smaller than the number of text tokens.
(WorkflowRunner pid=42768) ERROR 09-18 02:43:09 [workflow_runner.py:163]
```

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。