[Cherry-Pick][RL] Allow configuring update weights timeout (#8073)#8074
Conversation
PaddlePaddle-bot
left a comment
There was a problem hiding this comment.
🤖 Paddle-CI-Agent | pr_review |
2026-06-24 13:37:18
📋 Review 摘要
PR 概述:为 OpenAI update_weights 增加 timeout 参数校验,并在 Engine/Cache 更新权重时使用该超时。
变更范围:fastdeploy/entrypoints/openai/api_server.py、fastdeploy/engine/common_engine.py 及相关单测
影响面 Tag:APIServer Engine
问题
| 级别 | 文件 | 概述 |
|---|---|---|
| 🔴 Bug | fastdeploy/entrypoints/openai/api_server.py:486 |
timeout 大于 600 秒时仍会被 EngineClient.run_control_method 固定 600 秒提前截断,配置不会真正生效 |
📝 PR 规范检查
PR 描述结构符合模板;标题包含 [Cherry-Pick] 和官方 Tag,本轮未基于上下文确认原 develop PR 号。
总体评价
核心路径已正确避免把 timeout 透传给 worker/cache-transfer,但 API 入口到 engine 的等待超时仍未联动,导致大于 600 秒的配置场景会返回超时错误,需要修复后再合入。
| status_code=400, | ||
| content={"error": "Invalid parameter value", "message": "timeout must be positive"}, | ||
| ) | ||
| args["timeout"] = request_data["timeout"] |
There was a problem hiding this comment.
🔴 Bug 这里允许用户把 timeout 配成任意正整数,但当前请求链路里 EngineClient.run_control_method() 仍固定 asyncio.wait_for(..., timeout=600)。
当用户为大权重更新配置 timeout > 600 时,engine 内部会继续按该值等待 worker/cache-transfer,但 OpenAI API 侧会在 600 秒先返回 Timeout waiting for control method response,配置的超时没有真正生效,甚至可能出现 HTTP 已失败而后台仍在更新权重的状态。
建议修复方式:
在发送 ControlRequest 后,让 EngineClient.run_control_method 对 update_weights 使用 request.args["timeout"] 派生的等待时间(建议加少量 buffer,例如 timeout + 10,或 max(600, timeout + 10)),并补一个覆盖 timeout > 600 的 engine_client/API 单测。
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## release/2.6 #8074 +/- ##
==============================================
Coverage ? 71.60%
==============================================
Files ? 386
Lines ? 55773
Branches ? 8762
==============================================
Hits ? 39937
Misses ? 13021
Partials ? 2815
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
1ca7c95
into
PaddlePaddle:release/2.6
Motivation
Support configuring the timeout for
update_weightsrequests. This helps large weight updates avoid timing out with the fixed default timeout.Modifications
timeoutparameter validation in the OpenAI APIupdate_weightsendpoint.timeoutas a control-only parameter and do not forward it to workers.Usage or Command
Example request body:
{ "timeout": 120 }If
timeoutis not provided, the default value is180seconds.Accuracy Tests
Not applicable. This PR only changes control request timeout handling and does not affect model outputs.
Checklist
[Engine][APIServer] Allow configuring update weights timeoutpre-commitbefore commit.releasebranch, make sure the PR has been submitted to thedevelopbranch, then cherry-pick it to thereleasebranch with the[Cherry-Pick]PR tag.