Conversation
Fixes InternLM#4972 Signed-off-by: GokayAI <60583610+gokay-ai@users.noreply.github.com>
RunningLeon
reviewed
Sep 17, 2026
| # Bound waiters so connect()/warmup cannot hang forever when a handshake is stuck. | ||
| # Set LMDEPLOY_PD_CONN_WAIT_TIMEOUT=0 to restore unlimited wait. | ||
| DEFAULT_CONNECT_WAIT_TIMEOUT = 60.0 | ||
| CONNECT_WAIT_TIMEOUT = _optional_float_env('LMDEPLOY_PD_CONN_WAIT_TIMEOUT', DEFAULT_CONNECT_WAIT_TIMEOUT) |
Collaborator
There was a problem hiding this comment.
may put env variable in https://github.com/InternLM/lmdeploy/blob/main/lmdeploy/pytorch/envs.py
Author
There was a problem hiding this comment.
Moved LMDEPLOY_PD_CONN_WAIT_TIMEOUT into lmdeploy/pytorch/envs.py so get_all_envs() registers it.
Move LMDEPLOY_PD_CONN_WAIT_TIMEOUT into lmdeploy/pytorch/envs.py so get_all_envs() can propagate it, and apply docformatter on touched files. Signed-off-by: GokayAI <60583610+gokay-ai@users.noreply.github.com>
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.
Motivation
Fixes #4972.
/distserve/connection_warmupgatheredconnect()for every Prefill×Decode pair with no in-flight coalescing or waiter timeout. Slow or stuck handshakes piledwaiting_connitems andwait_for_conntasks until the Proxy was OOM-killed (exit 137).Modification
PDConnectionPool: laterconnect()calls join the existingConnectingevent instead of enqueueing another handshake orwait_for_conntask.connect()waiters withLMDEPLOY_PD_CONN_WAIT_TIMEOUT(default 60s;0restores unlimited wait).waiting_connas a safety net./distserve/connection_warmupcallers share one in-flight gather, with a semaphore limiting concurrent handshakes.BC-breaking (Optional)
No API break. DistServe-only. Operators who need unbounded PD handshake waits can set
LMDEPLOY_PD_CONN_WAIT_TIMEOUT=0.Checklist