-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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] Make encoder-decoder inputs a nested structure to be more composable #9604
Conversation
👋 Hi! Thank you for contributing to the vLLM project. Once the PR is approved and ready to go, your PR reviewer(s) can run CI to test the changes comprehensively before merging. To run CI, PR reviewers can do one of these:
🚀 |
@heheda12345 PTAL at the changes to mllama processor to ensure that the semantics remain the same. I can successfully run the example script, so it's probably fine. |
@DarkLight1337 I've verified that |
To unblock the next steps, @robertgshaw2-neuralmagic @njhill can you review this? |
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.
Thanks @DarkLight1337, looks good
vllm/sequence.py
Outdated
if inputs["type"] == "token": | ||
return inputs.get("prompt") | ||
|
||
return cast(Optional[str], self.inputs.get(prompt_key)) | ||
assert_never(inputs) |
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 there a reason to not write these like this? (which is clearer imo)
assert inputs["type"] == "token"
return inputs.get("prompt")
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.
It's to reduce diffs when introducing #6869 which adds a new inputs["type"] == "embed"
branch.
if encoder_inputs["type"] == "token": | ||
pass | ||
else: | ||
assert_never(encoder_inputs) |
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.
Presumably this is needed for static type checking and this wouldn't suffice?
assert encoder_inputs["type"] == "token"
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.
See my first comment.
This pull request has merge conflicts that must be resolved before it can be |
@njhill I have finished addressing your comments. |
Signed-off-by: DarkLight1337 <[email protected]>
Signed-off-by: DarkLight1337 <[email protected]>
Signed-off-by: DarkLight1337 <[email protected]>
Signed-off-by: DarkLight1337 <[email protected]>
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.
Thanks @DarkLight1337
…osable (#9604) Signed-off-by: DarkLight1337 <[email protected]>
…osable (vllm-project#9604) Signed-off-by: DarkLight1337 <[email protected]> Signed-off-by: Loc Huynh <[email protected]>
…osable (vllm-project#9604) Signed-off-by: DarkLight1337 <[email protected]> Signed-off-by: Sumit Dubey <[email protected]>
…osable (vllm-project#9604) Signed-off-by: DarkLight1337 <[email protected]>
…osable (vllm-project#9604) Signed-off-by: DarkLight1337 <[email protected]> Signed-off-by: Maxime Fournioux <[email protected]>
…osable (vllm-project#9604) Signed-off-by: DarkLight1337 <[email protected]> Signed-off-by: Tyler Michael Smith <[email protected]>
…osable (vllm-project#9604) Signed-off-by: DarkLight1337 <[email protected]>
This PR updates encoder-decoder inputs: from a flat schema that inherits from decoder-only inputs with additional
encoder-*
fields, to a nested structure with separateencoder
anddecoder
components.With separated
encoder
anddecoder
components, it becomes easier to support input embeddings for decoder-only models first in #6869.