[KV Connector] Add scheduler context for lazy block access - #53067
Draft
ivanium wants to merge 1 commit into
Draft
[KV Connector] Add scheduler context for lazy block access#53067ivanium wants to merge 1 commit into
ivanium wants to merge 1 commit into
Conversation
Co-authored-by: OpenAI Codex <codex@openai.com> Signed-off-by: Yifan Qiao <yifanqiao@inferact.ai>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
KVConnectorSchedulerContextthat exposes the GPU block pool and temporary access to current request blocksMultiConnectorandSimpleCPUOffloadConnectorRequestTracker.allocated_block_idsand the old connector-levelbind_gpu_block_pool()APIPerformance
Connectors that do not use the context have no scheduler hot-path work; they receive one context object during initialization. Mooncake no longer snapshots or incrementally maintains request block IDs. It borrows scheduler-owned block lists only for emitted metadata jobs, serializes all KV groups, skips null blocks for pinning, and deduplicates blocks shared with partial-tail offloads.
Relationship to #51358
This is prerequisite groundwork for #51358. It separates the scheduler/connector ownership boundary and lazy Mooncake block access from the Mamba boundary-state expansion and worker batching in that PR.
Duplicate work
I searched open vLLM PRs for KV connector scheduler context and request-block borrowing work and found no PR implementing this interface or Mooncake migration.
Tests
/home/yifanqiao/vllm/.venv/bin/python -m pytest tests/v1/kv_connector/unit/test_mooncake_store_scheduler.py -q— 33 passedpre-commit run ruff-check --files <changed files>— passedpre-commit run mypy-3.12 --hook-stage manual --files <changed production files>— passedNo model evaluation is needed because this change does not affect model outputs or accuracy.
AI assistance
AI assistance was used for code exploration, implementation, test updates, and review. The human submitter reviewed the changes and is responsible for the final contribution.