Skip to content

Comments

[https://nvbugs/5782112][fix] Cherry-pick #10633: Fix hanging issue for MNNVL Allreduce under PP#10750

Merged
hyukn merged 2 commits intoNVIDIA:release/1.2from
hyukn:fix/5782112_1.2
Jan 19, 2026
Merged

[https://nvbugs/5782112][fix] Cherry-pick #10633: Fix hanging issue for MNNVL Allreduce under PP#10750
hyukn merged 2 commits intoNVIDIA:release/1.2from
hyukn:fix/5782112_1.2

Conversation

@hyukn
Copy link
Collaborator

@hyukn hyukn commented Jan 16, 2026

Summary by CodeRabbit

  • Refactoring
    • Updated distributed buffer initialization API signatures to use MPI Fortran communicator handles instead of split color parameters, affecting buffer creation calls in distributed setups.
    • Refactored workspace caching mechanism in multi-node all-reduce operations from isolated per-thread storage to shared cross-thread caching.
    • Updated Python bindings to reflect new constructor parameter ordering and MPI communicator handling.

✏️ Tip: You can customize this high-level summary in your review settings.

Description

Test Coverage

PR Checklist

Please review the following before submitting your PR:

  • PR description clearly explains what and why. If using CodeRabbit's summary, please make sure it makes sense.

  • PR Follows TRT-LLM CODING GUIDELINES to the best of your knowledge.

  • Test cases are provided for new code paths (see test instructions)

  • Any new dependencies have been scanned for license and vulnerabilities

  • CODEOWNERS updated if ownership changes

  • Documentation updated as needed

  • Update tava architecture diagram if there is a significant design change in PR.

  • The reviewers assigned automatically/manually are appropriate for the PR.

  • Please check this after reviewing the above items as appropriate for this PR.

GitHub Bot Help

/bot [-h] ['run', 'kill', 'skip', 'reuse-pipeline'] ...

Provide a user friendly way for developers to interact with a Jenkins server.

Run /bot [-h|--help] to print this help message.

See details below for each supported subcommand.

Details

run [--reuse-test (optional)pipeline-id --disable-fail-fast --skip-test --stage-list "A10-PyTorch-1, xxx" --gpu-type "A30, H100_PCIe" --test-backend "pytorch, cpp" --add-multi-gpu-test --only-multi-gpu-test --disable-multi-gpu-test --post-merge --extra-stage "H100_PCIe-TensorRT-Post-Merge-1, xxx" --detailed-log --debug(experimental)]

Launch build/test pipelines. All previously running jobs will be killed.

--reuse-test (optional)pipeline-id (OPTIONAL) : Allow the new pipeline to reuse build artifacts and skip successful test stages from a specified pipeline or the last pipeline if no pipeline-id is indicated. If the Git commit ID has changed, this option will be always ignored. The DEFAULT behavior of the bot is to reuse build artifacts and successful test results from the last pipeline.

--disable-reuse-test (OPTIONAL) : Explicitly prevent the pipeline from reusing build artifacts and skipping successful test stages from a previous pipeline. Ensure that all builds and tests are run regardless of previous successes.

--disable-fail-fast (OPTIONAL) : Disable fail fast on build/tests/infra failures.

--skip-test (OPTIONAL) : Skip all test stages, but still run build stages, package stages and sanity check stages. Note: Does NOT update GitHub check status.

--stage-list "A10-PyTorch-1, xxx" (OPTIONAL) : Only run the specified test stages. Examples: "A10-PyTorch-1, xxx". Note: Does NOT update GitHub check status.

--gpu-type "A30, H100_PCIe" (OPTIONAL) : Only run the test stages on the specified GPU types. Examples: "A30, H100_PCIe". Note: Does NOT update GitHub check status.

--test-backend "pytorch, cpp" (OPTIONAL) : Skip test stages which don't match the specified backends. Only support [pytorch, cpp, tensorrt, triton]. Examples: "pytorch, cpp" (does not run test stages with tensorrt or triton backend). Note: Does NOT update GitHub pipeline status.

--only-multi-gpu-test (OPTIONAL) : Only run the multi-GPU tests. Note: Does NOT update GitHub check status.

--disable-multi-gpu-test (OPTIONAL) : Disable the multi-GPU tests. Note: Does NOT update GitHub check status.

--add-multi-gpu-test (OPTIONAL) : Force run the multi-GPU tests in addition to running L0 pre-merge pipeline.

--post-merge (OPTIONAL) : Run the L0 post-merge pipeline instead of the ordinary L0 pre-merge pipeline.

--extra-stage "H100_PCIe-TensorRT-Post-Merge-1, xxx" (OPTIONAL) : Run the ordinary L0 pre-merge pipeline and specified test stages. Examples: --extra-stage "H100_PCIe-TensorRT-Post-Merge-1, xxx".

--detailed-log (OPTIONAL) : Enable flushing out all logs to the Jenkins console. This will significantly increase the log volume and may slow down the job.

--debug (OPTIONAL) : Experimental feature. Enable access to the CI container for debugging purpose. Note: Specify exactly one stage in the stage-list parameter to access the appropriate container environment. Note: Does NOT update GitHub check status.

For guidance on mapping tests to stage names, see docs/source/reference/ci-overview.md
and the scripts/test_to_stage_mapping.py helper.

kill

kill

Kill all running builds associated with pull request.

skip

skip --comment COMMENT

Skip testing for latest commit on pull request. --comment "Reason for skipping build/test" is required. IMPORTANT NOTE: This is dangerous since lack of user care and validation can cause top of tree to break.

reuse-pipeline

reuse-pipeline

Reuse a previous pipeline to validate current commit. This action will also kill all currently running builds associated with the pull request. IMPORTANT NOTE: This is dangerous since lack of user care and validation can cause top of tree to break.

hyukn added 2 commits January 16, 2026 06:33
…nder PP (NVIDIA#10633)

Signed-off-by: Yukun He <23156053+hyukn@users.noreply.github.com>
Signed-off-by: Yukun He <23156053+hyukn@users.noreply.github.com>
@hyukn hyukn requested a review from a team as a code owner January 16, 2026 06:37
@hyukn
Copy link
Collaborator Author

hyukn commented Jan 16, 2026

/bot run --disable-fail-fast

@tensorrt-cicd
Copy link
Collaborator

PR_Github #32257 [ run ] triggered by Bot. Commit: 0bfc5df

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 16, 2026

📝 Walkthrough

Walkthrough

Constructor signatures for McastGPUBuffer and McastDeviceMemory are updated across C++ headers, implementations, and Python bindings by removing the splitColor parameter and adding an mpiCommFortranHandle parameter. Python code is modified to use class-level workspace caching and pass the Fortran MPI communicator handle.

Changes

Cohort / File(s) Summary
McastGPUBuffer Header
cpp/tensorrt_llm/runtime/mcastGPUBuffer.h
Constructor signature updated: removed splitColor parameter, added int64_t mpiCommFortranHandle parameter. Parameter order changed from (bufSize, groupSize, groupRank, splitColor, deviceIdx, mnNvlink) to (bufSize, groupSize, groupRank, deviceIdx, mnNvlink, mpiCommFortranHandle). Documentation comment updated accordingly.
McastDeviceMemory Header
cpp/tensorrt_llm/runtime/mcastDeviceMemory.h
Constructor signature updated: removed splitColor parameter, added int64_t mpiCommFortranHandle parameter. Parameter order adjusted to match updated initialization expectations.
McastDeviceMemory Implementation
cpp/tensorrt_llm/runtime/mcastDeviceMemory.cpp
Constructor implementation updated with new parameters. Initialization of mGroupComm changed from MpiComm::session().split(splitColor, mGroupRank) to conditional logic: uses MPI_Comm_f2c(mpiCommFortranHandle) when ENABLE_MULTI_DEVICE is defined, otherwise nullptr. Debug logging adjusted to remove splitColor output and reorder arguments.
Python Bindings (Nanobind & Pybind)
cpp/tensorrt_llm/nanobind/runtime/bindings.cpp, cpp/tensorrt_llm/pybind/runtime/bindings.cpp
Constructor bindings updated: parameter types changed from (size_t, uint32_t, uint32_t, uint32_t, uint32_t, bool) to (size_t, uint32_t, uint32_t, uint32_t, bool, int64_t). Argument names updated from (buf_size, group_size, group_rank, split_color, device_idx, mn_nvlink) to (buf_size, group_size, group_rank, device_idx, mn_nvlink, mpi_comm_fortran_handle).
Python Workspace Management
tensorrt_llm/_torch/distributed/ops.py
Workspace caching changed from per-thread thread-local storage to class-level shared cache on MNNVLAllReduce.allreduce_mnnvl_workspaces. Logging unconditionally outputs (removed tp_rank==0 gate). McastGPUBuffer construction now passes comm.py2f() (Fortran MPI handle) instead of pp_rank-based index.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

🚥 Pre-merge checks | ✅ 1 | ❌ 2
❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Description check ⚠️ Warning The PR description is incomplete. It contains only the template structure with sections for 'Description' and 'Test Coverage' left blank. No actual explanation of the issue, solution, or test coverage is provided by the author. Fill in the 'Description' section explaining the root cause of the hanging issue and how the parameter signature changes fix it. Add 'Test Coverage' section listing specific tests that validate the fix.
Docstring Coverage ⚠️ Warning Docstring coverage is 40.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed The PR title '[https://nvbugs/5782112][fix] Cherry-pick #10633: Fix hanging issue for MNNVL Allreduce under PP' is specific and directly related to the changes, which update McastGPUBuffer/McastDeviceMemory constructor signatures and fix a hanging issue in MNNVL Allreduce.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (6)
cpp/tensorrt_llm/runtime/mcastDeviceMemory.h (1)

1-3: Update the copyright year to 2026.

Line 2 still lists 2025 even though this file was modified in 2026. Please bump the year to the latest meaningful modification.

🧾 Suggested update
- * Copyright (c) 2025, NVIDIA CORPORATION. All rights reserved.
+ * Copyright (c) 2026, NVIDIA CORPORATION. All rights reserved.
As per coding guidelines, update the header year to reflect the latest meaningful modification.
cpp/tensorrt_llm/pybind/runtime/bindings.cpp (1)

1-3: Update SPDX copyright year to 2026.

Line 2 still ends at 2025; this file was modified in 2026. Please bump the year to reflect the latest meaningful modification.

🧾 Suggested update
- * SPDX-FileCopyrightText: Copyright (c) 2022-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
+ * SPDX-FileCopyrightText: Copyright (c) 2022-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
As per coding guidelines, update the header year to reflect the latest meaningful modification.
cpp/tensorrt_llm/nanobind/runtime/bindings.cpp (1)

1-3: Update SPDX copyright year to 2026.

Line 2 still ends at 2025; this file was modified in 2026. Please bump the year to reflect the latest meaningful modification.

🧾 Suggested update
- * SPDX-FileCopyrightText: Copyright (c) 2022-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
+ * SPDX-FileCopyrightText: Copyright (c) 2022-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
As per coding guidelines, update the header year to reflect the latest meaningful modification.
cpp/tensorrt_llm/runtime/mcastGPUBuffer.h (1)

1-3: Update the copyright year to 2026.

Line 2 still lists 2025 even though this file was modified in 2026. Please bump the year to the latest meaningful modification.

🧾 Suggested update
- * Copyright (c) 2025, NVIDIA CORPORATION. All rights reserved.
+ * Copyright (c) 2026, NVIDIA CORPORATION. All rights reserved.
As per coding guidelines, update the header year to reflect the latest meaningful modification.
cpp/tensorrt_llm/runtime/mcastDeviceMemory.cpp (2)

1-3: Update the copyright year to 2026.

Line 2 still lists 2025 even though this file was modified in 2026. Please bump the year to the latest meaningful modification.

🧾 Suggested update
- * Copyright (c) 2025, NVIDIA CORPORATION. All rights reserved.
+ * Copyright (c) 2026, NVIDIA CORPORATION. All rights reserved.
As per coding guidelines, update the header year to reflect the latest meaningful modification.

40-55: Add validation for MPI communicator validity and rank/size consistency before collective operations.

The constructor initializes mGroupComm to nullptr when ENABLE_MULTI_DEVICE is disabled, but both allocMnMcastMem() (lines ~160, 176) and allocNvlsMcastMem() (line 219) unconditionally invoke collective operations on this communicator. When ENABLE_MULTI_DEVICE is off, calls to allgather(), bcast(), and getWorldRanks() will fail with a null MPI communicator. Additionally, the constructor accepts groupRank and groupSize parameters without validating that they match the actual communicator's rank and size, risking silent mismatches that cause deadlocks in collective operations.

🧹 Nitpick comments (2)
tensorrt_llm/_torch/distributed/ops.py (1)

518-518: Annotate mutable class attribute with ClassVar.

Per PEP 526 and static analysis (RUF012), mutable class attributes intended to be shared across instances should be annotated with typing.ClassVar to make the intent explicit and prevent IDE/type-checker confusion.

Suggested fix
-from typing import Dict, List, Optional, Tuple, Union
+from typing import ClassVar, Dict, List, Optional, Tuple, Union
-    allreduce_mnnvl_workspaces: Dict[Mapping, Dict] = {}
+    allreduce_mnnvl_workspaces: ClassVar[Dict[Mapping, Dict]] = {}
cpp/tensorrt_llm/runtime/mcastDeviceMemory.h (1)

46-47: Add Doxygen docs for the new MPI handle parameter.

Line 46 adds mpiCommFortranHandle in a public header; please add Doxygen //! parameter docs so the new argument is documented.

📘 Suggested documentation
-    McastDeviceMemory(size_t bufSize, uint32_t groupSize, uint32_t groupRank, int deviceIdx, bool mnNvlink,
-        int64_t mpiCommFortranHandle);
+    //! \brief Construct multicast device memory for a communication group.
+    //! \param bufSize Buffer size in bytes.
+    //! \param groupSize Number of ranks in the group.
+    //! \param groupRank Rank of the local process within the group.
+    //! \param deviceIdx CUDA device index.
+    //! \param mnNvlink Whether multi-node NVLink is used.
+    //! \param mpiCommFortranHandle Fortran MPI communicator handle (from Python mpi4py).
+    McastDeviceMemory(size_t bufSize, uint32_t groupSize, uint32_t groupRank, int deviceIdx, bool mnNvlink,
+        int64_t mpiCommFortranHandle);
As per coding guidelines, document new public prototypes in headers.
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between fe65847 and 0bfc5df.

📒 Files selected for processing (6)
  • cpp/tensorrt_llm/nanobind/runtime/bindings.cpp
  • cpp/tensorrt_llm/pybind/runtime/bindings.cpp
  • cpp/tensorrt_llm/runtime/mcastDeviceMemory.cpp
  • cpp/tensorrt_llm/runtime/mcastDeviceMemory.h
  • cpp/tensorrt_llm/runtime/mcastGPUBuffer.h
  • tensorrt_llm/_torch/distributed/ops.py
🧰 Additional context used
📓 Path-based instructions (6)
**/*.{cpp,cc,cxx,h,hpp,hxx,cu,cuh}

📄 CodeRabbit inference engine (CODING_GUIDELINES.md)

**/*.{cpp,cc,cxx,h,hpp,hxx,cu,cuh}: Closing braces of namespaces should have a comment saying the namespace it closes (e.g., } // namespace foo)
Prefer const or constexpr variables over #defines whenever possible
A variable that is not modified after its initialization should be declared as const
For naming of constants in C++, use uppercase snakecase with prefix 'k' (e.g., kDIGIT_NUM)
Except for 0, nullptr, true, and false, all other literals should only be used for variable initialization and not in comparisons or expressions
Use Allman indentation style for brace notation in C++ code
Put the semicolon for an empty for or while loop in a new line
The statement forming the body of a switch, while, do..while, or for statement must be a compound statement (use brace-delimited statements)
If and else statements should always be followed by brace-delimited statements, even if empty or a single statement
C++ filenames should use camelCase with first letter lowercase (e.g., thisIsAFilename.cpp)
All types (including class names) in C++ should use PascalCase with uppercase first letter (e.g., FooBarClass)
Local variables, methods, and namespaces in C++ should use camelCase with first letter lowercase (e.g., localFooBar)
Non-magic-number global variables that are non-static and not defined in anonymous namespace should use camelCase prefixed with 'g' (e.g., gDontUseGlobalFoos)
Non-magic-number global variables that are static or defined in an anonymous namespace should use camelCase prefixed with 's' (e.g., sMutableStaticGlobal)
Locally visible static variables should use camelCase with 's' as the first letter (e.g., static std::once_flag sFlag;)
Public, private, and protected class member variables should use camelCase prefixed with 'm' (e.g., mNbFooValues)
Do not use Hungarian notation in C++ except for 'apps hungarian' (e.g., 'nb' to indicate count: mNbLayers)
If a constructor parameter name conflicts with a public me...

Files:

  • cpp/tensorrt_llm/runtime/mcastGPUBuffer.h
  • cpp/tensorrt_llm/runtime/mcastDeviceMemory.h
  • cpp/tensorrt_llm/pybind/runtime/bindings.cpp
  • cpp/tensorrt_llm/nanobind/runtime/bindings.cpp
  • cpp/tensorrt_llm/runtime/mcastDeviceMemory.cpp
**/*.{h,hpp,hxx}

📄 CodeRabbit inference engine (CODING_GUIDELINES.md)

**/*.{h,hpp,hxx}: Follow Doxygen rules for documenting new C++ class interfaces and function prototypes. Use //! for C++-style single-line comments and //!< for class members
Use a preprocessor guard in C++ header files with the format TRTLLM_<FILENAME>_H, where the filename is in uppercase with no underscores, no prefix underscores, and no trailing underscores

Files:

  • cpp/tensorrt_llm/runtime/mcastGPUBuffer.h
  • cpp/tensorrt_llm/runtime/mcastDeviceMemory.h
**/*.{h,hpp,hxx,cpp,cc,cxx,cu,cuh}

📄 CodeRabbit inference engine (CODING_GUIDELINES.md)

All C++ class templates, function templates, class template member functions, and class template static members must be instantiated at least once

Files:

  • cpp/tensorrt_llm/runtime/mcastGPUBuffer.h
  • cpp/tensorrt_llm/runtime/mcastDeviceMemory.h
  • cpp/tensorrt_llm/pybind/runtime/bindings.cpp
  • cpp/tensorrt_llm/nanobind/runtime/bindings.cpp
  • cpp/tensorrt_llm/runtime/mcastDeviceMemory.cpp
**/*.{cpp,cc,cxx,h,hpp,hxx,cu,cuh,py}

📄 CodeRabbit inference engine (CODING_GUIDELINES.md)

All TensorRT-LLM source files (.cpp, .h, .cu, .py, and other source files) should contain an NVIDIA copyright header with the year of latest meaningful modification

Files:

  • cpp/tensorrt_llm/runtime/mcastGPUBuffer.h
  • cpp/tensorrt_llm/runtime/mcastDeviceMemory.h
  • cpp/tensorrt_llm/pybind/runtime/bindings.cpp
  • cpp/tensorrt_llm/nanobind/runtime/bindings.cpp
  • tensorrt_llm/_torch/distributed/ops.py
  • cpp/tensorrt_llm/runtime/mcastDeviceMemory.cpp
**/*.{cpp,cc,cxx,cu}

📄 CodeRabbit inference engine (CODING_GUIDELINES.md)

**/*.{cpp,cc,cxx,cu}: Use smart pointers for allocating objects on the heap in C++
Prefer unique_ptr for single resource ownership and shared_ptr for shared resource ownership in C++. Use weak_ptr only in exceptional cases
In C++ function calls where parameters are not obvious, use inline C comments to document the parameter (e.g., doSomeOperation(/* checkForErrors = */ false);)
Use the least forceful cast necessary in C++, or no cast if possible
Casting a pointer to void* in C++ should be implicit (except if removing const)
Casting in C++ should not remove any const or volatile qualification from the type of a pointer or reference
Do not use C-style casts (other than void casts) and functional notation casts (other than explicit constructor calls) in C++
Casting from void* to T* in C++ should be done with static_cast, not reinterpret_cast
Use reinterpret_cast in C++ as a last resort, where const_cast and static_cast won't work
Avoid dynamic_cast in C++
Do not use assignment operator in C++ subexpressions (e.g., x = y = z or if (x = y))
When practical, a C++ switch statement controlled by an enum should have a case for each enum value and not have a default clause
C++ switch statements should be well structured as structured multi-way branches, not as 'glorified gotos'
In C++ switch statements, prohibit fall-through except from one case label to another. Each case clause must be terminated with a break or throw
Do not end a C++ case clause with return; use break or throw instead
If a C++ switch clause is a compound statement, put the break inside the braces
Do not use C library functions in C++ whenever possible. Use C++ alternatives like brace initialization or std::fill_n() instead of memset()

Files:

  • cpp/tensorrt_llm/pybind/runtime/bindings.cpp
  • cpp/tensorrt_llm/nanobind/runtime/bindings.cpp
  • cpp/tensorrt_llm/runtime/mcastDeviceMemory.cpp
**/*.py

📄 CodeRabbit inference engine (CODING_GUIDELINES.md)

**/*.py: The code developed for TensorRT-LLM should conform to Python 3.8+
Indent Python code with 4 spaces. Do not use tabs
Always maintain the namespace when importing Python modules, even if only one class or function from a module is used
Python filenames should use snake_case (e.g., some_file.py)
Python classes should use PascalCase (e.g., class SomeClass)
Python functions and methods should use snake_case (e.g., def my_awesome_function():)
Python local variables should use snake_case, with prefix k for variable names that start with a number (e.g., k_99th_percentile)
Python global variables should use upper snake_case with prefix G (e.g., G_MY_GLOBAL)
Python constants should use upper snake_case (e.g., MY_CONSTANT)
Avoid shadowing variables declared in an outer scope in Python
Initialize all externally visible members of a Python class in the constructor
For Python interfaces that may be used outside a file, prefer docstrings over comments
Use comments in Python for code within a function, or interfaces that are local to a file
Use Google-style docstrings for Python classes and functions, which can be parsed by Sphinx
Python attributes and variables can be documented inline with the format """<type>: Description"""
Avoid using reflection in Python when functionality can be easily achieved without reflection
When using try-except blocks in Python, limit the except clause to the smallest set of errors possible
When using try-except blocks in Python to handle multiple possible variable types (duck-typing), keep the body of the try as small as possible and use the else block for the main logic

Files:

  • tensorrt_llm/_torch/distributed/ops.py
🧠 Learnings (5)
📚 Learning: 2025-09-02T13:42:44.885Z
Learnt from: pcastonguay
Repo: NVIDIA/TensorRT-LLM PR: 7455
File: tensorrt_llm/_torch/pyexecutor/py_executor.py:1852-1860
Timestamp: 2025-09-02T13:42:44.885Z
Learning: In MPI communication within TensorRT-LLM pipeline parallelism, different communication types (tokens, logits, termination sync) must use disjoint tag namespaces to avoid message routing collisions when using the same source/destination patterns.

Applied to files:

  • cpp/tensorrt_llm/runtime/mcastDeviceMemory.h
  • cpp/tensorrt_llm/nanobind/runtime/bindings.cpp
  • cpp/tensorrt_llm/runtime/mcastDeviceMemory.cpp
📚 Learning: 2025-08-14T06:36:40.701Z
Learnt from: timlee0212
Repo: NVIDIA/TensorRT-LLM PR: 6886
File: tensorrt_llm/_torch/models/modeling_deepseekv3.py:0-0
Timestamp: 2025-08-14T06:36:40.701Z
Learning: In DeepSeek V3 model (tensorrt_llm/_torch/models/modeling_deepseekv3.py), the disagreement between AllReduce.__init__ guard and _compute_mlp_tp_size logic for MNNVL usage is expected by design. The AllReduce component and MLP TP-size computation intentionally use different criteria for MNNVL availability decisions.

Applied to files:

  • tensorrt_llm/_torch/distributed/ops.py
📚 Learning: 2025-09-23T15:12:38.312Z
Learnt from: nv-lschneider
Repo: NVIDIA/TensorRT-LLM PR: 7910
File: cpp/tensorrt_llm/thop/allreduceOp.cpp:352-446
Timestamp: 2025-09-23T15:12:38.312Z
Learning: In TensorRT-LLM NCCL device implementation, NCCL version 2.28+ requirements are handled at runtime in the nccl_device/config layer rather than with compile-time guards. This allows the allreduceOp to remain version-agnostic and delegates version compatibility validation to the appropriate lower-level components that can gracefully handle unsupported configurations.

Applied to files:

  • tensorrt_llm/_torch/distributed/ops.py
📚 Learning: 2025-09-24T03:31:28.908Z
Learnt from: tongyuantongyu
Repo: NVIDIA/TensorRT-LLM PR: 7520
File: tensorrt_llm/_torch/pyexecutor/resource_manager.py:605-613
Timestamp: 2025-09-24T03:31:28.908Z
Learning: In TensorRT-LLM Ray orchestrator mode, ProcessGroups are initialized with both Gloo and NCCL backends (e.g., "cuda:nccl,cpu:gloo"), allowing PyTorch distributed to automatically route CPU tensors through Gloo and GPU tensors through NCCL. This eliminates the need for manual device placement when performing allreduce operations on base types.

Applied to files:

  • cpp/tensorrt_llm/runtime/mcastDeviceMemory.cpp
📚 Learning: 2025-09-23T14:58:05.372Z
Learnt from: nv-lschneider
Repo: NVIDIA/TensorRT-LLM PR: 7910
File: cpp/tensorrt_llm/kernels/nccl_device/config.cu:42-49
Timestamp: 2025-09-23T14:58:05.372Z
Learning: In TensorRT-LLM NCCL device kernels (cpp/tensorrt_llm/kernels/nccl_device/), the token partitioning intentionally uses ceil-like distribution (same token_per_rank for all ranks) to ensure all ranks launch the same number of blocks. This is required for optimal NCCL device API barrier performance, even though it may launch extra blocks for non-existent tokens on later ranks. Runtime bounds checking in the kernel (blockID validation) handles the overshoot cases.

Applied to files:

  • cpp/tensorrt_llm/runtime/mcastDeviceMemory.cpp
🧬 Code graph analysis (2)
cpp/tensorrt_llm/runtime/mcastDeviceMemory.h (1)
cpp/tensorrt_llm/runtime/mcastDeviceMemory.cpp (2)
  • McastDeviceMemory (40-109)
  • McastDeviceMemory (111-134)
tensorrt_llm/_torch/distributed/ops.py (3)
tensorrt_llm/mapping.py (2)
  • pp_rank (588-589)
  • tp_rank (584-585)
tensorrt_llm/_torch/distributed/communicator.py (3)
  • pp_rank (125-126)
  • tp_size (113-114)
  • tp_rank (121-122)
cpp/tensorrt_llm/runtime/mcastGPUBuffer.h (1)
  • McastGPUBuffer (26-68)
🪛 Ruff (0.14.11)
tensorrt_llm/_torch/distributed/ops.py

518-518: Mutable class attributes should be annotated with typing.ClassVar

(RUF012)

⏰ 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 (8)
tensorrt_llm/_torch/distributed/ops.py (4)

68-70: Intentional change to shared workspace storage looks correct for the PP fix.

The transition from thread-local to class-level storage enables workspace sharing across threads, which addresses the hanging issue. The comment clearly documents this intent.

Note for future maintenance: the check-then-modify pattern at lines 77-78 is not atomic. If concurrent initialization becomes possible in future architectures, consider adding synchronization (e.g., a threading.Lock).


102-104: LGTM - logging from all ranks provides better diagnostics.

Debug-level logging from all ranks is acceptable and can help diagnose issues in multi-rank deployments. Since this is at debug level, it won't impact production unless explicitly enabled.


107-114: Correct integration with updated McastGPUBuffer interface.

Passing the pre-split MPI communicator's Fortran handle (comm.py2f()) aligns with the C++ constructor signature and avoids redundant communicator splitting in the C++ layer. This change properly addresses the PP hanging issue by ensuring consistent communicator usage.


532-532: LGTM - clean initialization call.

Removing the unused assignment is a valid cleanup. The function call for its side effect (workspace initialization) is clear.

cpp/tensorrt_llm/nanobind/runtime/bindings.cpp (1)

349-352: Nanobind constructor update looks aligned.

Line 350 mirrors the new C++ signature; please keep it in lockstep with the pybind binding and ensure nanobind binding tests cover the updated constructor.

cpp/tensorrt_llm/runtime/mcastGPUBuffer.h (1)

37-42: Constructor signature/doc update looks good.

Line 40 correctly wires the new mpiCommFortranHandle parameter through to McastDeviceMemory.

cpp/tensorrt_llm/runtime/mcastDeviceMemory.cpp (1)

72-75: Log message update is clear.

Line 72’s reordered fields read consistently with the new constructor signature.

cpp/tensorrt_llm/pybind/runtime/bindings.cpp (1)

445-448: The review comment is based on an incorrect premise. The C++ constructor signature for McastGPUBuffer never contained a split_color parameter—there is no evidence of this parameter existing in the codebase. The current signature matches the Python bindings exactly, and the only Python call site found (in tensorrt_llm/_torch/distributed/ops.py:108–113) already uses the correct argument order. No compatibility issues or positional argument mismapping exists.

Likely an incorrect or invalid review comment.

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.

@tensorrt-cicd
Copy link
Collaborator

PR_Github #32257 [ run ] completed with state SUCCESS. Commit: 0bfc5df
/LLM/release-1.2/L0_MergeRequest_PR pipeline #16 completed with status: 'FAILURE'

⚠️ Action Required:

  • Please check the failed tests and fix your PR
  • If you cannot view the failures, ask the CI triggerer to share details
  • Once fixed, request an NVIDIA team member to trigger CI again

@hyukn
Copy link
Collaborator Author

hyukn commented Jan 19, 2026

/bot run --disable-fail-fast

@tensorrt-cicd
Copy link
Collaborator

PR_Github #32486 [ run ] triggered by Bot. Commit: 0bfc5df

@tensorrt-cicd
Copy link
Collaborator

PR_Github #32486 [ run ] completed with state SUCCESS. Commit: 0bfc5df
/LLM/release-1.2/L0_MergeRequest_PR pipeline #42 completed with status: 'SUCCESS'

@hyukn hyukn requested a review from litaotju January 19, 2026 05:38
@hyukn hyukn merged commit bc712a0 into NVIDIA:release/1.2 Jan 19, 2026
8 of 9 checks passed
dominicshanshan pushed a commit to dominicshanshan/TensorRT-LLM that referenced this pull request Jan 21, 2026
…ssue for MNNVL Allreduce under PP (NVIDIA#10750)

Signed-off-by: Yukun He <23156053+hyukn@users.noreply.github.com>
dominicshanshan pushed a commit to dominicshanshan/TensorRT-LLM that referenced this pull request Jan 21, 2026
…ssue for MNNVL Allreduce under PP (NVIDIA#10750)

Signed-off-by: Yukun He <23156053+hyukn@users.noreply.github.com>
Signed-off-by: Wangshanshan <30051912+dominicshanshan@users.noreply.github.com>
dominicshanshan pushed a commit to dominicshanshan/TensorRT-LLM that referenced this pull request Jan 21, 2026
…ssue for MNNVL Allreduce under PP (NVIDIA#10750)

Signed-off-by: Yukun He <23156053+hyukn@users.noreply.github.com>
Signed-off-by: Wangshanshan <30051912+dominicshanshan@users.noreply.github.com>
dominicshanshan pushed a commit to dominicshanshan/TensorRT-LLM that referenced this pull request Jan 22, 2026
…ssue for MNNVL Allreduce under PP (NVIDIA#10750)

Signed-off-by: Yukun He <23156053+hyukn@users.noreply.github.com>
Signed-off-by: Wangshanshan <30051912+dominicshanshan@users.noreply.github.com>
dominicshanshan pushed a commit to dominicshanshan/TensorRT-LLM that referenced this pull request Jan 22, 2026
…ssue for MNNVL Allreduce under PP (NVIDIA#10750)

Signed-off-by: Yukun He <23156053+hyukn@users.noreply.github.com>
Signed-off-by: Wangshanshan <30051912+dominicshanshan@users.noreply.github.com>
dominicshanshan pushed a commit to dominicshanshan/TensorRT-LLM that referenced this pull request Jan 22, 2026
…ssue for MNNVL Allreduce under PP (NVIDIA#10750)

Signed-off-by: Yukun He <23156053+hyukn@users.noreply.github.com>
Signed-off-by: Wangshanshan <30051912+dominicshanshan@users.noreply.github.com>
dominicshanshan pushed a commit to dominicshanshan/TensorRT-LLM that referenced this pull request Jan 23, 2026
…ssue for MNNVL Allreduce under PP (NVIDIA#10750)

Signed-off-by: Yukun He <23156053+hyukn@users.noreply.github.com>
Signed-off-by: Wangshanshan <30051912+dominicshanshan@users.noreply.github.com>
dominicshanshan pushed a commit to dominicshanshan/TensorRT-LLM that referenced this pull request Jan 24, 2026
…ssue for MNNVL Allreduce under PP (NVIDIA#10750)

Signed-off-by: Yukun He <23156053+hyukn@users.noreply.github.com>
Signed-off-by: Wangshanshan <30051912+dominicshanshan@users.noreply.github.com>
chzblych pushed a commit that referenced this pull request Jan 25, 2026
…or MNNVL Allreduce under PP (#10750)

Signed-off-by: Yukun He <23156053+hyukn@users.noreply.github.com>
Signed-off-by: Wangshanshan <30051912+dominicshanshan@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants