fix: correct TP zero-copy put semantics#1685
fix: correct TP zero-copy put semantics#1685zxpdemonio wants to merge 6 commits intokvcache-ai:mainfrom
Conversation
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request resolves a bug in the zero-copy Tensor Parallelism (TP) put APIs, Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request correctly updates the semantics for put_tensor_with_tp_from and batch_put_tensor_with_tp_from to handle full tensors instead of pre-split shards, which simplifies the client-side logic for zero-copy tensor parallelism puts. The changes are well-implemented, reusing the existing tensor splitting logic by decoding the tensor from the buffer first. The accompanying documentation and pybind11 wrapper updates are accurate.
The refactoring in test_tensor_api.py is a great improvement, introducing helper methods for buffer allocation and release, which makes the tests much cleaner and more robust.
I have one minor suggestion in store_py.cpp to improve consistency in how result vectors are initialized.
|
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
895ba34 to
487816b
Compare
487816b to
0d123cb
Compare
Ensure batch_put_tensor_with_tp_impl reports zero on fully successful shard writes so TP zero-copy Python tests don't fail with false INVALID_PARAMS results. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Keep the TP zero-copy benchmark focused on put-from semantics by removing an unsupported split_dim argument from batch_get_tensor_with_tp_into. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Fix full-tensor semantics for TP zero-copy put APIs and deduplicate the shared buffer helper logic used by the tensor API tests.
Description
Treat put_tensor_with_tp_from and batch_put_tensor_with_tp_from as
full-tensor zero-copy inputs, decode the serialized buffer, and reuse
the existing TP split/write path internally.
Update the API reference and tensor API tests to match the corrected
behavior.
Module
mooncake-transfer-engine)mooncake-store)mooncake-ep)mooncake-integration)mooncake-p2p-store)mooncake-wheel)mooncake-pg)mooncake-rl)Type of Change
How Has This Been Tested?
Checklist
./scripts/code_format.shbefore submitting.