Skip to content

Conversation

@liranschour
Copy link

@liranschour liranschour commented Apr 28, 2025

Add get_kv_cache_attn_layers() to ForwardContext to provide a more stable API.

Connector implementations should use this API to retrieve KV cache attention layers as follow:
attn_layers = forward_context.get_kv_cache_attn_layers()

@github-actions
Copy link

👋 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.

🚀

@liranschour liranschour changed the title Forward context does not offer a stable API ForwardContext does not offer a stable API Apr 28, 2025
Copy link
Member

@tlrmchlsmth tlrmchlsmth left a comment

Choose a reason for hiding this comment

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

Check out #17222, which similarly improves the interfaces to flash-attention and LMCache could use that interface instead of what it does here https://github.com/LMCache/LMCache/blob/048001e9df18e929f275a86d3bc1bae2c9fde189/lmcache/integration/vllm/vllm_v1_adapter.py#L344-L355

Comment on lines +48 to +49
def get_virtual_engine(self):
return self.virtual_engine
Copy link
Member

Choose a reason for hiding this comment

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

What is this for?

Copy link
Author

Choose a reason for hiding this comment

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

@tlrmchlsmth OK will use VllmConfig.get_layers_from_vllm_config() inside LMCache and close this PR.

@liranschour liranschour deleted the forward_context_stability branch April 28, 2025 18:16
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