[BugFix] Fix MultiConnector test after HMA changes by njhill · Pull Request #19291 · vllm-project/vllm (original) (raw)
Hello @njhill, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!
Summary of Changes
Hello! Gemini or gemini-code-assist here, providing a summary of this pull request. This PR, authored by njhill, aims to fix a broken CI test (test_multi_connector.py) that resulted from recent changes in PR #17996, which introduced updates related to multi-connector functionality and Hierarchical Memory Allocation (HMA). The issue is tracked in #19281. The core problem seems to be a change in how KVCacheBlocks are structured or represented, particularly in a multi-connector context, which caused the existing test assertions and logging to fail.
Highlights
- Fixing CI Test: The primary goal of this PR is to resolve a failing CI test (
test_multi_connector.py) that was broken by previous multi-connector/HMA changes. - Adapting to KVCacheBlocks Structure Change: The changes adapt the code and tests to a likely change in the internal representation of
KVCacheBlocks, specifically how empty blocks are handled and how the structure is maintained across multiple connectors. - Adding
KVCacheBlocks.new_empty(): A new methodnew_empty()is added to theKVCacheBlocksclass to create an empty instance that preserves the structural dimensions (e.g., number of sub-lists for different layers or heads). - Updating MultiConnector Logic: The
MultiConnector'supdate_state_after_allocmethod is updated to use the newKVCacheBlocks.new_empty()method when passing empty block information to connectors that were not chosen for a specific request. - Updating Test Assertions: The unit test
test_multi_shared_storage_connector_consistencyis updated to match the new logging format forKVCacheBlocks, which now shows the lengths of the internal block lists (e.g.,num_blocks=[...]) instead of a single total length.
Changelog
- tests/v1/kv_connector/unit/test_multi_connector.py
- Modified a logging wrapper to print the lengths of the internal block lists within
KVCacheBlocks. - Updated assertions in
test_multi_shared_storage_connector_consistencyto expect the new list-based format fornum_blocksin logged events.
- Modified a logging wrapper to print the lengths of the internal block lists within
- vllm/distributed/kv_transfer/kv_connector/v1/multi_connector.py
- Changed the creation of empty
KVCacheBlocksinstances passed to non-chosen connectors fromKVCacheBlocks.create_empty()to using the newblocks.new_empty()method.
- Changed the creation of empty
- vllm/v1/core/kv_cache_manager.py
- Added a
new_empty()method to theKVCacheBlocksclass to create an empty instance while preserving the structure of the block lists. Using Gemini Code Assist
- Added a
The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.
Invoking Gemini
You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.
| Feature | Command | Description |
|---|---|---|
| Code Review | /gemini review | Performs a code review for the current pull request in its current state. |
| Pull Request Summary | /gemini summary | Provides a summary of the current pull request in its current state. |
| Comment | @gemini-code-assist | Responds in comments when explicitly tagged, both in issue comments and review comments. |
| Help | /gemini help | Displays a list of available commands. |
Customization
To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.
Limitations & Feedback
Gemini Code Assist is currently in preview and may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments to provide feedback.
You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.
- Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩