Skip to content

Conversation

@DarkLight1337
Copy link
Member

@DarkLight1337 DarkLight1337 commented Aug 8, 2025

Essential Elements of an Effective PR Description Checklist

  • The purpose of the PR, such as "Fix some issue (link existing issues this PR will resolve)".
  • The test plan, such as providing test command.
  • The test results, such as pasting the results comparison before and after, or e2e results
  • (Optional) The necessary documentation update, such as updating supported_models.md and examples for a new model.

Purpose

Fix failing tests caused by #22441

The reason is that the tests use different model configs (some with cache size set to 0 and others with the normal cache size) which require different caches to be created for each setup.

Test Plan

Test Result

(Optional) Documentation Update

Signed-off-by: DarkLight1337 <tlleungac@connect.ust.hk>
@DarkLight1337 DarkLight1337 requested a review from Isotr0py August 8, 2025 04:06
@DarkLight1337 DarkLight1337 added the ready ONLY add when PR is ready to merge/full CI is needed label Aug 8, 2025
@DarkLight1337 DarkLight1337 requested a review from ywang96 as a code owner August 8, 2025 04:06
@mergify mergify bot added the multi-modality Related to multi-modality (#4194) label Aug 8, 2025
@DarkLight1337 DarkLight1337 changed the title [Bugfix] Fix multimodal tests [CI/Build] Fix multimodal tests Aug 8, 2025
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request aims to fix an issue in multimodal tests where different cache configurations were causing problems. The introduction of a globally cached _get_processor_cache function is a good approach. However, the implementation within MultiModalRegistry._get_processor_cache still incorrectly caches the processor cache at the instance level. This can lead to a stale cache being used when the model configuration changes. I've provided a critical comment with a suggested fix to ensure the correct cache is always retrieved.

Comment on lines 107 to 111
def _get_processor_cache(self, model_config: "ModelConfig"):
capacity_gb = model_config.mm_processor_cache_gb
if capacity_gb is None:
return None # Overrides `disable_cache` argument

if self._processor_cache is None:
self._processor_cache = ProcessingCache(capacity_gb)
model_id = model_config.model
capacity_gb = model_config.mm_processor_cache_gb
self._processor_cache = _get_processor_cache(model_id, capacity_gb)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

The current implementation of _get_processor_cache has a flaw. The check if self._processor_cache is None: causes the cache to be created only once and then reused for all subsequent calls, regardless of whether the model_config (and thus the required cache capacity) has changed. This can lead to using a cache with an incorrect size or using a cache when it should be disabled (e.g., when capacity_gb is 0), which can cause difficult-to-debug errors.

The new global _get_processor_cache function is correctly memoized with lru_cache, so it's safe and efficient to call it on every invocation of this method. This ensures the correct cache is used based on the current model_config.

Suggested change
def _get_processor_cache(self, model_config: "ModelConfig"):
capacity_gb = model_config.mm_processor_cache_gb
if capacity_gb is None:
return None # Overrides `disable_cache` argument
if self._processor_cache is None:
self._processor_cache = ProcessingCache(capacity_gb)
model_id = model_config.model
capacity_gb = model_config.mm_processor_cache_gb
self._processor_cache = _get_processor_cache(model_id, capacity_gb)
capacity_gb = model_config.mm_processor_cache_gb
self._processor_cache = _get_processor_cache(capacity_gb)
return self._processor_cache

Signed-off-by: DarkLight1337 <tlleungac@connect.ust.hk>
Signed-off-by: DarkLight1337 <tlleungac@connect.ust.hk>
Signed-off-by: DarkLight1337 <tlleungac@connect.ust.hk>
@github-actions
Copy link

github-actions bot commented Aug 8, 2025

👋 Hi! Thank you for contributing to the vLLM project.

💬 Join our developer Slack at https://slack.vllm.ai to discuss your PR in #pr-reviews, coordinate on features in #feat- channels, or join special interest groups in #sig- channels.

Just a reminder: PRs would not trigger full CI run by default. Instead, it would only run fastcheck CI which starts running only a small and essential subset of CI tests to quickly catch errors. You can run other CI tests on top of those by going to your fastcheck build on Buildkite UI (linked in the PR checks section) and unblock them. If you do not have permission to unblock, ping simon-mo or khluu to add you in our Buildkite org.

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 either: Add ready label to the PR or enable auto-merge.

🚀

@DarkLight1337 DarkLight1337 enabled auto-merge (squash) August 8, 2025 04:29
@vllm-bot vllm-bot merged commit 1712543 into vllm-project:main Aug 8, 2025
38 of 44 checks passed
@DarkLight1337 DarkLight1337 deleted the fix-mm-test branch August 8, 2025 07:31
ywang96 pushed a commit to ywang96/vllm that referenced this pull request Aug 8, 2025
Signed-off-by: DarkLight1337 <tlleungac@connect.ust.hk>
ywang96 pushed a commit to ywang96/vllm that referenced this pull request Aug 8, 2025
jinzhen-lin pushed a commit to jinzhen-lin/vllm that referenced this pull request Aug 9, 2025
Signed-off-by: DarkLight1337 <tlleungac@connect.ust.hk>
Signed-off-by: Jinzhen Lin <linjinzhen@hotmail.com>
noamgat pushed a commit to noamgat/vllm that referenced this pull request Aug 9, 2025
Signed-off-by: DarkLight1337 <tlleungac@connect.ust.hk>
Signed-off-by: Noam Gat <noamgat@gmail.com>
paulpak58 pushed a commit to paulpak58/vllm that referenced this pull request Aug 13, 2025
Signed-off-by: DarkLight1337 <tlleungac@connect.ust.hk>
Signed-off-by: Paul Pak <paulpak58@gmail.com>
diegocastanibm pushed a commit to diegocastanibm/vllm that referenced this pull request Aug 15, 2025
Signed-off-by: DarkLight1337 <tlleungac@connect.ust.hk>
Signed-off-by: Diego-Castan <diego.castan@ibm.com>
yiliu30 pushed a commit to yiliu30/vllm-fork that referenced this pull request Aug 19, 2025
Signed-off-by: DarkLight1337 <tlleungac@connect.ust.hk>
epwalsh pushed a commit to epwalsh/vllm that referenced this pull request Aug 28, 2025
Signed-off-by: DarkLight1337 <tlleungac@connect.ust.hk>
xiao-llm pushed a commit to xiao-llm/vllm that referenced this pull request Aug 28, 2025
Signed-off-by: DarkLight1337 <tlleungac@connect.ust.hk>
Signed-off-by: Xiao Yu <xiao.yu@amd.com>
zhewenl pushed a commit to zhewenl/vllm that referenced this pull request Aug 28, 2025
Signed-off-by: DarkLight1337 <tlleungac@connect.ust.hk>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

multi-modality Related to multi-modality (#4194) ready ONLY add when PR is ready to merge/full CI is needed v1

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants