-
Notifications
You must be signed in to change notification settings - Fork 87
fix(vllm): unify engine control-plane HTTP timeout as --vllm-engine-request-timeout-secs (use for /sleep+/wake_up) #89
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -603,8 +603,8 @@ def __init__( | |||||||||||||||||||||||
| def _http_base(self) -> str: | ||||||||||||||||||||||||
| return f"http://{self.server_host}:{self.server_port}" | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| def _weight_transfer_http_timeout(self) -> float: | ||||||||||||||||||||||||
| return float(self.args.vllm_weight_transfer_timeout_sec) | ||||||||||||||||||||||||
| def _engine_request_http_timeout(self) -> float: | ||||||||||||||||||||||||
| return float(self.args.vllm_engine_request_timeout_secs) | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| def init( | ||||||||||||||||||||||||
| self, | ||||||||||||||||||||||||
|
|
@@ -780,7 +780,7 @@ def _post_vllm_update_weights_http(self, update_info: dict) -> dict: | |||||||||||||||||||||||
| return self._make_request( | ||||||||||||||||||||||||
| "update_weights", | ||||||||||||||||||||||||
| {"update_info": update_info}, | ||||||||||||||||||||||||
| timeout=self._weight_transfer_http_timeout(), | ||||||||||||||||||||||||
| timeout=self._engine_request_http_timeout(), | ||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| def health_generate(self, timeout: float = 5.0) -> bool: | ||||||||||||||||||||||||
|
|
@@ -906,10 +906,13 @@ def release_memory_occupation(self, level: int = 1): | |||||||||||||||||||||||
| return {"ok": True, "sleep_mode": False, "note": "vLLM sleep mode disabled; no /sleep call."} | ||||||||||||||||||||||||
| # vLLM ``POST /sleep`` reads ``level`` from query params, not JSON body | ||||||||||||||||||||||||
| # (``vllm.entrypoints.serve.sleep.api_router.sleep``). | ||||||||||||||||||||||||
| # Use the (tunable) engine-request timeout, not a hardcoded 30s: releasing a large model's | ||||||||||||||||||||||||
| # weights/KV scales with model size, and under vLLM data parallelism the front API server | ||||||||||||||||||||||||
| # (api_server_count=dp) coordinates every replica's sleep, so a 30B+ engine exceeds 30s. | ||||||||||||||||||||||||
| response = requests.post( | ||||||||||||||||||||||||
| f"{self._http_base()}/sleep", | ||||||||||||||||||||||||
| params={"level": level}, | ||||||||||||||||||||||||
| timeout=30, | ||||||||||||||||||||||||
| timeout=self._engine_request_http_timeout(), | ||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||
| return _response_json(response) | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
|
|
@@ -926,7 +929,7 @@ def resume_memory_occupation(self, tags: list[str] | None = None): | |||||||||||||||||||||||
| response = requests.post( | ||||||||||||||||||||||||
| f"{self._http_base()}/wake_up", | ||||||||||||||||||||||||
| params=wake_params, | ||||||||||||||||||||||||
| timeout=30, | ||||||||||||||||||||||||
| timeout=self._engine_request_http_timeout(), | ||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||
|
Comment on lines
929
to
933
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Using a single float for
Suggested change
|
||||||||||||||||||||||||
| return _response_json(response) | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
|
|
@@ -936,7 +939,7 @@ def init_weight_transfer_engine(self, payload: dict) -> dict: | |||||||||||||||||||||||
| For IPC mode the payload is ``{"init_info": {}}``; for NCCL use | ||||||||||||||||||||||||
| ``init_weights_update_group`` which constructs the payload from typed args. | ||||||||||||||||||||||||
| """ | ||||||||||||||||||||||||
| init_timeout_s = self._weight_transfer_http_timeout() | ||||||||||||||||||||||||
| init_timeout_s = self._engine_request_http_timeout() | ||||||||||||||||||||||||
| last_error = None | ||||||||||||||||||||||||
| for attempt in range(1, 4): | ||||||||||||||||||||||||
| try: | ||||||||||||||||||||||||
|
|
@@ -953,7 +956,7 @@ def start_weight_update(self, is_checkpoint_format: bool = False) -> dict: | |||||||||||||||||||||||
| return self._make_request( | ||||||||||||||||||||||||
| "start_weight_update", | ||||||||||||||||||||||||
| {"is_checkpoint_format": is_checkpoint_format}, | ||||||||||||||||||||||||
| timeout=self._weight_transfer_http_timeout(), | ||||||||||||||||||||||||
| timeout=self._engine_request_http_timeout(), | ||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| def finish_weight_update(self) -> dict: | ||||||||||||||||||||||||
|
|
@@ -963,7 +966,7 @@ def finish_weight_update(self) -> dict: | |||||||||||||||||||||||
| ``update_weights_from_tensor`` (the IPC data-carrying RPC), matching slime's | ||||||||||||||||||||||||
| single-RPC version-with-data semantics. | ||||||||||||||||||||||||
| """ | ||||||||||||||||||||||||
| return self._make_request("finish_weight_update", {}, timeout=self._weight_transfer_http_timeout()) | ||||||||||||||||||||||||
| return self._make_request("finish_weight_update", {}, timeout=self._engine_request_http_timeout()) | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| def check_weights(self, action: str): | ||||||||||||||||||||||||
| """No vLLM ``weights_checker`` route; return a placeholder dict.""" | ||||||||||||||||||||||||
|
|
@@ -985,7 +988,7 @@ def init_weights_update_group(self, master_address, master_port, rank_offset, wo | |||||||||||||||||||||||
| "world_size": world_size, | ||||||||||||||||||||||||
| } | ||||||||||||||||||||||||
| } | ||||||||||||||||||||||||
| init_timeout_s = self._weight_transfer_http_timeout() | ||||||||||||||||||||||||
| init_timeout_s = self._engine_request_http_timeout() | ||||||||||||||||||||||||
| last_error = None | ||||||||||||||||||||||||
| for attempt in range(1, 4): | ||||||||||||||||||||||||
| try: | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using a single float for
timeoutsets both the connection timeout and the read timeout to that value (which defaults to 900 seconds). If the vLLM server is completely dead or unreachable, the connection attempt will hang for 15 minutes, blocking the Ray actor. Specifying a tuple like(5.0, self._weight_transfer_http_timeout())keeps a short, sensible connection timeout while still allowing the long-running sleep operation to complete.