[Bugfix] Fix O(n²) multimodal string prompt processing by mertunsall · Pull Request #29667 · vllm-project/vllm (original) (raw)
[](/apps/gemini-code-assist)
_apply_matches() had O(n²) complexity when processing multimodal prompts. When no match was found, the loop incremented start_idx but _find_matches() used prev_end_idx (unchanged), re-scanning the entire prompt each iteration.
Fix: Exit loop when no matches remain instead of incrementing uselessly.
Impact: InternVL 5k token prompt: 2.6s → <10ms for processing. Signed-off-by: mertunsall mertunsal1905@gmail.com
Signed-off-by: mertunsall mertunsal1905@gmail.com
Signed-off-by: mertunsall mertunsal1905@gmail.com
Signed-off-by: mertunsall mertunsal1905@gmail.com
Signed-off-by: mertunsall mertunsal1905@gmail.com
DarkLight1337 changed the title
[Bugfix] Fix O(n²) multimodal prompt processin [Bugfix] Fix O(n²) multimodal prompt processing
Signed-off-by: mertunsall mertunsal1905@gmail.com
Signed-off-by: mertunsall mertunsal1905@gmail.com
ONLY add when PR is ready to merge/full CI is needed
label
ywang96 changed the title
[Bugfix] Fix O(n²) multimodal prompt processing [Bugfix] Fix O(n²) multimodal string prompt processing
kitaekatt pushed a commit to kitaekatt/vllm that referenced this pull request
Signed-off-by: mertunsall mertunsal1905@gmail.com Co-authored-by: Roger Wang hey@rogerw.io
amd-hhashemi pushed a commit to amd-hhashemi/vllm that referenced this pull request
Signed-off-by: mertunsall mertunsal1905@gmail.com Co-authored-by: Roger Wang hey@rogerw.io Signed-off-by: Hashem Hashemi hashem.hashemi@amd.com
mystous pushed a commit to mystous/vllm_hybrid that referenced this pull request
Signed-off-by: mertunsall mertunsal1905@gmail.com Co-authored-by: Roger Wang hey@rogerw.io
my-other-github-account pushed a commit to my-other-github-account/vllm that referenced this pull request
Signed-off-by: mertunsall mertunsal1905@gmail.com Co-authored-by: Roger Wang hey@rogerw.io
my-other-github-account pushed a commit to my-other-github-account/vllm that referenced this pull request
Signed-off-by: mertunsall mertunsal1905@gmail.com Co-authored-by: Roger Wang hey@rogerw.io
0826joyce pushed a commit to 0826joyce/vllm-serving-optimization that referenced this pull request
Signed-off-by: mertunsall mertunsal1905@gmail.com Co-authored-by: Roger Wang hey@rogerw.io
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
[ Show hidden characters]({{ revealButtonHref }})