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

Remove AsyncLLMEngine busy loop, shield background task #1059

Merged
merged 7 commits into from
Sep 17, 2023

Conversation

Yard1
Copy link
Collaborator

@Yard1 Yard1 commented Sep 15, 2023

This PR reduces CPU utilisation of AsyncLLMEngine by replacing busy looping with an asyncio.Event triggered whenever there are new requests, and makes sure that the background loop task is shielded from cancellation.

Signed-off-by: Antoni Baum <antoni.baum@protonmail.com>
Signed-off-by: Antoni Baum <antoni.baum@protonmail.com>
@Yard1 Yard1 changed the title Remove AsyncLLMEngine busy loop, shield bg task Remove AsyncLLMEngine busy loop, shield background task Sep 15, 2023
@Yard1
Copy link
Collaborator Author

Yard1 commented Sep 15, 2023

cc @zhuohan123

vllm/engine/async_llm_engine.py Outdated Show resolved Hide resolved
vllm/engine/async_llm_engine.py Outdated Show resolved Hide resolved
vllm/engine/async_llm_engine.py Outdated Show resolved Hide resolved
vllm/engine/async_llm_engine.py Outdated Show resolved Hide resolved
Signed-off-by: Antoni Baum <antoni.baum@protonmail.com>
@Yard1 Yard1 requested a review from zhuohan123 September 16, 2023 00:59
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!

@zhuohan123 zhuohan123 merged commit ff36139 into vllm-project:main Sep 17, 2023
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