Skip to content

refactor: Update BlockStored KVEvent#237

Merged
github-actions[bot] merged 5 commits into
llm-d:mainfrom
sagearc:update-blockstored-kvevent
Jan 3, 2026
Merged

refactor: Update BlockStored KVEvent#237
github-actions[bot] merged 5 commits into
llm-d:mainfrom
sagearc:update-blockstored-kvevent

Conversation

@sagearc
Copy link
Copy Markdown
Collaborator

@sagearc sagearc commented Dec 29, 2025

Context

Update BlockStored KVEvent to include the lora adapter name.
Blocked by: vllm-project/vllm#27577

Tests

Added tests for unmarshalling BlockStored KVEvent to ensure backward compatibility.

Signed-off-by: Sage Ahrac <sagiahrak@gmail.com>
Signed-off-by: Sage Ahrac <sagiahrak@gmail.com>
Signed-off-by: Sage Ahrac <sagiahrak@gmail.com>
Copilot AI review requested due to automatic review settings December 29, 2025 15:31
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR refactors the BlockStored KVEvent to include a new LoraName field and improves backward compatibility by extracting event unmarshalling logic into a dedicated function. The changes enable handling of events with varying field counts while maintaining compatibility with older event formats.

  • Added LoraName field to BlockStored struct
  • Extracted unmarshalling logic into unmarshalKVEvent function for better maintainability and testability
  • Added comprehensive backward compatibility tests

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 7 comments.

File Description
pkg/kvcache/kvevents/events.go Added LoraName field to BlockStored struct, created unmarshalKVEvent function with manual field mapping to support backward compatibility
pkg/kvcache/kvevents/pool.go Refactored processEvent to use the new unmarshalKVEvent function instead of inline unmarshalling logic
pkg/kvcache/kvevents/process_event_test.go Added tests for backward compatibility scenarios (missing Medium and LoraName, missing only LoraName, all fields present) and error cases
examples/helper/events.go Updated example to include Medium field when creating BlockStored events

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread pkg/kvcache/kvevents/events.go Outdated
Comment thread pkg/kvcache/kvevents/process_event_test.go Outdated
Comment thread pkg/kvcache/kvevents/process_event_test.go Outdated
Comment thread pkg/kvcache/kvevents/process_event_test.go
Comment thread pkg/kvcache/kvevents/process_event_test.go Outdated
Comment thread pkg/kvcache/kvevents/events.go Outdated
Comment thread pkg/kvcache/kvevents/events.go Outdated
Signed-off-by: Sage Ahrac <sagiahrak@gmail.com>
Signed-off-by: Sage Ahrac <sagiahrak@gmail.com>
@sagearc sagearc force-pushed the update-blockstored-kvevent branch from f0e3ab1 to ecd5d65 Compare December 29, 2025 17:16
@sagearc
Copy link
Copy Markdown
Collaborator Author

sagearc commented Dec 29, 2025

/hold

@github-actions github-actions Bot added the hold PRs that are blocked on design, other features, release cycle, etc. label Dec 29, 2025
@sagearc
Copy link
Copy Markdown
Collaborator Author

sagearc commented Dec 30, 2025

/hold cancel

@github-actions github-actions Bot removed the hold PRs that are blocked on design, other features, release cycle, etc. label Dec 30, 2025
@sagearc
Copy link
Copy Markdown
Collaborator Author

sagearc commented Dec 30, 2025

@vMaroon

@vMaroon
Copy link
Copy Markdown
Member

vMaroon commented Jan 3, 2026

Great work @sagearc. (cc @mayabar, though pls see #240)

/lgtm
/approve

@github-actions github-actions Bot added the lgtm Looks good to me, indicates that a PR is ready to be merged. label Jan 3, 2026
@github-actions github-actions Bot merged commit 8a45835 into llm-d:main Jan 3, 2026
3 checks passed
@sagearc sagearc deleted the update-blockstored-kvevent branch January 4, 2026 08:17
guygir pushed a commit to guygir/llm-d-kv-cache-manager that referenced this pull request Apr 20, 2026
…m-d#237)

Simplifies the configuration structure of the prefix-cache-scorer plugin by unifying all mode-specific parameters into a single configuration type. The prefix-cache-scorer now supports a mode option:
- When set to estimate (the default), it uses the GIE prefix cache scorer based on estimation from previous requests.
- When set to cache_tracking, it creates a prefix cache scorer based on KV-events from vLLM.

Signed-off-by: Kfir Toledo <kfir.toledo@ibm.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm Looks good to me, indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants