-
Notifications
You must be signed in to change notification settings - Fork 437
[Transfer Engine]Coro rpc communicator #795
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
[Transfer Engine]Coro rpc communicator #795
Conversation
JasonZhang517
commented
Sep 1, 2025
- add a communicator including server and client pool
- add pybind interface of the communicator
- add test files
mooncake-integration/CMakeLists.txt
Outdated
| pybind11_add_module(engine ${SOURCES} ${CACHE_ALLOCATOR_SOURCES} | ||
| transfer_engine/transfer_engine_py.cpp | ||
| ../mooncake-transfer-engine/src/transport/coro_rpc_connector/cororpc_interface.cpp | ||
| ../mooncake-transfer-engine/src/transport/coro_rpc_connector/cororpc_communicator.cpp |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why need to add these files here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if we want to use coro_rpc_connector as a submodule of mooncake transfer engine, we have to compile it here
mooncake-transfer-engine/src/transport/coro_rpc_connector/cororpc_communicator.cpp
Outdated
Show resolved
Hide resolved
| return false; | ||
| } | ||
|
|
||
| int CoroRPCCommunicator::sendData(const std::string& target_address, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sendData should be a wrapper of sendDataAsync, dont rewrite same code twice
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use syncAwait(Lazy{}) as impl
mooncake-transfer-engine/src/transport/coro_rpc_connector/cororpc_communicator.cpp
Outdated
Show resolved
Hide resolved
mooncake-transfer-engine/src/transport/coro_rpc_connector/cororpc_communicator.cpp
Outdated
Show resolved
Hide resolved
mooncake-transfer-engine/src/transport/coro_rpc_connector/cororpc_communicator.cpp
Outdated
Show resolved
Hide resolved
mooncake-transfer-engine/src/transport/coro_rpc_connector/cororpc_communicator.cpp
Outdated
Show resolved
Hide resolved
mooncake-transfer-engine/src/transport/coro_rpc_connector/cororpc_interface.cpp
Outdated
Show resolved
Hide resolved
mooncake-transfer-engine/src/transport/coro_rpc_connector/cororpc_interface.cpp
Outdated
Show resolved
Hide resolved
mooncake-transfer-engine/src/transport/coro_rpc_connector/cororpc_interface.cpp
Outdated
Show resolved
Hide resolved
mooncake-transfer-engine/src/transport/coro_rpc_connector/cororpc_interface.cpp
Outdated
Show resolved
Hide resolved
mooncake-transfer-engine/src/transport/coro_rpc_connector/cororpc_interface.cpp
Outdated
Show resolved
Hide resolved
| auto future_ptr = std::make_shared<pybind11::object>(future_obj); | ||
| auto loop_ptr = std::make_shared<pybind11::object>(pybind11::reinterpret_borrow<pybind11::object>(loop)); | ||
|
|
||
| auto task_func = std::make_shared<std::function<void()>>( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
|
||
| auto task_func = std::make_shared<std::function<void()>>( | ||
| [communicator, target_addr, data_holder, future_ptr, loop_ptr]() { | ||
| int result = communicator->sendData(*target_addr, data_holder->data(), data_holder->size()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
co_await communicator->sendDataAsync
| return future_obj; | ||
| } | ||
|
|
||
| int CoroRPCInterface::sendTensor(const std::string& target_address, pybind11::handle tensor) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
according async_send_tensor
mooncake-transfer-engine/src/transport/coro_rpc_connector/cororpc_interface.cpp
Outdated
Show resolved
Hide resolved
| return future_obj; | ||
| } | ||
|
|
||
| void CoroRPCInterface::setDataReceiveCallback(pybind11::function callback) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use asyncio future
…ronous coroutine 3. change std::future to lazy return value
4162d03 to
8953508
Compare
mooncake-transfer-engine/include/transport/coro_rpc_connector/cororpc_communicator.h
Outdated
Show resolved
Hide resolved
mooncake-transfer-engine/include/transport/coro_rpc_connector/cororpc_interface.h
Show resolved
Hide resolved
mooncake-transfer-engine/include/transport/coro_rpc_connector/cororpc_interface.h
Outdated
Show resolved
Hide resolved
mooncake-transfer-engine/include/transport/coro_rpc_connector/cororpc_interface.h
Show resolved
Hide resolved
mooncake-transfer-engine/src/transport/coro_rpc_connector/cororpc_communicator.cpp
Show resolved
Hide resolved
mooncake-transfer-engine/src/transport/coro_rpc_connector/cororpc_interface.cpp
Show resolved
Hide resolved
mooncake-transfer-engine/src/transport/coro_rpc_connector/cororpc_interface.cpp
Outdated
Show resolved
Hide resolved
mooncake-transfer-engine/src/transport/coro_rpc_connector/cororpc_interface.cpp
Outdated
Show resolved
Hide resolved
mooncake-transfer-engine/src/transport/coro_rpc_connector/cororpc_interface.cpp
Show resolved
Hide resolved
mooncake-transfer-engine/src/transport/coro_rpc_connector/cororpc_interface.cpp
Outdated
Show resolved
Hide resolved
|
@JasonZhang517 Do you happen to have any updates for this PR? |
77b6863 to
abd15a1
Compare
.github/workflows/ci.yml
Outdated
| run: ${SCCACHE_PATH} --show-stats | ||
|
|
||
| - name: Install dependencies | ||
| shell: bash |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why move it here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds support for CoRo RPC communication to the Mooncake transfer engine, enabling bandwidth testing between client and server using the yalantinglibs coro_rpc framework. The implementation provides both synchronous and asynchronous APIs for data and tensor transfer with Python bindings.
Key changes:
- Added CoroRPCInterface and CoroRPCCommunicator classes for RPC communication
- Integrated pybind11 for Python bindings with improved CMake configuration
- Created a bandwidth test tool to measure communication performance
Reviewed Changes
Copilot reviewed 11 out of 12 changed files in this pull request and generated 17 comments.
Show a summary per file
| File | Description |
|---|---|
| mooncake-transfer-engine/tests/communicator_bandwidth_test.py | New bandwidth test script for measuring RPC communication throughput |
| mooncake-transfer-engine/src/transport/coro_rpc_connector/cororpc_interface.cpp | Core RPC interface implementation with data/tensor transfer methods |
| mooncake-transfer-engine/src/transport/coro_rpc_connector/cororpc_communicator.cpp | RPC communicator implementation handling client pools and server operations |
| mooncake-transfer-engine/src/transport/coro_rpc_connector/CMakeLists.txt | Build configuration for coro_rpc_connector module |
| mooncake-transfer-engine/src/transport/CMakeLists.txt | Updated to include coro_rpc_connector subdirectory |
| mooncake-transfer-engine/src/CMakeLists.txt | Added pybind11 configuration and Python dependencies |
| mooncake-transfer-engine/include/transport/coro_rpc_connector/cororpc_interface.h | Header defining CoroRPCInterface API |
| mooncake-transfer-engine/include/transport/coro_rpc_connector/cororpc_communicator.h | Header defining CoroRPCCommunicator API |
| mooncake-integration/transfer_engine/transfer_engine_py.cpp | Python bindings for CoroRPCInterface |
| mooncake-integration/CMakeLists.txt | Updated to link coro_rpc_connector |
| CMakeLists.txt | Enhanced pybind11 discovery logic |
| .gitignore | Whitespace fix |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
mooncake-transfer-engine/src/transport/coro_rpc_connector/cororpc_interface.cpp
Show resolved
Hide resolved
mooncake-transfer-engine/src/transport/coro_rpc_connector/cororpc_interface.cpp
Show resolved
Hide resolved
mooncake-transfer-engine/src/transport/coro_rpc_connector/cororpc_interface.cpp
Show resolved
Hide resolved
Co-authored-by: Copilot <[email protected]>
Format function call parameters to conform to .clang-format style.