Repository navigation
Conversation
Keep kv.fetch as source advice for later framework fetch/deliver calls. Remove obsolete payload handling and clarify that hint hashes differ from full BlockKey inventory and transfer identities. Validation: hint parser/fetch suites, Ruff, and whitespace checks. Signed-off-by: Weiyang Wang <wafrank@nvidia.com>
Add metadata-only peer resolution through the adapter's reverse lookup, with complete keys, layouts, and per-hash failures. Reject self-addressed resolution by process incarnation. The integration owns the reverse index and ambiguity policy; lookup acquires no source-memory claims. Include the full client lifecycle: validate peer, hash set, reply rows, and deadline, then deliver completion on the owner thread through a callback. Neither endpoint depends on hint execution or move state. Extend the existing remote-source/target suites for lookup failures, owner-independent replies, malformed/late responses, and exactly-once completion. Validation: full unit suite, Ruff, and whitespace checks. Assisted-by: OpenAI Codex Assisted-by: Anthropic Claude Signed-off-by: Weiyang Wang <wafrank@nvidia.com>
Flasew
force-pushed
the
independent-hint
branch
from
November 6, 2026 04:14
1cd447f to
ca89731
Compare
Flasew
marked this pull request as ready for review
November 6, 2026 04:58
Add internal full-key fetches from a named peer, with optional source removal. Keep the source through deferred admission and require managed source G2, without acquiring or borrowing framework pins. The public framework API and ordinary copying remain unchanged. Withdraw eligible source copies before transfer; successful writes leave removal pending until readers drain, while failure reopens admission. Honor no_evict, invalidate cached destination hits, and publish actual residency changes. Hash lookup excludes keys pending removal. Extend existing remote tests for exact bytes, cache hits, protection, partial failure, source validation, busy producers, readers, and pin exclusion. Validation: full unit suite, Ruff, and whitespace checks. Signed-off-by: Weiyang Wang <wafrank@nvidia.com>
Connect kv.prefetch and kv.move to hash resolution and named-source transfers. Actions outlive their carrier request, preserve request advice, validate local identity/layout compatibility, and aggregate per-hash results across layouts. Consume internal completions and release temporary destination claims. Extend the existing hint suite for carrier independence, copied bytes, cached moves, source disappearance, capacity waits, overlapping actions, layout groups, timeouts, and cleanup. Document the hint flow and source removal ordering, including the planned request-scoped kv.migrate hint for cold starts. Validation: full unit suite, native two-peer NIXL/UCX scenarios, Ruff, and whitespace checks. Assisted-by: OpenAI Codex Assisted-by: Anthropic Claude Signed-off-by: Weiyang Wang <wafrank@nvidia.com>
Flasew
force-pushed
the
independent-hint
branch
from
November 6, 2026 05:25
ca89731 to
c7f1f0e
Compare
This branch has not been deployed
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.
Add hash resolution and independent KV prefetch/move
This PR adds
kv.prefetchandkv.moverequest-independent hints, so a router can ask KVCR to copy or move cached blocks using a source endpoint and block hashes. KVCR uses framework's KeyAdaptor to resolve those hashes to full KVCRBlockKeys, and starts the transfer independently of the request carrying the hint.kv.fetchremains request-scoped advice: the framework supplies full keys and starts copying throughfetch()ordeliver().Supersedes #154. The move and invalidation mechanism is included here.
Commits
e6df929— request advicekv.fetchadvice always mean copy. Suppliedmodefields are ignored, andsubmit_hint()still starts no transfer.76fb194— hash resolutionKeyAdapter.decode_from_router. Validate replies and handle lookup failures and timeouts.93785b2— move and invalidation internal mechanismmove()API.ca89731— independent hintskv.prefetchandkv.moveto lookup and transfer, check destination compatibility, and collect results without depending on an inference request.Behavior
Independent hints.
kv.prefetchcopies blocks into KVCR-managed DRAM (G2);kv.movealso requests removal of the source copies. Both carrysource_control_endpointandblock_hashes. They can target blocks unrelated to the request carrying them, run without a request ID, and share an envelope with request advice. Discarding the carrier request does not cancel them.Their source transfers read only complete G2 copies. If those copies disappear, the transfers fail instead of using framework memory. Ordinary request-scoped copying can still use framework memory.
Hash resolution. The destination first asks the source for full
BlockKeyvalues and layout/size information, adding one metadata round trip before transfer. This lookup does not reserve memory; the transfer checks availability again. The framework integration owns the hash-to-key map and decides how to handle collisions. Missing or ambiguous hashes and adapter failures are reported per hash, allowing the other hashes to proceed. KVCR adds no second index and does not reject inventory updates on collision. A worker cannot resolve against itself.Move semantics. The destination includes move intent in the transfer request, and the source owns invalidation. Before transferring blocks eligible for removal, the source marks them for removal and stops accepting new reads and deposits. After a successful native transfer, it removes their G2 copies once existing readers and claims are released. This is eager removal: KVCR frees the source cache memory as soon as it is safe, rather than merely making the blocks evictable. A failed transfer cancels that move's pending removal and restores access after cleanup. If the destination already has complete copies, it sends an
invalidatemessage and the source performs the same removal without another transfer.G2 removal respects
no_evictand does not touch framework-owned memory. Removing G3 copies as part of a move is not implemented. Inventory events reflect actual additions and removals. Destination completion means its data is ready; source cleanup may finish later.For moves, the destination extends the completion allowance for the full-key fetch from
operation_timeout_mstoabandon_timeout_ms, starting after hash resolution. The source still caps the transfer at its normaloperation_timeout_ms. This gives the destination extra time to process completion after the source finishes. Source removal does not wait for a destination acknowledgement, so a destination that exceeds this longer deadline can still report a timeout after the source has removed its copy.Independent hints use the existing
KVCR.poll_completed()loop on both workers. Integrations must keep servicing that loop even when no inference request is active. At the source, polling admits moves and processes invalidation and cleanup. At the destination, it starts transfers after resolution, processes transfer completions, and releases temporary claims. Independent hint results are handled internally and do not appear in the returned framework completion list. See hash-addressed operations for detailed contracts.Validation
no_evict, failures, and inventory updates.