fix: propagate TP KV mapping failures#373
Open
shipiyouniao wants to merge 3 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR addresses issue #372 by tightening TP IPC error propagation for KV tensor map/unmap operations and improving KV tensor creation diagnostics so the coordinator doesn’t lose the root-cause error behind a generic timeout.
Changes:
- Propagate worker-side
map_to_kv_tensors/unmap_from_kv_tensorsfailures through the IPC response instead of always returning success. - Ensure broadcast map callbacks use the
KVCacheManager’s recordedpp_rank/group_idcontext. - Augment KV tensor creation wait timeouts with the last observed exception to improve debuggability.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| kvcached/tp_ipc_util.py | Makes worker IPC replies reflect map/unmap failures so callers receive the real error. |
| kvcached/kv_cache_manager.py | Fixes callback context usage and improves timeout error reporting when waiting for KV tensors. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
80feabc to
ddba837
Compare
This was referenced Jul 1, 2026
ddba837 to
b6369c9
Compare
b6369c9 to
460b737
Compare
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
Fixes #372.
This PR tightens TP IPC error handling around KV tensor mapping:
map_to_kv_tensors/unmap_from_kv_tensorsfailures instead of replying successpp_rankandgroup_idfrom theKVCacheManagerwhen checking KV tensor creation and when invoking map/unmap callbacksWhy
Without this, the coordinator can lose the real map/unmap failure and later report only a generic KV tensor wait timeout. In TP/PP deployments the default callback context can also make the wait path observe the wrong group. The additional synchronization mirrors the allocator ordering used outside the TP IPC path.
Validation