[https://nvbugs/6480621][feat] disagg serving lifecycle fixes and orchestrator diagnostics - #16880
[https://nvbugs/6480621][feat] disagg serving lifecycle fixes and orchestrator diagnostics#16880chienchunhung wants to merge 1 commit into
Conversation
…hestrator diagnostics Three pull-forward fixes from the Fable disaggregated lifecycle design §13, plus a serve-layer orchestrator lifecycle emitter (WS1 serve layer). **Fix 1 — Stop retrying HTTP 4xx/5xx as network errors** (`openai_client.py`) `aiohttp.ClientResponseError` (raised for any HTTP error response) is a subclass of `aiohttp.ClientError`. Previously all `ClientError` exceptions were retried, which meant a GEN worker returning 503 (over capacity) or 422 (bad request) consumed the full retry budget against the same server instead of surfacing the error immediately. Now `ClientResponseError` is re-raised on the first attempt; only true TCP-level errors continue to be retried. **Fix 2 — Cancel surviving leg in gen-first non-streaming gather** (`openai_disagg_service.py`) In the `_send_disagg_request_gen_first` non-streaming path both legs were launched with `asyncio.gather`. If one failed, the surviving leg kept running to completion, holding a KV-receive session or transfer-block slot until its own timeout. The gather is now wrapped in a try/except that cancels all pending tasks on the first exception. **Fix 3 — Disconnect watcher for non-streaming disagg requests** (`openai_disagg_server.py`) The non-streaming disagg handler had no mechanism to detect client disconnect. `_run_with_disconnect_guard` races the handler coroutine against `_poll_disconnect` (polling `raw_request.is_disconnected()` at 0.5 s intervals) and cancels the handler on disconnect. The cancelled request is converted to an HTTP 499 response; `perf_metrics.DisaggPerfMetricsCollector` gains a `cancelled_requests` counter. Workers are not explicitly cancelled here (that requires WS4 abort RPCs — a later workstream). `tensorrt_llm/serve/disagg_lifecycle.py` adds a lightweight, opt-in per-process lifecycle event stream for the disagg orchestrator, enabled by `TRTLLM_DISAGG_ORCHESTRATOR_DIAGNOSTICS=1`. Events: `ctx_dispatch`, `ctx_complete`, `ctx_error`, `gen_dispatch`, `gen_complete`, `gen_error`, `gen_rejected` (HTTP 4xx/5xx), `client_disconnect`, `abort`. Each record is a JSON line on stdout with `(clock_id, seq, wall_ns, rid, elapsed_ms)` for cross-host correlation. `OrchestratorRequestTracer` (obtained via `DisaggOrchestratorLifecycle.tracer()`) provides paired dispatch/complete helpers that measure leg-level elapsed time from the orchestrator's perspective. Both ctx-first and gen-first flows are instrumented. Correlated with executor-layer events (`TRTLLM_DISAGG_TRANSFER_DIAGNOSTICS`) via `disagg_request_id`. - `test_disagg_openai_client.py`: verifies that `ClientResponseError` (5 status codes: 400, 422, 429, 500, 503) is not retried and that plain `ClientError` still is. - `test_openai_disagg_service.py`: two new tests verify that the surviving task is cancelled when CTX fails and when GEN fails in the gen-first non-streaming gather. - `test_disagg_lifecycle.py` (new): 16 tests covering disabled/enabled emitter, field presence, sequence increment, error truncation, tracer paired events, and `from_environment` with multiple env-var values. Signed-off-by: Chien-Chun Hung <chienchunh@nvidia.com> Signed-off-by: Chien-Chun Hung <2679986+chienchunhung@users.noreply.github.com>
d6134f2 to
5c9a7ec
Compare
|
/bot help |
GitHub Bot Help
Provide a user friendly way for developers to interact with a Jenkins server. Run See details below for each supported subcommand. Details
Launch build/test pipelines. All previously running jobs will be killed.
kill
Kill all running builds associated with pull request. skip
Skip testing for latest commit on pull request. reuse-pipeline
Reuse a previous pipeline to validate current commit. This action will also kill all currently running builds associated with the pull request. IMPORTANT NOTE: This is dangerous since lack of user care and validation can cause top of tree to break. |
|
/bot run --extra-stage "DGX_H100-8_GPUs-Disaggregated-1, DGX_H100-8_GPUs-Disaggregated-2, GB300-12_GPUs-3_Nodes-PyTorch-Disagg-PerfSanity-CTX1-NODE1-GPU4-GEN1-NODE2-GPU8-Post-Merge-1" |
|
PR_Github #61749 [ run ] triggered by Bot. Commit: |
|
PR_Github #61749 [ run ] completed with state
|
|
Most of the work in this PR are split into other PRs. |
Note
Superseded draft — do not merge as-is.
This work is mostly covered by newer PRs. Those successor PRs are still open, so the lifecycle gaps are not yet resolved on
main.Scope disposition
Recommendation
Do not merge or cherry-pick this PR wholesale. Close it after the remaining small deltas are either incorporated into the successor PRs or explicitly tracked: