-
-
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
[V1][VLM] Proper memory profiling for image language models #11210
Conversation
Signed-off-by: Roger Wang <[email protected]>
Signed-off-by: Roger Wang <[email protected]>
👋 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:
🚀 |
Signed-off-by: Roger Wang <[email protected]>
Signed-off-by: Roger Wang <[email protected]>
Signed-off-by: Roger Wang <[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.
LGTM now!
Signed-off-by: Roger Wang <[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 for the PR! Left some minor comments.
@WoosukKwon I've addressed your comments via 1720f68 - Let me know if there's any other concern! |
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 thanks!
…ject#11210) Signed-off-by: Roger Wang <[email protected]> Co-authored-by: ywang96 <[email protected]>
…ject#11210) Signed-off-by: Roger Wang <[email protected]> Co-authored-by: ywang96 <[email protected]>
…ject#11210) Signed-off-by: Roger Wang <[email protected]> Co-authored-by: ywang96 <[email protected]>
…ject#11210) Signed-off-by: Roger Wang <[email protected]> Co-authored-by: ywang96 <[email protected]> Signed-off-by: Bowen Wang <[email protected]>
…ject#11210) Signed-off-by: Roger Wang <[email protected]> Co-authored-by: ywang96 <[email protected]>
This PR adds memory profiling for image language models in V1 so that peak memory usage is correctly measured to avoid potential CUDA OOM.
A few things to note:
We still use the dummy
multi_modal_data
for memory profiling. This not only allows us to reuse the existing code, but is also developer-friendly since defining a dummy PIL image is much more intuitive than defining dummy pixel values. In order to do so,mm_input_mapper
is added to model runner only for profiling purpose.This current version only works for image (because of limitation on
mm_input_mapper
). The memory profiling section has supported profiling for other single non-text modality models, but may require some additional design to be extended to mixed non-text modality profiling.Encoder compute budget and cache size are added to scheduler config, but they remain hardcoded and should be optimized in a later PR.
Verified with
VLLM_USE_V1=1 VLLM_ENABLE_V1_MULTIPROCESSING=1 python3 mmmu_bench.py --model OpenGVLab/InternVL2_5-8B --trust-remote-code --gpu-memory-utilization 0.99
from #11196Main branch:
This PR: