Skip to content

fix(serve): wait on the engine's readiness budget, fail fast on a dead engine - #4

Closed
mikeroySoft wants to merge 1 commit into
upstream-mainfrom
fix/serve-ready-timeout
Closed

mikeroySoft wants to merge 1 commit into
upstream-mainfrom
fix/serve-ready-timeout

Conversation

@mikeroySoft

Copy link
Copy Markdown
Owner

Base: upstream-main — pinned to ROCm/rocm-cli@fdfa620.
Group: rocm serve launch reliability. Unrelated to Hyperloom-R, but it touches wait_for_service_http_ready_with_progress, which the Hyperloom-R branch also adapts — see the conflict note below.

Mirror of the PR opened upstream as ROCm#202.

Problem

rocm serve reported a healthy vLLM launch as a failure. Both the launch and restart paths waited a hardcoded 45 s while vLLM's own budget is 5 minutes, and a cold start here takes ~54 s:

14:38:37  vllm boot
14:39:22  rocm serve gives up  ->  "Deployment summary (not ready yet)"
14:39:31  Application startup complete  ->  service actually ready

Change

  1. Budget comes from the engine, via new public rocm_engine_vllm::ready_timeout().
  2. on_tick can end the wait early, so a longer budget does not slow a real crash down. Process liveness is unusable as the signal — the supervisor is our own child and kill(pid,0) still reports it alive while it is an unreaped zombie, which cost a full 5-minute spin before I switched to the engine's state file.
  3. The summary distinguishes failed from running/starting.

Verification

On a Radeon AI PRO R9700 (gfx1201), TheRock nightly, vLLM 0.23.0:

Scenario Before After
Qwen3-0.6B "not ready yet" ready, TTFT 27 ms, 166.9 tok/s
crash in engine-core init 5 min → "may still be loading" 7.9 s → failed, note points at the engine error
crash 81 s in "not ready" at 45 s waits past 45 s, reports the real outcome

Four tests added. Clippy, fmt, scripts/smoke_local.py clean.

Conflict note

PR #1 (Hyperloom-R) adapts the same function's call in bench_run.rs. Whichever of the two merges second needs a trivial rebase — the two changes are compatible, they just touch adjacent code.

…d engine

`start_managed_service` and the restart path both waited a hardcoded 45 s
for a managed service to become ready, while vLLM's own startup budget is
5 minutes (`DEFAULT_VLLM_READY_TIMEOUT`, tunable via
`ROCM_CLI_VLLM_READY_TIMEOUT_SECS`). A cold vLLM start — torch import,
aiter/triton JIT, KV-cache warmup — routinely runs past a minute, so a
healthy launch was reported as "not ready" seconds before the server came
up, and the deployment summary read as a failure:

    14:38:37  vllm boot
    14:39:22  rocm serve gives up -> "Deployment summary (not ready yet)"
    14:39:31  Application startup complete -> service actually ready

Take the budget from the engine instead, via a new public
`rocm_engine_vllm::ready_timeout()`, so the CLI cannot contradict the
engine it is waiting on.

A longer budget must not make a genuine crash slower to report, so the
progress callback can now end the wait early and `start_managed_service`
does so once the engine records a terminal status. Process liveness is not
usable here: the supervisor is our own child, so `process_is_running`
still reports it alive while it sits unreaped as a zombie. A launch the
engine gave up on is reported as `failed` with a note pointing at the
engine error, rather than "it may still be loading".

Verified on a Radeon AI PRO R9700 (gfx1201) with a TheRock nightly wheel
runtime:

  - Qwen3-0.6B: `status ready`, TTFT 27 ms, 166.9 tok/s
  - a model that crashes in engine-core init: reported `failed` after
    7.9 s instead of spinning the full budget
  - a model that crashes 81 s in: now waits past 45 s and reports the real
    outcome instead of a misleading "not ready"

Signed-off-by: Michael Roy <1791194+mikeroySoft@users.noreply.github.com>
@mikeroySoft mikeroySoft added ready-for-agent Fully specified and ready for an AFK agent and removed ready-for-agent Fully specified and ready for an AFK agent labels Aug 31, 2026
@mikeroySoft mikeroySoft closed this Sep 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant