Repository navigation
Conversation
Contributor
|
This pull request has merge conflicts that must be resolved before it can be |
5 of 6 tasks
Signed-off-by: TianZhuo <2770730562@qq.com>
Signed-off-by: TianZhuo <2770730562@qq.com>
Signed-off-by: fangyuchu <fangyuchu@qq.com>
fangyuchu
force-pushed
the
feature/request_resume
branch
from
August 6, 2026 14:23
f87df3f to
7374dea
Compare
fangyuchu
marked this pull request as ready for review
August 6, 2026 15:04
fangyuchu
requested review from
ProExpertProg,
WoosukKwon,
houseroad,
mgoin,
njhill,
robertgshaw2-redhat,
tlrmchlsmth,
yewentao256 and
youkaichao
as code owners
August 6, 2026 15:04
This was referenced Oct 13, 2026
This branch has not been deployed
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.
Purpose
Add a
resume_requests_after_recoveryoption toFaultToleranceConfig(--fault-tolerance-config='{"resume_requests_after_recovery": true}', defaultFalse) that lets in-flight requests continue generating after the engine recovers from a fault, instead of being aborted — with no duplicated or lost tokens visible to the client.Today, when the busy loop raises under the fault-tolerance framework,
EngineCoreSentinel.on_fault()aborts every running request (finish_requests(..., FINISHED_ABORTED)+_send_abort_outputs), and the client receives an abort notification — even though the engine is about to recover viaretryand could have continued serving them.With
resume_requests_after_recovery: true:Engine side (
EngineCoreSentinel.on_fault):_clear_contaminated_blocks): the faulted step may have partially written KV for in-flight tokens. The blocks covering[num_computed_tokens - num_in_flight_tokens, num_computed_tokens - 1]of each running request are evicted from the prefix cache, so the post-recovery re-prefill never reuses KV written by the failed step._preempt_request(frees blocks, resetsnum_computed_tokens = 0).num_in_flight_tokens/num_stale_output_tokensare then zeroed because the faulted step's output frames will never return — there is nothing left to drain.prev_step_scheduled_req_idsis cleared.retrycompletes and the busy loop restarts, the scheduler re-schedules the preempted requests automatically. The re-prefill covers the prompt plus already-generated tokens and hits the retained prefix cache, so recovery is cheap; decoding then continues and only new tokens are streamed. The client observes a stall, not a failure — no abort, no duplicated or lost tokens.Worker side (
WorkerSentinel._clean_worker_state):_remove_request, and resumed requests are rebuilt from scratch byadd_requestsafter recovery. No resume-specific handling needed.CachedRequestState(model_runner.requests,num_prompt_logprobs) is retained, because the resumed-request path (scheduled_cached_reqs.resumed_req_ids) indexesmodel_runner.requests[req_id]directly.Default is
False— existing behavior (abort on fault) is unchanged unless explicitly opted in.Test Plan
E2E (
tests/v1/fault_tolerance/test_fault_tolerance_e2e.py, requires 2 GPUs + nixl_ep):test_injected_fault_retry_recovers_all_ranksis extended to cover the resume path: a long streaming completion (max_tokens = fault_step + 50) runs on rank 0 withresume_requests_after_recovery: true, while a fault is injected into the DP-sync allreduce (sync_cudagraph_and_dp_padding) on rank 1 atfault_step. The test asserts that:retryon both engines, the stream resumes and completes with exactlymax_tokenschunks (no loss, no duplication) andfinish_reason == "length".Manual E2E (external LB mode, DP+EP,
--enable-fault-tolerance,resume_requests_after_recovery: true):retryviaPOST /fault_tolerance/apply.Test Result
2 passed).retry, the in-flight streaming request resumed and generated to completion; the client received no abort notification and no duplicate tokens, and both engines returned tohealthyand kept serving.Essential Elements of an Effective PR Description Checklist
supported_models.mdandexamplesfor a new model.BEFORE SUBMITTING, PLEASE READ https://docs.vllm.ai/en/latest/contributing (anything written below this line will be removed by GitHub Actions)