Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions fastdeploy/worker/gpu_model_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -875,6 +875,16 @@ def insert_tasks_v1(self, req_dicts: List[Request], num_running_requests: int =
self.share_inputs["max_reply_lens"][idx : idx + 1, :] = -1
self.share_inputs["limit_think_status"][idx : idx + 1, :] = 0

if not isinstance(request.prompt_token_ids, (list, np.ndarray)):
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 建议 此类型校验仅在 gpu_model_runner.py 中添加,其他硬件 ModelRunner(xpu_model_runner.pydcu_model_runner.pygcu_model_runner.pyhpu_model_runner.pyiluvatar_model_runner.pymetax_model_runner.py)中的 insert_tasks_v1 方法若存在相同逻辑,也应同步添加此校验,否则其他硬件上仍会 crash。

建议修复方式:
检查上述各硬件 ModelRunner 的 insert_tasks_v1 方法,在相同位置添加等价的类型校验逻辑。

logger.error(
f"Request {request.request_id} has invalid prompt_token_ids type: "
f"{type(request.prompt_token_ids)}, expected list or np.ndarray. Aborting request."
)
async_set_value(self.share_inputs["stop_flags"][idx : idx + 1], True)
async_set_value(self.share_inputs["seq_lens_this_time_buffer"][idx : idx + 1], 0)
async_set_value(self.share_inputs["seq_lens_encoder"][idx : idx + 1], 0)
continue

if isinstance(request.prompt_token_ids, np.ndarray):
prompt_token_ids = request.prompt_token_ids.tolist()
else:
Expand Down