Skip to content

[Bugfix][Core] Alternate: Keep resumable sessions that stop while preempted - #59501

Closed
yzong-rh wants to merge 2 commits into
vllm-project:mainfrom
yzong-rh:yzong-rh/preempt-stop-resumable
Closed

yzong-rh wants to merge 2 commits into
vllm-project:mainfrom
yzong-rh:yzong-rh/preempt-stop-resumable

Conversation

@yzong-rh

@yzong-rh yzong-rh commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

Overview

My attempt to address the issues #58778 with the following modifications per #58778 (review)

  • Centralize _enqueue_waiting_request calls. Remove it from _handle_stopped_request
  • Use num_tokens - 1 instead of max(num_computed_tokens, num_tokens - 1)
  • Reject reject resumable + encoder-only or diffusion

Requires #58668 to land first.

Claims

Validation

Details


Pull Request Checklist
  • I used vLLM's /pr-checklist skill. (Mandatory for agents, optional for humans).

  • AI assistance was used during the creation of this PR.

  • Design Fit: Minimizes impact on core components, reuses existing functionality, and justifies added complexity.

  • Testing and Validation: Validates the change and ensures any added tests are meaningful and reliable, with CI coverage or documented CI resource constraints and validation performed outside CI.

  • Code Quality and Style: Keeps code and comments clear and concise, and updates relevant documentation and examples.

  • Pull Request Contents: Includes a brief summary and relevant links, supports claims with evidence, explains root causes and implementation trade-offs, and follows the contributing guide.

BEFORE SUBMITTING, PLEASE READ https://docs.vllm.ai/en/latest/contributing (anything written below this line will be removed by GitHub Actions)

@mergify

mergify Bot commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

This pull request has merge conflicts that must be resolved before it can be
merged. Please rebase the PR, @yzong-rh.

https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork

@mergify mergify Bot added the needs-rebase label Oct 2, 2026
Signed-off-by: Yifan Zong <yzong@redhat.com>
Signed-off-by: Yifan Zong <yzong@redhat.com>
@yzong-rh
yzong-rh force-pushed the yzong-rh/preempt-stop-resumable branch from 983f6db to 938db41 Compare October 5, 2026 21:43
@mergify mergify Bot removed the needs-rebase label Oct 5, 2026
@mergify

mergify Bot commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

This pull request has merge conflicts that must be resolved before it can be
merged. Please rebase the PR, @yzong-rh.

https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork

@mergify mergify Bot added the needs-rebase label Oct 6, 2026
sawsa307 added a commit to sawsa307/vllm that referenced this pull request Oct 6, 2026
Adopts the approach from vllm-project#59501:

- Don't enqueue in _handle_stopped_request; update_from_output removes
  stopped requests from their queues and enqueues unfinished ones
  exactly once, so a request is never in two queues at once.
- Fold at num_tokens - 1 directly instead of max(num_computed_tokens,
  num_tokens - 1); after vllm-project#58668 the two coincide in the normal
  autoregressive case, and the new assert guards that invariant.
- Reject resumable requests for encoder-only and diffusion models,
  which do not satisfy the invariant.

Existing fold tests now append a sampled token so the session state
satisfies the fold invariant, and the upstream empty-stream test sets
the model-type flags exercised by the new validation.

Co-authored-by: Yifan Zong <yzong@redhat.com>
Signed-off-by: David Cheung <d7cheung@gmail.com>
@yzong-rh

yzong-rh commented Oct 6, 2026

Copy link
Copy Markdown
Contributor Author

Superceded by #58778

@yzong-rh yzong-rh closed this Oct 6, 2026
sawsa307 added a commit to sawsa307/vllm that referenced this pull request Oct 15, 2026
Adopts the approach from vllm-project#59501:

- Don't enqueue in _handle_stopped_request; update_from_output removes
  stopped requests from their queues and enqueues unfinished ones
  exactly once, so a request is never in two queues at once.
- Fold at num_tokens - 1 directly instead of max(num_computed_tokens,
  num_tokens - 1); after vllm-project#58668 the two coincide in the normal
  autoregressive case, and the new assert guards that invariant.
- Reject resumable requests for encoder-only and diffusion models,
  which do not satisfy the invariant.

Existing fold tests now append a sampled token so the session state
satisfies the fold invariant, and the upstream empty-stream test sets
the model-type flags exercised by the new validation.

Co-authored-by: Yifan Zong <yzong@redhat.com>
Signed-off-by: David Cheung <d7cheung@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants