-
-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
[Core] Modulize prepare input and attention metadata builder #6596
Conversation
👋 Hi! Thank you for contributing to the vLLM project. Once the PR is approved and ready to go, please make sure to run full CI as it is required to merge (or just use auto-merge). To run full CI, you can do one of these:
🚀 |
fb00532
to
8a2c134
Compare
8a2c134
to
0d9d62e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM assuming most of code is refactoring. I will also wait for @Yard1's review since he will be the one who needs to use API
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good, some nits
a7719d9
to
f386f69
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
tokens = [seq_data.get_last_token_id()] | ||
|
||
inter_data.seq_lens[seq_idx] = seq_len | ||
inter_data.orig_seq_lens[seq_idx] = seq_len |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it a bug? seq_len
might be truncated according to line 300: seq_len = min(seq_len, context_len + token_chunk_size)
…oject#6596) Signed-off-by: Alvant <[email protected]>
This PR further refactors model input builder and attention metadata builder to be more modulized and maintainable. Specifically:
attention_matadata_builder._add_seq_group
private, and let each attention metadata builder handle by itself. This removes the ugly argument list and provides more flexibility for each attention backend to customizeadd_seq_group
.cc @Yard1 @rkooo567