Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BugFix] Fix recovery logic for sequence group #2186

Merged
merged 2 commits into from
Dec 21, 2023
Merged

Conversation

WoosukKwon
Copy link
Collaborator

When a sequence group has N sequences, N - 1 of which are terminated, the remaining sequence can be recovered from preemption using the re-computation mechanism. However, currently the scheduler assumes that every sequence in a waiting sequence group is in the waiting state. This PR fixes this error.

An example test case:

from vllm import LLM, SamplingParams

# Configured for A100-80GB GPU.
llm = LLM("meta-llama/Llama-2-13b-hf", gpu_memory_utilization=0.5, swap_space=20)

num_prompts = 1000
prompt_len = 300
llm.generate(
    prompt_token_ids=[[0] * prompt_len for _ in range(num_prompts)],
    sampling_params=SamplingParams(max_tokens=100, n=2))

@WoosukKwon
Copy link
Collaborator Author

@zhuohan123 This PR is ready for review. Please take a look at it!

Copy link
Member

@zhuohan123 zhuohan123 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks for the fix!

@WoosukKwon WoosukKwon merged commit a1b9cb2 into main Dec 21, 2023
2 checks passed
@WoosukKwon WoosukKwon deleted the fix-recovery branch December 21, 2023 05:52
hongxiayang pushed a commit to hongxiayang/vllm that referenced this pull request Feb 13, 2024
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.

2 participants