Harden legacy UUID KV transfer leases and teardown - #723
Conversation
|
Thanks for your contribution, @wangyang59. To help us move forward, could you please address the following:
|
Add versioned batched renew/cancel support for the legacy JAX path, bound early-pull retries and producer retention, and make transport teardown cancellation-safe across queued, active, and delayed callbacks. Add hardware-free lifecycle, protocol, race, and descriptor-ownership regression coverage.
8138086 to
a8228ba
Compare
@juncgu-google thanks a lot for your review.
the values were carried in ControlRequestHeader::op, and their descriptions were added in the PR summary
added hardware-free lifecycle, protocol, race, deadline, cancellation, and descriptor-ownership coverage across kv_cache/, core/, transport/, and frameworks/jax/ |
Summary
kv_cache/,core/,transport/, andframeworks/jax/Control protocol operations
The numeric names are the values carried in
ControlRequestHeader::op:kOpAck): acknowledges that the consumer no longer needs the producer's legacy UUID registration, allowing producer-side state to be released. It remains accepted for wire compatibility.kOpPullStream): a receiver-initiated pull request.num_blocks > 0claims the UUID and starts the requested transfer;num_blocks == 0is the existing legacy ACK encoding and remains supported.kOpRenewLeases): renews a bounded batch of producer UUID leases while the consumer is still waiting to pull them, subject to the maximum retention deadline.kOpCancelLeases): cancels/releases a bounded batch of producer UUID registrations. Pre-registration cancellations are tombstoned so a racing late registration cannot resurrect the transfer.Ops 4/5 use protocol version 1 in
ep_idx, accept at most 4096 UUIDs per wire request, preserve input order in their responses, and return one status per UUID:1applied,0unknown,-1terminal,-2transferring, or-3maximum retention reached.Motivation
A decoder can wait long enough that its KV pull arrives after the producer UUID expires. The current controller lease API does not cover the legacy JAX UUID path, so that path needs explicit renew/cancel support and fail-fast lifecycle handling.
Compatibility
Test coverage
//tpu_sync/kv_cache:kv_cache_manager_lifecycle_test: verifies manager teardown waits for tracked callbacks//tpu_sync/core:kv_cache_manager_with_transfer_lifecycle_test: covers expiry/tombstones, early-unknown retry, transfer and shutdown draining, lease status ordering, cancel/pull races, protocol versioning/chunking, and absolute deadlines//tpu_sync/transport:block_transport_test: verifies cancellation rejects a new asynchronous push exactly once and drains cleanly//tpu_sync/transport/lib:raw_buffer_transport_test: verifies cancellation interrupts a blocked request and connection-pool shutdown does not steal a borrowed descriptor's ownership//tpu_sync/frameworks/jax:kv_cache_manager_wrapper_test: verifies ordered per-UUID status forwarding, exactly one control client, and empty-manager rejectionValidation
maingit diff --checkkv_cache,core,transport, and JAX wrapper targetsprotoc_minimal, exit 137); the raw-buffer target also encounters the repository's existing missing//third_party/xxhashpackage during local analysisRollout notes
Roll out producer and consumer images together, begin with shadow traffic disabled, and ramp gradually while monitoring lease renew status, retryable-unknown pulls, transfer failures, local-prefill fallback, and shutdown/drain errors.