Skip to content
Open
Show file tree
Hide file tree
Changes from 15 commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
d2e3a8a
[Frontend][Core] Add unified readiness checks
Sep 15, 2026
b358043
Merge upstream/main into feat/health-generate-api
Sep 29, 2026
b368791
Merge branch 'main' into feat/health-generate-api
lio1226 Sep 29, 2026
af7f114
[Core][Frontend] Harden /ready for DP>1 and report not-ready details
SumanthRH Oct 6, 2026
9493915
Merge remote-tracking branch 'origin/main' into health-generate-api
SumanthRH Oct 8, 2026
738c565
Merge branch 'main' into health-generate-api
aoshen02 Oct 8, 2026
68aed53
[Test] Declare attributes used by readiness fault injection for mypy
SumanthRH Oct 8, 2026
d8c0fa0
[Rust Frontend] Accept engine readiness outputs
SumanthRH Oct 8, 2026
94cc699
[Core] Evaluate /ready per engine rank from engine-reported state
SumanthRH Oct 8, 2026
ccc2684
[Core] Run the idle /ready probe without LoRA side effects and wait f…
SumanthRH Oct 8, 2026
4a6b23e
[Core] Do not report connector-only cleanup as a stalled engine
SumanthRH Oct 8, 2026
9090b07
[Core] Publish readiness only through the broadcast
SumanthRH Oct 8, 2026
3aeaa9e
[Core] Default check_health_gpu on WorkerBase; split readiness tests …
SumanthRH Oct 9, 2026
79dc98b
[Doc] Annotate EngineUnhealthyError details for the strict docs build
SumanthRH Oct 9, 2026
b999927
[Core] Check every worker in the idle /ready probe
SumanthRH Oct 9, 2026
8a5c9a5
Merge remote-tracking branch 'upstream/main' into health-generate-api
SumanthRH Oct 11, 2026
9ea6127
[Frontend] Keep the DP supervisor's /ready as on main
SumanthRH Oct 12, 2026
4460e8c
[Frontend] Rename /ready to /health_generate
SumanthRH Oct 13, 2026
b118a44
[Core] Decide /health_generate in the EngineCore instead of broadcast…
SumanthRH Oct 23, 2026
53d067b
[Core] Keep /health_generate to the readiness check
SumanthRH Nov 10, 2026
b1c21b6
[Docs] Describe /health_generate as a readiness check without progres…
SumanthRH Nov 10, 2026
81c2d8c
[Test] Keep the /health_generate unit tests to rank aggregation, prob…
SumanthRH Nov 11, 2026
b4d9fa5
[Test] Test the busy and sleeping probe skip; drop unused /health_gen…
SumanthRH Nov 11, 2026
5d91229
[Core] Rename the /health_generate env vars to VLLM_HEALTH_GENERATE_*
SumanthRH Nov 11, 2026
4ee9824
[Docs] Document /health_generate and its use as a Kubernetes readines…
SumanthRH Nov 11, 2026
8d57777
Merge remote-tracking branch 'origin/main' into health-generate-api
SumanthRH Nov 12, 2026
9d2d9d8
[Test] Run the /health_generate fault-injection tests only on CUDA
SumanthRH Nov 12, 2026
60a16f5
[Core] Return /health_generate probe errors as data so executor repli…
SumanthRH Nov 12, 2026
458b86d
[Core] Re-enable the KV connector when a dummy run raises
SumanthRH Nov 12, 2026
ac59e48
[Frontend] Take the /health_generate timeout as a query parameter ins…
SumanthRH Nov 12, 2026
c2d9750
[Test] Check that the /health_generate background load is served
SumanthRH Nov 12, 2026
e1266ed
[Core] Drop the /health_generate idle probe cache and reuse has_work()
SumanthRH Nov 13, 2026
dfb8cf6
Merge remote-tracking branch 'origin/main' into health-generate-api
aoshen02 Nov 20, 2026
091ad0d
[Core] Re-enable the KV connector in the health probe, not in _dummy_run
aoshen02 Nov 20, 2026
b5d9a38
[Core] Untimed forward probe, layer names, and readiness test placement
aoshen02 Nov 20, 2026
adfd1fd
[Core] Probe with _dummy_run directly; annotate the probe replies for…
aoshen02 Nov 20, 2026
0e415e5
Merge branch 'main' into health-generate-api
aoshen02 Nov 20, 2026
76203bc
Merge branch 'main' into health-generate-api
aoshen02 Nov 20, 2026
8190e9d
Merge branch 'main' into health-generate-api
aoshen02 Nov 20, 2026
1955cba
Merge branch 'main' into health-generate-api
aoshen02 Nov 22, 2026
b006498
Merge branch 'main' into health-generate-api
aoshen02 Nov 23, 2026
6bb50ed
Merge branch 'main' into health-generate-api
vllm-agent Nov 23, 2026
ce0911d
Merge branch 'main' into health-generate-api
aoshen02 Nov 23, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .buildkite/test_areas/distributed.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ steps:
- vllm/v1/engine/
- vllm/v1/worker/
- tests/v1/distributed
- tests/v1/engine/readiness/
- vllm/entrypoints/serve/instrumentator/health.py
- tests/entrypoints/launchers/api_server/test_multi_api_servers.py
- tests/v1/e2e/general/test_sharded_sampling.py
- tests/v1/e2e/spec_decode/test_sharded_sampling.py
Expand All @@ -98,6 +100,7 @@ steps:
# https://github.com/NVIDIA/nccl/issues/1838
- export NCCL_CUMEM_HOST_ENABLE=0
- TP_SIZE=1 DP_SIZE=2 pytest -v -s v1/distributed/test_async_llm_dp.py
- pytest -v -s v1/engine/readiness/test_ready_multi_gpu.py
- TP_SIZE=1 DP_SIZE=2 pytest -v -s v1/distributed/test_eagle_dp.py
- TP_SIZE=1 DP_SIZE=2 pytest -v -s v1/distributed/test_external_lb_dp.py
- DP_SIZE=2 pytest -v -s entrypoints/launchers/api_server/test_multi_api_servers.py
Expand Down
1 change: 1 addition & 0 deletions .buildkite/test_areas/engine.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ steps:
timeout_in_minutes: 45
source_file_dependencies:
- vllm/v1/engine/
- vllm/entrypoints/serve/instrumentator/health.py
- tests/v1/engine/
- tests/v1/test_tensor_ipc_queue.py
commands:
Expand Down
1 change: 1 addition & 0 deletions docs/usage/security.md
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@ The following endpoints **do not require authentication** even when `--api-key`
- `/tokenize` - Tokenize text (not gated by `--enable-scale-out`)
- `/detokenize` - Detokenize tokens
- `/health` - Health check
- `/ready` - GPU execution and EngineCore forward-progress check
- `/ping` - SageMaker health check
- `/version` - Version information
- `/load` - Server load metrics
Expand Down
4 changes: 4 additions & 0 deletions rust/src/engine-core-client/src/client/imp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -513,6 +513,10 @@ pub(crate) async fn run_output_dispatcher_loop(
);
}
}
EngineCoreOutputs::Readiness(readiness) => {
// The Rust frontend does not serve /ready yet.
trace!(?readiness, "ignoring engine readiness progress");
}
other => {
Err::<(), _>(unexpected_dispatcher_output!(
"received unexpected output on main dispatcher path: {other:?}"
Expand Down
64 changes: 64 additions & 0 deletions rust/src/engine-core-client/src/protocol/output.rs
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,37 @@ struct WireEngineCoreOutputs {
/// wave needs to start in other engines.
#[serde(default)]
start_wave: Option<u32>,
/// Readiness progress published by engine-core. Broadcast on its own and
/// also stamped onto request batches.
#[serde(default)]
ready_progress_seq: Option<u64>,
#[serde(default)]
ready_state: Option<EngineCoreReadyState>,
/// Utility call the engine is executing, if any.
#[serde(default)]
ready_operation: Option<String>,
}

/// Engine-core readiness state.
///
/// Original Python definition: `EngineCoreReadyState` in
/// `vllm/v1/engine/__init__.py`.
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize_repr, Deserialize_repr)]
#[repr(u8)]
pub enum EngineCoreReadyState {
Idle = 0,
Busy = 1,
Sleeping = 2,
}

/// Readiness progress broadcast by an engine to every frontend.
#[derive(Debug, Clone, PartialEq)]
pub struct ReadinessOutput {
pub engine_index: u32,
pub timestamp: f64,
pub progress_seq: u64,
pub state: EngineCoreReadyState,
pub operation: Option<String>,
}

/// Data-parallel control notifications multiplexed through `EngineCoreOutputs`.
Expand Down Expand Up @@ -266,6 +297,7 @@ pub enum EngineCoreOutputs {
RequestBatch(RequestBatchOutputs),
Utility(UtilityCallOutput),
DpControl(DpControlOutput),
Readiness(ReadinessOutput),
}

impl From<RequestBatchOutputs> for EngineCoreOutputs {
Expand All @@ -286,6 +318,12 @@ impl From<DpControlOutput> for EngineCoreOutputs {
}
}

impl From<ReadinessOutput> for EngineCoreOutputs {
fn from(output: ReadinessOutput) -> Self {
Self::Readiness(output)
}
}

impl EngineCoreOutputs {
/// Resolve all wire-format fields in-place by looking up aux frames and
/// decoding raw-view payloads as needed.
Expand All @@ -308,6 +346,24 @@ impl TryFrom<WireEngineCoreOutputs> for EngineCoreOutputs {
|| value.scheduler_stats.is_some()
|| value.finished_requests.is_some();

// Readiness fields are only meaningful on their own; other payloads
// carrying them are classified by that payload.
if !has_request_payload
&& value.utility_output.is_none()
&& value.wave_complete.is_none()
&& value.start_wave.is_none()
&& let (Some(progress_seq), Some(state)) = (value.ready_progress_seq, value.ready_state)
{
return Ok(ReadinessOutput {
engine_index: value.engine_index,
timestamp: value.timestamp,
progress_seq,
state,
operation: value.ready_operation,
}
.into());
}

match (
has_request_payload,
&value.utility_output,
Expand Down Expand Up @@ -379,6 +435,14 @@ impl From<EngineCoreOutputs> for WireEngineCoreOutputs {
..Default::default()
}
}
EngineCoreOutputs::Readiness(readiness) => Self {
engine_index: readiness.engine_index,
timestamp: readiness.timestamp,
ready_progress_seq: Some(readiness.progress_seq),
ready_state: Some(readiness.state),
ready_operation: readiness.operation,
..Default::default()
},
}
}
}
Expand Down
27 changes: 26 additions & 1 deletion rust/src/engine-core-client/src/tests/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ use crate::protocol::multimodal::{
};
use crate::protocol::output::{
DpControlMessage, DpControlOutput, EngineCoreFinishReason, EngineCoreOutput, EngineCoreOutputs,
RequestBatchOutputs, UtilityCallOutput, decode_engine_core_outputs,
EngineCoreReadyState, ReadinessOutput, RequestBatchOutputs, UtilityCallOutput,
decode_engine_core_outputs,
};
use crate::protocol::request::{EngineCoreRequest, EngineCoreRequestType};
use crate::protocol::sampling::EngineCoreSamplingParams;
Expand Down Expand Up @@ -2738,6 +2739,8 @@ fn python_msgpack_fixtures_match_rust_encoding() {
lines.next().expect("missing MultiConnector stats fixture line");
let ready_response_hex = lines.next().expect("missing ready response fixture line");
let extended_outputs_hex = lines.next().expect("missing extended outputs fixture line");
let readiness_outputs_hex = lines.next().expect("missing readiness outputs fixture line");
let stamped_outputs_hex = lines.next().expect("missing stamped outputs fixture line");

let request_bytes = hex::decode(request_hex).unwrap();
let multimodal_request_bytes = hex::decode(multimodal_request_hex).unwrap();
Expand Down Expand Up @@ -2872,6 +2875,28 @@ fn python_msgpack_fixtures_match_rust_encoding() {
"#]]
.assert_debug_eq(&decoded_outputs);

let readiness_frames = [bytes::Bytes::from(
hex::decode(readiness_outputs_hex).unwrap(),
)];
assert_eq!(
decode_engine_core_outputs(&readiness_frames).unwrap(),
EngineCoreOutputs::Readiness(ReadinessOutput {
engine_index: 0,
timestamp: 0.0,
progress_seq: 7,
state: EngineCoreReadyState::Busy,
operation: Some("collective_rpc:update_weights".to_string()),
})
);
// Readiness stamped onto a request batch does not change the batch.
let stamped_frames = [bytes::Bytes::from(
hex::decode(stamped_outputs_hex).unwrap(),
)];
assert_eq!(
decode_engine_core_outputs(&stamped_frames).unwrap(),
decoded_outputs
);

let decode_frames = |line: &str| {
line.split_whitespace()
.map(|frame| bytes::Bytes::from(hex::decode(frame).unwrap()))
Expand Down
24 changes: 24 additions & 0 deletions rust/src/engine-core-client/src/tests/python_compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,12 @@ class ExtendedEngineCoreOutput(EngineCoreOutput):
new_prompt_len_snapshot: int | None = None


class EngineCoreReadyState(IntEnum):
IDLE = 0
BUSY = 1
SLEEPING = 2


class EngineCoreOutputs(
msgspec.Struct,
array_like=True,
Expand All @@ -139,6 +145,9 @@ class EngineCoreOutputs(
finished_requests: set[str] | None = None
wave_complete: int | None = None
start_wave: int | None = None
ready_progress_seq: int | None = None
ready_state: EngineCoreReadyState | None = None
ready_operation: str | None = None


request = EngineCoreRequest(
Expand Down Expand Up @@ -556,3 +565,18 @@ class EngineCoreReadyResponse:
print(msgspec.msgpack.encode(multi_connector_stats).hex())
print(msgspec.msgpack.encode(ready_response).hex())
print(extended_outputs_bytes.hex())

# EngineCore broadcasts readiness on its own and stamps it onto request batches.
readiness_outputs = EngineCoreOutputs(
ready_progress_seq=7,
ready_state=EngineCoreReadyState.BUSY,
ready_operation="collective_rpc:update_weights",
)
stamped_outputs = EngineCoreOutputs(
outputs=outputs.outputs,
finished_requests=outputs.finished_requests,
ready_progress_seq=8,
ready_state=EngineCoreReadyState.BUSY,
)
print(msgspec.msgpack.encode(readiness_outputs).hex())
print(msgspec.msgpack.encode(stamped_outputs).hex())
18 changes: 18 additions & 0 deletions tests/entrypoints/launchers/test_dp_supervisor.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,24 @@ def test_handles_shutdown_event():
assert supervisor.is_ready is False


@pytest.mark.asyncio
async def test_ready_aggregates_children_without_shutdown(monkeypatch):
supervisor = DPSupervisor(_make_unit_args())
supervisor._is_ready = True
supervisor.child_ports = [8000, 8001]
probed_paths = []

async def fake_probe(_session, _args, port, path, **_kwargs):
probed_paths.append((port, path))
return port == 8000

monkeypatch.setattr(dp_sup, "_probe_endpoint", fake_probe)

assert not await supervisor.check_ready()
assert probed_paths == [(8000, "/ready"), (8001, "/ready")]
assert not supervisor._shutdown_event.is_set()


@pytest.mark.asyncio
async def test_shutdown_children_uses_engine_process_timeout(
monkeypatch: pytest.MonkeyPatch,
Expand Down
86 changes: 85 additions & 1 deletion tests/entrypoints/serve/instrumentator/test_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project

import asyncio
import json
from http import HTTPStatus
from unittest.mock import AsyncMock, Mock

Expand All @@ -13,7 +14,11 @@

from tests.utils import RemoteOpenAIServer
from vllm import envs
from vllm.v1.engine.exceptions import EngineDeadError
from vllm.v1.engine.exceptions import (
EngineDeadError,
EngineSleepingError,
EngineUnhealthyError,
)
from vllm.version import __version__ as VLLM_VERSION

MODEL_NAME = "Qwen/Qwen3-0.6B"
Expand Down Expand Up @@ -97,6 +102,13 @@ async def test_check_health(server: RemoteOpenAIServer):
assert response.status_code == HTTPStatus.OK


@pytest.mark.asyncio
async def test_check_ready(server: RemoteOpenAIServer):
response = requests.get(server.url_for("ready"))

assert response.status_code == HTTPStatus.OK


@pytest.mark.parametrize(
"server_args",
[
Expand Down Expand Up @@ -224,3 +236,75 @@ async def test_health_check_engine_dead_error():

# Assert that it returns 503 Service Unavailable
assert response.status_code == 503


@pytest.mark.asyncio
@pytest.mark.parametrize("error", [EngineDeadError(), EngineUnhealthyError()])
async def test_ready_check_engine_error(error: Exception):
from vllm.entrypoints.serve.instrumentator.health import ready

mock_request = Mock(spec=Request)
mock_app_state = Mock()
mock_engine_client = AsyncMock()
mock_engine_client.check_health_gpu.side_effect = error
mock_app_state.engine_client = mock_engine_client
mock_request.app.state = mock_app_state

response = await ready(mock_request)

assert response.status_code == 503


@pytest.mark.asyncio
async def test_ready_check_engine_sleeping_reason():
from vllm.entrypoints.serve.instrumentator.health import ready

mock_request = Mock(spec=Request)
mock_app_state = Mock()
mock_engine_client = AsyncMock()
mock_engine_client.check_health_gpu.side_effect = EngineSleepingError(
"paused", engine_ranks=[0], in_progress=[]
)
mock_app_state.engine_client = mock_engine_client
mock_request.app.state = mock_app_state

response = await ready(mock_request)

assert response.status_code == 503
assert json.loads(response.body) == {
"status": "not_ready",
"reason": "sleeping",
"message": "paused",
"engine_ranks": [0],
"in_progress": [],
}


@pytest.mark.asyncio
async def test_ready_check_reports_in_progress_operations():
"""A probe stuck behind a long control call says what the engine is doing."""
from vllm.entrypoints.serve.instrumentator.health import ready

operation = {
"operation": "collective_rpc:update_weights",
"engine_rank": 0,
"elapsed_s": 42.0,
}
mock_request = Mock(spec=Request)
mock_app_state = Mock()
mock_engine_client = AsyncMock()
mock_engine_client.check_health_gpu.side_effect = EngineUnhealthyError(
"timed out",
reason="probe_timeout",
timeout_s=20.0,
in_progress=[operation],
)
mock_app_state.engine_client = mock_engine_client
mock_request.app.state = mock_app_state

response = await ready(mock_request)

assert response.status_code == 503
body = json.loads(response.body)
assert body["reason"] == "probe_timeout"
assert body["in_progress"] == [operation]
Empty file.
Loading
Loading