[None][fix] Add bounded timeout to gen-side KV transfer in C++ CacheTransceiver#12820
Draft
yifjiang wants to merge 2 commits intoNVIDIA:mainfrom
Draft
[None][fix] Add bounded timeout to gen-side KV transfer in C++ CacheTransceiver#12820yifjiang wants to merge 2 commits intoNVIDIA:mainfrom
yifjiang wants to merge 2 commits intoNVIDIA:mainfrom
Conversation
…ransceiver Replace the unbounded future.get() in checkGenTransferStatus with future.wait_for() that branches on ready/timeout/error status. Key improvements over the initial approach: - Use `blockAll` flag (not `!receiverFutureTimeoutMs.has_value()`) to decide whether to block, preventing indefinite hangs when the timeout config is unset (std::nullopt). - Guard the updateKVCacheTransferBW timing collective so it only runs when either all ranks block together (blockAll) or the request was confirmed ready on every rank in the initial poll, avoiding allgather hangs when a peer timed out and skipped the request. - Erase completed/errored futures inside each branch to avoid dangling iterator access after exceptions. Signed-off-by: Yifan Jiang <yifanj@nvidia.com> Signed-off-by: yifjiang <19356972+yifjiang@users.noreply.github.com>
Signed-off-by: Yifan Jiang <19356972+yifjiang@users.noreply.github.com>
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
future.get()incheckGenTransferStatuswithfuture.wait_for()that branches on ready/timeout/error statuskv_transfer_sender_future_timeout_msis unset (std::nullopt) — usesblockAllflag instead of!receiverFutureTimeoutMs.has_value()to decide blocking behaviorupdateKVCacheTransferBWtiming collective so it only runs when all ranks block together (blockAll) or the request was confirmed ready on every rank in the initial poll, preventingallgatherhangs when a peer timed out and skipped the requestSupersedes #12476 — addresses CodeRabbit review feedback from that PR.
Test plan
kv_transfer_sender_future_timeout_msset and unsetTRTLLM_KVCACHE_TIME_OUTPUT_PATHenabled to verify no allgather hang on timeout