-
Notifications
You must be signed in to change notification settings - Fork 2k
[None][doc] Facilitates the integration of the transfer agent #7867
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
[None][doc] Facilitates the integration of the transfer agent #7867
Conversation
📝 WalkthroughWalkthroughIntroduces a memory-transfer framework (descriptors, requests, status), extends BaseTransferAgent API (local agent/connection info, remote invalidation, remote descriptor checks, status-returning submits), and replaces getConnectionInfo/connectRemoteAgent with getLocalConnectionInfo/loadRemoteAgent across implementation, utilities, and tests. Updates logs and unit tests to the new API; functional flow otherwise unchanged. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor Test as Test/Client
participant R as RemoteAgent
participant L as LocalAgent
Test->>R: getLocalConnectionInfo()
R-->>Test: ConnectionInfoType
Test->>L: loadRemoteAgent(remoteName, ConnectionInfoType)
Note over L,R: Remote agent is registered/loaded using connection info
sequenceDiagram
autonumber
participant Client
participant L as LocalAgent
participant R as RemoteAgent
Client->>L: checkRemoteDescs(remoteName, MemoryDescs)
alt supported
L-->>Client: true
Client->>L: submitTransferRequests(TransferRequest)
L-->>Client: TransferStatus
par async transfer
L->>R: Transfer (READ/WRITE)
Note over L,R: Data movement per MemoryDesc regions
and wait/notify
Client->>L: TransferStatus.wait() / isCompleted()
L-->>Client: completion
L-->>Client: getNotifiedSyncMessages()
end
else not supported
L-->>Client: false
Note over Client: Abort or adjust descriptors
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Pre-merge checks and finishing touches❌ Failed checks (3 warnings)
✨ Finishing touches
🧪 Generate unit tests
Tip 👮 Agentic pre-merge checks are now available in preview!Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.
Please see the documentation for more information. Example: reviews:
pre_merge_checks:
custom_checks:
- name: "Undocumented Breaking Changes"
mode: "warning"
instructions: |
Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal).Please share your feedback with us on this Discord post. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
Actionable comments posted: 0
🧹 Nitpick comments (4)
cpp/tensorrt_llm/executor/cache_transmission/agent_utils/connection.cpp (1)
399-402: Consider adding descriptive comments for the API transition.While the changes from
connectRemoteAgenttoloadRemoteAgentare correct, the log message on line 400 still references the old method name in its text. Also, there's a validation check that seems sender-specific but lacks context about why senders shouldn't call this particular overload.else { - TLLM_CHECK_WITH_INFO(!isSender, "Sender shouldn't call loadRemoteAgent"); - TLLM_LOG_DEBUG(mpi::MpiComm::world().getRank(), "mAgentName: %s connect to %s with loadRemoteAgent", + TLLM_CHECK_WITH_INFO(!isSender, "Sender shouldn't call loadRemoteAgent without metadata"); + TLLM_LOG_DEBUG(mpi::MpiComm::world().getRank(), "mAgentName: %s loading remote agent %s", mAgentName.c_str(), remoteAgentName.c_str()); m_Agent->loadRemoteAgent(remoteAgentName, connectionInfo);cpp/include/tensorrt_llm/executor/transferAgent.h (3)
43-44: Add documentation for the MemoryDesc class.While the comment provides a brief description, comprehensive Doxygen documentation would help users understand the purpose and usage of each constructor and method.
-// `MemoryDesc` is used to describe a memory region, which can then be designated -// as the source or destination of read/write operations. +//! \brief Describes a memory region for transfer operations. +//! +//! MemoryDesc encapsulates the address, length, and device ID of a memory region +//! that can be used as source or destination in read/write operations. class MemoryDesc
216-217: Add documentation for the TransferOp enum.While the comment provides basic information, formal Doxygen documentation would improve API clarity.
-// `TransferOp` is an enumeration that represents the types of transfer operations. -// Currently, it supports two operations: `read` and `write`. +//! \brief Enumeration of supported transfer operations. +//! +//! Defines the direction of data transfer operations. enum class TransferOp : uint8_t { - kREAD, - kWRITE, + kREAD, //!< Read data from remote to local + kWRITE, //!< Write data from local to remote };
228-233: Fix parameter descriptions in TransferRequest constructor documentation.The documentation for the
opparameter incorrectly describes it as "Source data arrangement" instead of describing the transfer operation type.- /// @param op Source data arrangement. + /// @param op Transfer operation type (read or write).
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (5)
cpp/include/tensorrt_llm/executor/transferAgent.h(5 hunks)cpp/tensorrt_llm/executor/cache_transmission/agent_utils/connection.cpp(3 hunks)cpp/tensorrt_llm/executor/cache_transmission/nixl_utils/transferAgent.cpp(2 hunks)cpp/tensorrt_llm/executor/cache_transmission/nixl_utils/transferAgent.h(1 hunks)cpp/tests/unit_tests/executor/transferAgentTest.cpp(7 hunks)
🧰 Additional context used
📓 Path-based instructions (7)
**/*.{h,hpp,hh,hxx,cpp,cxx,cc,cu,cuh}
📄 CodeRabbit inference engine (CODING_GUIDELINES.md)
**/*.{h,hpp,hh,hxx,cpp,cxx,cc,cu,cuh}: Namespace closing braces must include a trailing comment with the namespace name (e.g., '} // namespace foo').
Prefer const or constexpr variables over #define for constants.
Declare variables that are not modified after initialization as const.
Avoid magic literals in code; except for 0, nullptr, true, false. Use named constants for comparisons and logic.
Use Allman brace style for formatting.
Place the semicolon of an empty for/while loop on a new line.
Bodies of switch/while/do-while/for must be compound statements (brace-delimited), and if/else must always be followed by brace-delimited statements.
Type names (e.g., classes) must be CamelCase starting with an uppercase letter (e.g., FooBar).
Local variables, methods, and namespaces use lowerCamelCase (e.g., localFooBar).
Non-magic-number global variables that are non-static and not in an anonymous namespace must be lowerCamelCase prefixed with 'g' (e.g., gDontUseGlobalFoos).
Non-magic-number globals that are static or in an anonymous namespace use lowerCamelCase prefixed with 's' (e.g., sMutableStaticGlobal).
Locally visible static variables use lowerCamelCase with 's' prefix (e.g., static std::once_flag sFlag).
Private/protected member variables use 'm' prefix with CamelCase (e.g., mNbFooValues). Public members may omit, but 'm' is encouraged for clarity.
Constants (enums, global constants, static constants, and function-scope magic/literal constants) use uppercase SNAKE_CASE with 'k' prefix (e.g., kDIGIT_NUM).
Function-scope constants that are not magic numbers or literals are named like non-constant variables (e.g., bool const pass = a && b).
If macros are necessary, name them in UPPER_SNAKE_CASE (e.g., FOO_VERSION) and prefer constants over #define.
Use LLVM clang-format; wrap lines at a maximum of 120 columns; use '// clang-format off/on' sparingly with justification.
Use smart pointers for heap allocations; prefer unique_ptr for sole ownership, shared_ptr for shared...
Files:
cpp/tensorrt_llm/executor/cache_transmission/nixl_utils/transferAgent.hcpp/tests/unit_tests/executor/transferAgentTest.cppcpp/tensorrt_llm/executor/cache_transmission/nixl_utils/transferAgent.cppcpp/tensorrt_llm/executor/cache_transmission/agent_utils/connection.cppcpp/include/tensorrt_llm/executor/transferAgent.h
**/*.{cpp,cxx,cc,cu,h,hpp,hh,hxx,cuh}
📄 CodeRabbit inference engine (CODING_GUIDELINES.md)
C++ filenames should be lowerCamelCase (first letter lowercase) and must be case-insensitive unique within a compilation target.
Files:
cpp/tensorrt_llm/executor/cache_transmission/nixl_utils/transferAgent.hcpp/tests/unit_tests/executor/transferAgentTest.cppcpp/tensorrt_llm/executor/cache_transmission/nixl_utils/transferAgent.cppcpp/tensorrt_llm/executor/cache_transmission/agent_utils/connection.cppcpp/include/tensorrt_llm/executor/transferAgent.h
**/*.{h,hpp,hh,hxx,cpp,cxx,cc,cu,cuh,py}
📄 CodeRabbit inference engine (CODING_GUIDELINES.md)
Use only spaces, no tabs; indent with 4 spaces.
Files:
cpp/tensorrt_llm/executor/cache_transmission/nixl_utils/transferAgent.hcpp/tests/unit_tests/executor/transferAgentTest.cppcpp/tensorrt_llm/executor/cache_transmission/nixl_utils/transferAgent.cppcpp/tensorrt_llm/executor/cache_transmission/agent_utils/connection.cppcpp/include/tensorrt_llm/executor/transferAgent.h
**/*.{h,hpp,hh,hxx}
📄 CodeRabbit inference engine (CODING_GUIDELINES.md)
Document new class interfaces and function prototypes with Doxygen; use //! for single-line and //!< for members.
Files:
cpp/tensorrt_llm/executor/cache_transmission/nixl_utils/transferAgent.hcpp/include/tensorrt_llm/executor/transferAgent.h
**/*.{h,hpp,hh,hxx,cpp,cxx,cc}
📄 CodeRabbit inference engine (CODING_GUIDELINES.md)
**/*.{h,hpp,hh,hxx,cpp,cxx,cc}: Prefer anonymous namespaces over 'static' for internal linkage of functions.
All templates (class/function/member/static) must be instantiated at least once; non-POD classes should have private data members.
Files:
cpp/tensorrt_llm/executor/cache_transmission/nixl_utils/transferAgent.hcpp/tests/unit_tests/executor/transferAgentTest.cppcpp/tensorrt_llm/executor/cache_transmission/nixl_utils/transferAgent.cppcpp/tensorrt_llm/executor/cache_transmission/agent_utils/connection.cppcpp/include/tensorrt_llm/executor/transferAgent.h
**/*.{h,hpp,hh,hxx,cuh}
📄 CodeRabbit inference engine (CODING_GUIDELINES.md)
Use include guards named 'TRTLLM_<FILE_NAME_IN_CAPS_WITH_UNDERSCORES>_H' (no leading or trailing underscore; directory names excluded).
Files:
cpp/tensorrt_llm/executor/cache_transmission/nixl_utils/transferAgent.hcpp/include/tensorrt_llm/executor/transferAgent.h
**/*.{cpp,cxx,cc,h,hpp,hh,hxx,cu,cuh,py}
📄 CodeRabbit inference engine (CODING_GUIDELINES.md)
Prepend the NVIDIA Apache-2.0 copyright header with current year to the top of all source files (e.g., .cpp, .h, .cu, .py).
Files:
cpp/tensorrt_llm/executor/cache_transmission/nixl_utils/transferAgent.hcpp/tests/unit_tests/executor/transferAgentTest.cppcpp/tensorrt_llm/executor/cache_transmission/nixl_utils/transferAgent.cppcpp/tensorrt_llm/executor/cache_transmission/agent_utils/connection.cppcpp/include/tensorrt_llm/executor/transferAgent.h
🧬 Code graph analysis (3)
cpp/tensorrt_llm/executor/cache_transmission/nixl_utils/transferAgent.h (1)
cpp/tensorrt_llm/executor/cache_transmission/nixl_utils/transferAgent.cpp (6)
getLocalConnectionInfo(472-475)getLocalConnectionInfo(472-472)loadRemoteAgent(384-392)loadRemoteAgent(384-384)loadRemoteAgent(477-511)loadRemoteAgent(477-477)
cpp/tensorrt_llm/executor/cache_transmission/nixl_utils/transferAgent.cpp (1)
cpp/tensorrt_llm/executor/cache_transmission/nixl_utils/transferAgent.h (1)
getLocalConnectionInfo(87-95)
cpp/include/tensorrt_llm/executor/transferAgent.h (1)
cpp/tensorrt_llm/executor/cache_transmission/nixl_utils/transferAgent.cpp (32)
registerMemory(366-375)registerMemory(366-366)registerMemory(553-560)registerMemory(553-553)deregisterMemory(377-382)deregisterMemory(377-377)deregisterMemory(562-569)deregisterMemory(562-562)loadRemoteAgent(384-392)loadRemoteAgent(384-384)loadRemoteAgent(477-511)loadRemoteAgent(477-477)invalidateRemoteAgent(402-405)invalidateRemoteAgent(402-402)getLocalAgentDesc(394-400)getLocalAgentDesc(394-394)getLocalConnectionInfo(472-475)getLocalConnectionInfo(472-472)nodiscard(198-209)nodiscard(211-214)nodiscard(216-224)nodiscard(226-234)nodiscard(236-244)nodiscard(246-254)nodiscard(256-264)nodiscard(326-329)nodiscard(407-440)nodiscard(461-470)submitTransferRequests(407-407)notifySyncMessage(442-459)notifySyncMessage(442-442)getNotifiedSyncMessages(461-461)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Pre-commit Check
🔇 Additional comments (11)
cpp/tensorrt_llm/executor/cache_transmission/agent_utils/connection.cpp (2)
147-147: LGTM! API migration properly implemented.The change from
getConnectionInfo()togetLocalConnectionInfo()aligns with the updated BaseTransferAgent interface.
212-212: LGTM! Local agent state initialization uses the new API.The AgentState correctly uses the new
getLocalConnectionInfo()method.cpp/include/tensorrt_llm/executor/transferAgent.h (1)
298-345: Well-structured API expansion with clear documentation.The new methods for the BaseTransferAgent interface are well-documented and follow a logical structure. The addition of
loadRemoteAgentoverloads,invalidateRemoteAgent,getLocalAgentDesc,getLocalConnectionInfo, andcheckRemoteDescsprovides a comprehensive interface for managing agent connections and transfers.cpp/tests/unit_tests/executor/transferAgentTest.cpp (4)
83-84: Test properly migrated to new API.The test correctly uses
getLocalConnectionInfo()andloadRemoteAgent()following the new API pattern.
204-205: Connect test properly demonstrates the new connection flow.The test appropriately uses the new API methods for establishing connections between agents.
216-216: Second agent connection also properly migrated.The nixlAgent2 connection correctly uses
loadRemoteAgent()with the connection info.
254-255: SyncMessage test thoroughly validates bidirectional communication.The test properly demonstrates both directions of agent communication using the new API methods.
Also applies to: 290-291
cpp/tensorrt_llm/executor/cache_transmission/nixl_utils/transferAgent.h (1)
87-89: Method signatures correctly updated to match base interface.The method declarations properly implement the renamed virtual methods from BaseTransferAgent.
cpp/tensorrt_llm/executor/cache_transmission/nixl_utils/transferAgent.cpp (3)
472-475: getLocalConnectionInfo implementation is correct.The method properly returns the stored address as the connection information.
477-511: loadRemoteAgent implementation properly handles connection setup.The implementation correctly:
- Parses the connection info into IP and port
- Updates log messages to reflect the new method name
- Maintains the retry logic for checking remote metadata
384-392: AgentDesc-based loadRemoteAgent correctly validates the remote agent name.Good practice to verify that the loaded remote agent name matches the expected name.
cee9d56 to
55df632
Compare
|
/bot run |
|
PR_Github #19467 [ run ] triggered by Bot |
|
PR_Github #19467 [ run ] completed with state |
7d93ddc to
cb71a66
Compare
|
/bot run |
|
PR_Github #20069 [ run ] triggered by Bot |
|
PR_Github #20069 [ run ] completed with state |
cb71a66 to
7b218d7
Compare
|
/bot run |
|
PR_Github #21519 [ run ] triggered by Bot |
|
/bot run |
7b218d7 to
44d3172
Compare
|
/bot run |
|
PR_Github #21531 [ run ] triggered by Bot |
|
PR_Github #21519 [ run ] completed with state |
|
PR_Github #21532 [ run ] triggered by Bot |
|
PR_Github #21531 [ run ] completed with state |
|
PR_Github #21532 [ run ] completed with state |
…#7867) Signed-off-by: Shixiaowei02 <39303645+Shixiaowei02@users.noreply.github.com>
…#7867) Signed-off-by: Shixiaowei02 <39303645+Shixiaowei02@users.noreply.github.com> Signed-off-by: yufeiwu-nv <230315618+yufeiwu-nv@users.noreply.github.com>
…#7867) Signed-off-by: Shixiaowei02 <39303645+Shixiaowei02@users.noreply.github.com>
…#7867) Signed-off-by: Shixiaowei02 <39303645+Shixiaowei02@users.noreply.github.com>
…#7867) Signed-off-by: Shixiaowei02 <39303645+Shixiaowei02@users.noreply.github.com>
…#7867) Signed-off-by: Shixiaowei02 <39303645+Shixiaowei02@users.noreply.github.com>
Summary by CodeRabbit
New Features
Refactor
Tests