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

avoid python list copy in sequence initialization #401

Merged
merged 1 commit into from
Jul 8, 2023

Conversation

LiuXiaoxuanPKU
Copy link
Collaborator

The pr tries to fix this.

Before the fix, vllm will be stuck for a while when the input is very long before returning to the user. This is because we have an expensive python list copy in the _append_tokens_to_blocks function used by sequence initialization here. (For the Shakespeare example, it takes 226s for this line).

After this fix, the sequence initialization function returns instantly (<1e-5 s).

Copy link
Collaborator

@WoosukKwon WoosukKwon left a comment

Choose a reason for hiding this comment

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

Awesome! Thanks a lot for fixing the bug! I never thought this can be problematic.

@WoosukKwon WoosukKwon merged commit 2179e4f into vllm-project:main Jul 8, 2023
2 checks passed
@LiuXiaoxuanPKU LiuXiaoxuanPKU deleted the fix_list branch November 6, 2023 18:04
hongxiayang pushed a commit to hongxiayang/vllm that referenced this pull request Feb 13, 2024
sjchoi1 pushed a commit to casys-kaist-internal/vllm that referenced this pull request May 7, 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.

None yet

2 participants