-
-
Notifications
You must be signed in to change notification settings - Fork 8.7k
[Core] Registry for processing model inputs #5214
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
Merged
Merged
Changes from all commits
Commits
Show all changes
63 commits
Select commit
Hold shift + click to select a range
34bfa79
Introduce a higher level `INPUT_REGISTRY`
DarkLight1337 df2aa19
Move dummy data generation to input registry
DarkLight1337 c72d2b3
Update docs
DarkLight1337 d8c6488
Rename `process_input` to `map_input`
DarkLight1337 f18de48
Reorder arguments
DarkLight1337 653537d
Apply input processor
DarkLight1337 a2f5a3c
Remove `VisionLanguageConfig` from input mapper
DarkLight1337 378ad80
Fix bad use of `functools.partial`
DarkLight1337 7aa3778
Use default input processor
DarkLight1337 c774168
Merge branch 'upstream' into mm-image-tokenizer
DarkLight1337 532f863
Fix wrong arguments
DarkLight1337 080d40c
Use pillow image instead of tensor to avoid bypassing the processor b…
DarkLight1337 662693a
Update interface of dummy data factory and input processor
DarkLight1337 9bc5fcc
Use `InputContext` to handle checked type cast of config types
DarkLight1337 29c3bb3
Fix LLaVA-NeXT input processor and cleanup code
DarkLight1337 7bb6cbf
Add sanity check
DarkLight1337 ccf49c4
Merge branch 'upstream' into mm-image-tokenizer
DarkLight1337 3482d32
Merge branch 'upstream' into mm-image-tokenizer
DarkLight1337 8ea8468
Merge branch 'upstream' into mm-image-tokenizer
DarkLight1337 be3d64f
Merge branch 'upstream' into mm-image-tokenizer
DarkLight1337 2ff5be6
Merge branch 'upstream' into mm-image-tokenizer
DarkLight1337 8e2ff86
Update LLaVA-NeXT
DarkLight1337 553f684
Merge branch 'upstream' into mm-image-tokenizer
DarkLight1337 b134dfc
Update name
DarkLight1337 7e33706
Merge branch 'upstream' into mm-image-tokenizer
DarkLight1337 3fb622c
Remove `MULTIMODAL` convenience property as it was causing some (impo…
DarkLight1337 6a70e4f
Add docs
DarkLight1337 52a0116
Add docs
DarkLight1337 b7a8683
Merge branch 'upstream' into mm-image-tokenizer
DarkLight1337 25f9949
Merge branch 'upstream' into mm-image-tokenizer
DarkLight1337 fd7d954
Merge branch 'upstream' into mm-image-tokenizer
DarkLight1337 49dac3e
Merge branch 'upstream' into mm-image-tokenizer
DarkLight1337 0104218
Merge branch 'upstream' into mm-image-tokenizer
DarkLight1337 18cc7e0
Set up dummy data factory for phi3v
DarkLight1337 2291617
Move dummy data factories to model files
DarkLight1337 adf5503
Merge branch 'upstream' into mm-image-tokenizer
DarkLight1337 fecf1f0
Fix wrong feature size
DarkLight1337 086e0fe
Fix wrong feature size
DarkLight1337 c036b86
Merge branch 'upstream' into mm-image-tokenizer
DarkLight1337 bfa5aa9
Remove redundant code
DarkLight1337 07e695d
Apply isort
DarkLight1337 7229b07
Move `DummyImageDataFactories` into CLIP model file
DarkLight1337 d9a4150
Merge branch 'upstream' into mm-image-tokenizer
DarkLight1337 4b947ad
Merge branch 'upstream' into mm-image-tokenizer
DarkLight1337 9e82a26
Clarify docs and add todo
DarkLight1337 6b19e6c
Expand docs
DarkLight1337 f451668
Add ref
DarkLight1337 1abb8a7
Add docs
DarkLight1337 698830f
Fix name
DarkLight1337 36ab12d
Fix and add links
DarkLight1337 bf3281c
modify llava_next
ywang96 56e2d3b
Update comment
DarkLight1337 d2f8c6d
Update docs
DarkLight1337 7c197d2
Use dynamic image feature size calculation
DarkLight1337 f5ffd3e
Fix phi3v not handling `image_sizes` correctly
DarkLight1337 66aad21
Apply formatter
DarkLight1337 f2e4633
Merge branch 'upstream' into mm-image-tokenizer
DarkLight1337 a6e3162
Merge branch 'upstream' into mm-image-tokenizer
DarkLight1337 ce06541
Fix config
DarkLight1337 7e80ecc
Merge branch 'upstream' into mm-image-tokenizer
DarkLight1337 487d742
Merge branch 'upstream' into mm-image-tokenizer
DarkLight1337 43350b8
update example
ywang96 57791de
update doc
ywang96 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
20 changes: 20 additions & 0 deletions
20
docs/source/dev/input_processing/input_processing_pipeline.rst
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
.. _input_processing_pipeline: | ||
|
||
Input Processing Pipeline | ||
========================= | ||
|
||
1. Input data is passed to :class:`~vllm.LLMEngine` (or :class:`~vllm.AsyncLLMEngine`). | ||
|
||
2. Tokenize the data if necessary. | ||
|
||
3. Process the inputs using :meth:`INPUT_REGISTRY.process_input <vllm.inputs.registry.InputRegistry.process_input>`. | ||
|
||
- For example, add placeholder tokens to reserve KV cache for multi-modal embeddings. | ||
|
||
4. Send the processed inputs to :class:`~vllm.executor.executor_base.ExecutorBase`. | ||
|
||
5. Distribute the inputs via :class:`~vllm.worker.worker_base.WorkerBase` to :class:`~vllm.worker.model_runner_base.ModelRunnerBase`. | ||
|
||
6. If the data contains multi-modal data, convert it into keyword arguments using :meth:`MULTIMODAL_REGISTRY.map_input <vllm.multimodal.MultiModalRegistry.map_input>`. | ||
|
||
- For example, convert a :class:`PIL.Image.Image` input to its pixel values for a vision language model. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
.. _input_processing: | ||
|
||
Input Processing | ||
================ | ||
|
||
.. currentmodule:: vllm.inputs | ||
|
||
vLLM provides a mechanism for defining input processors for each model so that the inputs are processed | ||
in :class:`~vllm.LLMEngine` before they are passed to model executors. | ||
|
||
Currently, this mechanism is only utilized in **multi-modal models** for preprocessing multi-modal input | ||
data in addition to input prompt, but it can be extended to text-only language models when needed. | ||
|
||
Guides | ||
++++++ | ||
|
||
.. toctree:: | ||
:maxdepth: 1 | ||
|
||
input_processing_pipeline | ||
|
||
Module Contents | ||
+++++++++++++++ | ||
|
||
LLM Engine Inputs | ||
----------------- | ||
|
||
.. autoclass:: vllm.inputs.LLMInputs | ||
:members: | ||
:show-inheritance: | ||
|
||
Registry | ||
-------- | ||
|
||
.. autodata:: vllm.inputs.INPUT_REGISTRY | ||
|
||
.. automodule:: vllm.inputs.registry | ||
:members: | ||
:show-inheritance: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.