Skip to content

Conversation

@Bounty-hunter
Copy link
Collaborator

@Bounty-hunter Bounty-hunter commented Nov 10, 2025

Purpose

Test Plan

Test Result


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.
  • (Optional) Release notes update. If your change is user facing, please update the release notes draft in the Google Doc.

Copy link

@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 introduces changes to make the KV cache scheduling aware of multi-modal (mm) features by associating mm_hashes with KV cache blocks and request outputs. The changes are propagated through event definitions, block pool management, and the output processor. My review identified a critical bug in vllm/v1/core/block_pool.py related to an incorrect token index calculation, which could lead to incorrect behavior. I also found a minor issue with a missing type hint in vllm/v1/engine/output_processor.py that should be addressed for better code quality.

for _ in range(num_full_blocks -
num_cached_blocks)]
start_token_idx = num_cached_blocks * block_size
end_token_idx = num_full_blocks + block_size

Choose a reason for hiding this comment

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

critical

There appears to be a bug in the calculation of end_token_idx. It should be num_full_blocks * block_size to correctly represent the end token index of the full blocks. The current calculation num_full_blocks + block_size mixes block count with block size, which will lead to an incorrect token range and cause multi-modal features to be associated with the wrong blocks.

Suggested change
end_token_idx = num_full_blocks + block_size
end_token_idx = num_full_blocks * block_size

top_p: Optional[float] = None,
n: Optional[int] = None,
temperature: Optional[float] = None,
mm_hashes=None,

Choose a reason for hiding this comment

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

high

The type hint for the mm_hashes parameter is missing. For consistency with other parameters and to improve code clarity and maintainability, please add the appropriate type hint.

Suggested change
mm_hashes=None,
mm_hashes: Optional[list[str]] = None,

@hsliuustc0106
Copy link
Collaborator

do we have a related PR in llm-service repo for this scheduling

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants