Skip to content

[Refactor][KVConnector]: Move KV Cache Events into KVConnectorWorkerMetadata#34522

Open
hickeyma wants to merge 2 commits intovllm-project:mainfrom
hickeyma:refactor-kvconnectorkvevents
Open

[Refactor][KVConnector]: Move KV Cache Events into KVConnectorWorkerMetadata#34522
hickeyma wants to merge 2 commits intovllm-project:mainfrom
hickeyma:refactor-kvconnectorkvevents

Conversation

@hickeyma
Copy link
Contributor

@hickeyma hickeyma commented Feb 13, 2026

Purpose

This change removes kv_cache_events as a top-level field on KVConnectorOutput and instead carries KV cache events inside a connector-specific KVConnectorWorkerMetadata subclass (LMCacheWorkerMetadata). This aligns KV event transport with the generic worker-to-scheduler metadata mechanism introduced in PR #31964, eliminating redundant aggregation code paths.

This also resolves #28309 (review) to request support for KV events for multiple connectors.

Note: Do NOT merge until #31964 merges. Merged, good to go.

Test Plan

pytest -s -v tests/v1/kv_connector/unit/test_lmcache_connector.py

Test Result

Unit tests pass


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
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 is a well-executed refactoring that moves KV cache event transport to a generic worker-to-scheduler metadata mechanism using KVConnectorWorkerMetadata. This change improves modularity and aligns the KV event transport with a more general pattern, which is a solid architectural improvement. The changes are consistently applied across the codebase, including base classes, LMCacheConnectorV1, MultiConnector, and the corresponding tests have been updated thoroughly. I have one suggestion to improve code clarity in MultiConnector.

@hickeyma
Copy link
Contributor Author

hickeyma commented Feb 13, 2026

Convert to draft for now as need to do more testing on it.

Ready for review.

@hickeyma hickeyma marked this pull request as ready for review February 16, 2026 12:38
@mergify
Copy link

mergify bot commented Feb 22, 2026

This pull request has merge conflicts that must be resolved before it can be
merged. Please rebase the PR, @hickeyma.

https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork

@mergify mergify bot added the needs-rebase label Feb 22, 2026
This change removes kv_cache_events as a top-level field on KVConnectorOutput
and instead carries KV cache events inside a connector-specific
KVConnectorWorkerMetadata subclass (LMCacheWorkerMetadata).
This aligns KV event transport with the generic worker-to-scheduler
metadata mechanism introduced in PR vllm-project#31964, eliminating redundant aggregation code paths.

Signed-off-by: Martin Hickey <martin.hickey@ie.ibm.com>
@hickeyma hickeyma force-pushed the refactor-kvconnectorkvevents branch from 095655f to 50bb980 Compare March 12, 2026 15:41
@mergify mergify bot removed the needs-rebase label Mar 12, 2026
@mergify
Copy link

mergify bot commented Mar 12, 2026

Hi @hickeyma, the pre-commit checks have failed. Please run:

uv pip install pre-commit
pre-commit install
pre-commit run --all-files

Then, commit the changes and push to your branch.

For future commits, pre-commit will run automatically on changed files before each commit.

Tip

Is mypy failing?
mypy is run differently in CI. If the failure is related to this check, please use the following command to run it locally:
# For mypy (substitute "3.10" with the failing version if needed)
pre-commit run --hook-stage manual mypy-3.10

@mergify
Copy link

mergify bot commented Mar 13, 2026

Hi @hickeyma, the pre-commit checks have failed. Please run:

uv pip install pre-commit
pre-commit install
pre-commit run --all-files

Then, commit the changes and push to your branch.

For future commits, pre-commit will run automatically on changed files before each commit.

Tip

Is mypy failing?
mypy is run differently in CI. If the failure is related to this check, please use the following command to run it locally:
# For mypy (substitute "3.10" with the failing version if needed)
pre-commit run --hook-stage manual mypy-3.10

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant