[TE] Support TCP fallback in EFA build and improve EFA documentation#1523
[TE] Support TCP fallback in EFA build and improve EFA documentation#1523stmatengss merged 2 commits intokvcache-ai:mainfrom
Conversation
When building with USE_EFA=ON, auto_discover is disabled to prevent RDMA transport installation (QP creation fails on EFA devices). This means TCP transport is also not installed automatically. Add explicit TCP transport installation for non-EFA protocols in the EFA build path. Documentation changes: - build.md: Add USE_EFA option and clarify USE_CUDA default/purpose - supported-protocols.md: Add EFA as a supported protocol - efa_transport.md: Add USE_CUDA=ON to build command, document GPU memory requirement Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Summary of ChangesHello @whn09, 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 significantly improves the robustness and clarity of Mooncake's networking capabilities, particularly in AWS EFA environments. It fixes a critical bug preventing TCP fallback when EFA is enabled, ensuring that users can reliably switch between EFA and TCP protocols. Concurrently, it enhances the documentation to provide comprehensive instructions and explanations for building with EFA and managing GPU memory transfers with CUDA, thereby streamlining the user experience and preventing common configuration pitfalls. 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 effectively addresses the issue of TCP fallback in EFA-enabled builds by explicitly installing the TCP transport when auto_discover is disabled. The accompanying documentation updates are excellent, providing clear instructions and necessary context for building with EFA and CUDA support. I have one suggestion in transfer_engine_py.cpp to make the fallback logic more generic, which would improve the code's flexibility for handling other non-EFA protocols in the future.
| } else { | ||
| // For non-EFA protocols (e.g. TCP), manually install TCP transport | ||
| // since auto_discover is disabled to prevent RDMA installation | ||
| // (RDMA QP creation fails on EFA devices). | ||
| LOG(INFO) | ||
| << "Installing TCP transport (auto_discover disabled in EFA build)"; | ||
| auto transport = engine_->installTransport("tcp", nullptr); | ||
| if (!transport) { | ||
| LOG(ERROR) << "Failed to install TCP transport"; | ||
| return -1; | ||
| } | ||
| LOG(INFO) << "TCP transport installed successfully"; | ||
| } |
There was a problem hiding this comment.
The else block is intended for non-EFA protocols when building with USE_EFA=ON. However, it currently hardcodes the installation of the "tcp" transport, regardless of the protocol parameter passed to the function. This limits the flexibility of using other transports (besides "efa" and "tcp") in an EFA-enabled build.
To make this more generic and align with the function's parameters, you should use the proto variable to install the requested transport.
} else {
// For non-EFA protocols, manually install the requested transport
// since auto_discover is disabled to prevent RDMA installation
// (RDMA QP creation fails on EFA devices).
LOG(INFO)
<< "Installing " << proto << " transport (auto_discover disabled in EFA build)";
auto transport = engine_->installTransport(proto, nullptr);
if (!transport) {
LOG(ERROR) << "Failed to install " << proto << " transport";
return -1;
}
LOG(INFO) << proto << " transport installed successfully";
}|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
…vcache-ai#1523) When building with USE_EFA=ON, auto_discover is disabled to prevent RDMA transport installation (QP creation fails on EFA devices). This means TCP transport is also not installed automatically. Add explicit TCP transport installation for non-EFA protocols in the EFA build path. Documentation changes: - build.md: Add USE_EFA option and clarify USE_CUDA default/purpose - supported-protocols.md: Add EFA as a supported protocol - efa_transport.md: Add USE_CUDA=ON to build command, document GPU memory requirement Co-authored-by: whn09 <whn09@users.noreply.github.com> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> Co-authored-by: Teng Ma <teng-ma@linux.alibaba.com>
* [Store] feat: CXL storage full features. * fix(ci): resolve cxl test failure and code format * fix(ci): add CXL protocol support and fix code format issues * [Store] feat: CXL storage full features, reset and rm extern/pybind * [TE] Support TCP fallback in EFA build and improve EFA documentation (#1523) When building with USE_EFA=ON, auto_discover is disabled to prevent RDMA transport installation (QP creation fails on EFA devices). This means TCP transport is also not installed automatically. Add explicit TCP transport installation for non-EFA protocols in the EFA build path. Documentation changes: - build.md: Add USE_EFA option and clarify USE_CUDA default/purpose - supported-protocols.md: Add EFA as a supported protocol - efa_transport.md: Add USE_CUDA=ON to build command, document GPU memory requirement Co-authored-by: whn09 <whn09@users.noreply.github.com> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> Co-authored-by: Teng Ma <teng-ma@linux.alibaba.com> * [Store] Optimize BucketStorageBackend for reduced lock contention and add delete safety (#1456) * fix(ci): resolve cxl test failure and code format * [Store] Add Local Cache Mechanism for Mooncake Store Client (#1226) * feat(Store): add local hot cache for client * feat(Store): add client local hot cache log to show performance * fix: local hot cache initialize bug * fix(Store): Mooncake put slice is max 16MB, so make local hot cache block 16MB * feat(Store): move local hot cache initialization to Client::Create * feat(Store): local hot cache remove unused small block implementation * feat(Store): add client local hot cache unit test * fix(Store): modify client local hot cache suit with v0.3.7 * feat(Store): change local hot cache unit tes * fix: initialize local hot cache with negative value * feat: use in process master and metadata fro local hot cache unit test. * feat: update local hot cache to one replica one slice version * fix: local hot cache unit test use in process master service * fix: code style fix * fix: fix dirty read when client wants to read a previously hitted hot block but the hot block is modified by incoming put actions * fix: local hot cache unit test use in process master service * fix: code format fix * fix: fix comment problems for * feat: add local hot asynchronous queue size limit * fix: local hot cache task involves the block so that there is no memcpy operation when inserting local hot cache * fix: code check fix * fix: update block in_use prop to reference count --------- Co-authored-by: shichangzhang064 <zhangshichang@h-partners.com> * fix(ci): add CXL protocol support and fix code format issues * fix: address comments from code review * fix(ci): resolve cxl test failure * fix(ci): resolve ci error --------- Co-authored-by: 王鹤男 <wanghenan09@gmail.com> Co-authored-by: whn09 <whn09@users.noreply.github.com> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> Co-authored-by: Teng Ma <teng-ma@linux.alibaba.com> Co-authored-by: Mahesh Bapatu <153306023+maheshrbapatu@users.noreply.github.com> Co-authored-by: Shichang Zhang <77728761+Shichang-Zhang@users.noreply.github.com> Co-authored-by: shichangzhang064 <zhangshichang@h-partners.com>
Description
When building Mooncake with
USE_EFA=ON, theTransferEngineis created withauto_discover=falseto prevent automatic RDMA transport installation (since ibverbs QP creation fails on EFA devices with error 95EOPNOTSUPP). However, this also prevents TCP transport from being installed whenmooncake_protocolis set to"tcp", causing "Local segment descriptor not found" errors.This PR adds an
elsebranch in the#ifdef USE_EFAblock oftransfer_engine_py.cppto explicitly install TCP transport when the requested protocol is not"efa".Additionally, the documentation is updated to:
-DUSE_EFAto the Advanced Compile Options inbuild.mdand clarify thatUSE_CUDAdefaults toOFFand is required for GPU memory transfers (including over TCP)supported-protocols.md-DUSE_CUDA=ONto the EFA build command inefa_transport.mdand document that it is required for GPU memory (e.g., KV cache in vLLM)Type of Change
How Has This Been Tested?
Tested on two AWS p5en.48xlarge instances (8× H200 GPUs each) running vLLM disaggregated prefill-decode serving with Kimi-K2.5 model:
mooncake_protocol: "efa"): 128 requests, 0 failures.mooncake_protocol: "tcp") withUSE_CUDA=ONandUSE_EFA=ON: 128 requests, 0 failures.Without this fix, TCP fallback fails with "Local segment descriptor not found" (no transport installed) or "Bad address" EFAULT (if
USE_CUDA=OFF, GPU memory not handled).Checklist
./scripts/code_format.shbefore submitting.