Skip to content

[Usage]: Unreasonable value of token per image for multi-modal memory profiling #20123

Description

@marcmk6

Your current environment

Run the official demo script for using Qwen 2.5 VL 3B.
When specifying limit_mm_per_prompt={"image": 1}, I got

WARNING 06-26 07:12:07 [profiling.py:245] The sequence length used for profiling (max_num_batched_tokens / max_num_seqs = 5120) is too short to hold the multi-modal embeddings in the worst case (32768 tokens in total, out of which {'image': 16384, 'video': 16384} are reserved for multi-modal embeddings). This may cause certain multi-modal inputs to fail during inference, even when the input text is short. To avoid this, you should increase `max_model_len`, reduce `max_num_seqs`, and/or reduce `mm_counts`.

Where does this (approx.) 16384 tokens per image come from??
If I remember correctly, Qwen 2.5 VL uses 28*28 patch for an image token. 16384*28*28 is an image 3584*3584 image. This is an extremely unreasonbaly large size for VL LLM use cases.
This very large hard-coded value blocks me from using multiple images as it will cause OOM during memory profiling. But it's acutally ok during inference since I can resize my images.
How can I set it by myself?

How would you like to use vllm

either a way to completely disable memory profiling, or a way to sepcify a reasonable value of tokens per image

Before submitting a new issue...

  • Make sure you already searched for relevant issues, and asked the chatbot living at the bottom right corner of the documentation page, which can answer lots of frequently asked questions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    usageHow to use vllm

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions