fix(pd): protect streaming continuations from admission timeouts - #1561
Closed
sufubao wants to merge 2 commits into
Closed
fix(pd): protect streaming continuations from admission timeouts#1561sufubao wants to merge 2 commits into
sufubao wants to merge 2 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
问题与改动
PD Decode 因 token 容量不足结束当前分段后,Master 会重新提交续跑。此前续跑仍可能因 shm/Router 资源等待或固定握手超时触发 busy;由于回答已经输出 token,最外层不能从头重试,最终导致流式回答中断。
本改动保留现有 PD 分段机制,让续跑作为已接纳回答的内部恢复操作继续执行:
pd_is_continuation,在 shm 分配、Router 和推理调度中实行“续跑 > cache 优先新请求 > 普通新请求”。shm 优先级检查与整组分配使用跨 HTTP worker 的共享锁,等待期间不持有部分槽位。配置与部署
LIGHTLLM_PD_NODE_CONTINUATION_RESOURCE_WAIT_TIMEOUT_SECONDS默认由60改为-1;显式设置非负值时,续跑 busy 进入内部重试。LIGHTLLM_PD_REQUEST_TIMEOUT_SECONDS,默认1800秒,负数禁用;预算不会在分段或 token 输出后重置。验证
Black、flake8 检查通过。尚未进行真实 P/D GPU 服务验证或性能压测。