Skip to content

Conversation

@Funatiq
Copy link
Collaborator

@Funatiq Funatiq commented Jul 30, 2025

Summary by CodeRabbit

  • Removed Features
    • Python bindings for multiple batch management, buffer, and request-related classes were removed from both nanobind and pybind interfaces.
    • The optional buffer management argument was removed from Python interfaces for batch creation functions.
    • Tensor allocation for sequence lengths in the sampler was removed.
  • Refactor
    • Internal headers and includes cleaned up to remove unused dependencies.
    • Namespace alias removed to simplify internal declarations.
  • Chores
    • Build configuration updated to exclude obsolete source files.
    • Copyright years updated from 2024 to 2025 in multiple source files.

Description

Test Coverage

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.

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.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jul 30, 2025

📝 Walkthrough
📝 Walkthrough

The changes remove Python bindings and exposure of several classes and buffers related to batch management and runtime requests from both nanobind and pybind11 modules. Header includes and opaque bindings related to requests and medusa buffers are deleted. Additionally, a tensor allocation in a Python sampler is removed. No core logic or public API declarations are altered.


Changes

Cohort / File(s) Change Summary
Header include cleanup
cpp/include/tensorrt_llm/runtime/gptDecoder.h, cpp/tensorrt_llm/nanobind/common/customCasters.h, cpp/tensorrt_llm/pybind/common/customCasters.h, cpp/tensorrt_llm/nanobind/runtime/bindings.cpp, cpp/tensorrt_llm/pybind/runtime/bindings.cpp
Removed inclusion of "tensorrt_llm/runtime/request.h" and "tensorrt_llm/runtime/samplingConfig.h" headers; removed some standard includes; no code logic changes.
Nanobind batch_manager binding removals
cpp/tensorrt_llm/nanobind/batch_manager/algorithms.cpp, cpp/tensorrt_llm/nanobind/batch_manager/bindings.cpp
Removed Python bindings for classes HandleContextLogits, HandleGenerationLogits, MakeDecodingBatchInputOutput, UpdateDecoderBuffers, and tb::MedusaBuffers. Modified CreateNewDecoderRequests::__call__ binding to remove medusa_buffers argument from Python interface.
Pybind11 batch_manager binding removals
cpp/tensorrt_llm/pybind/batch_manager/algorithms.cpp, cpp/tensorrt_llm/pybind/batch_manager/bindings.cpp
Removed pybind11 bindings for HandleContextLogits, HandleGenerationLogits, MakeDecodingBatchInputOutput, UpdateDecoderBuffers, and tb::MedusaBuffers. Modified CreateNewDecoderRequests::__call__ binding to remove optional medusa_buffers argument from Python interface.
Pybind11 batch_manager buffers removal
cpp/tensorrt_llm/pybind/batch_manager/buffers.cpp, cpp/tensorrt_llm/pybind/batch_manager/buffers.h, cpp/tensorrt_llm/pybind/CMakeLists.txt, cpp/tensorrt_llm/pybind/bindings.cpp
Deleted entire Buffers class and its Python bindings, including TransformerBuffers and RuntimeBuffers classes and their methods and members. Removed related build file references and binding initialization calls.
Nanobind runtime binding removal
cpp/tensorrt_llm/nanobind/runtime/bindings.cpp
Removed nanobind bindings for tr::decoder_batch::Request and its vector binding.
Pybind11 runtime binding removal
cpp/tensorrt_llm/pybind/runtime/bindings.cpp
Removed pybind11 bindings for tr::decoder_batch::Request class, including constructor and all properties.
Python sampler change
tensorrt_llm/_torch/pyexecutor/sampler.py
Removed allocation of "sequence_lengths_host" tensor from the sampler's internal store initialization.
Namespace alias cleanup
cpp/tensorrt_llm/nanobind/bindings.cpp
Removed unused namespace alias tbk for tensorrt_llm::batch_manager::kv_cache_manager.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~15 minutes


Possibly related PRs

  • feat: nanobind bindings #5961: Introduces initial nanobind bindings for batch manager classes including Request; this PR removes those bindings, indicating a direct code-level connection.
  • Revert "feat: nanobind bindings (#5961)" #6160: Reverts nanobind bindings for runtime, batch manager, and executor components, overlapping with this PR's removal of bindings and header includes related to request.h.

Suggested reviewers

  • DomBrown
  • dcampora
  • syuoni

Note

⚡️ Unit Test Generation is now available in beta!

Learn more here, or try it out under "Finishing Touches" below.


📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between bc14587 and b6e9786.

📒 Files selected for processing (15)
  • cpp/include/tensorrt_llm/runtime/gptDecoder.h (0 hunks)
  • cpp/tensorrt_llm/nanobind/batch_manager/algorithms.cpp (2 hunks)
  • cpp/tensorrt_llm/nanobind/batch_manager/bindings.cpp (0 hunks)
  • cpp/tensorrt_llm/nanobind/bindings.cpp (0 hunks)
  • cpp/tensorrt_llm/nanobind/common/customCasters.h (1 hunks)
  • cpp/tensorrt_llm/nanobind/runtime/bindings.cpp (0 hunks)
  • cpp/tensorrt_llm/pybind/CMakeLists.txt (0 hunks)
  • cpp/tensorrt_llm/pybind/batch_manager/algorithms.cpp (3 hunks)
  • cpp/tensorrt_llm/pybind/batch_manager/bindings.cpp (1 hunks)
  • cpp/tensorrt_llm/pybind/batch_manager/buffers.cpp (0 hunks)
  • cpp/tensorrt_llm/pybind/batch_manager/buffers.h (0 hunks)
  • cpp/tensorrt_llm/pybind/bindings.cpp (1 hunks)
  • cpp/tensorrt_llm/pybind/common/customCasters.h (2 hunks)
  • cpp/tensorrt_llm/pybind/runtime/bindings.cpp (1 hunks)
  • tensorrt_llm/_torch/pyexecutor/sampler.py (0 hunks)
💤 Files with no reviewable changes (8)
  • cpp/include/tensorrt_llm/runtime/gptDecoder.h
  • tensorrt_llm/_torch/pyexecutor/sampler.py
  • cpp/tensorrt_llm/pybind/CMakeLists.txt
  • cpp/tensorrt_llm/nanobind/bindings.cpp
  • cpp/tensorrt_llm/nanobind/runtime/bindings.cpp
  • cpp/tensorrt_llm/pybind/batch_manager/buffers.h
  • cpp/tensorrt_llm/nanobind/batch_manager/bindings.cpp
  • cpp/tensorrt_llm/pybind/batch_manager/buffers.cpp
✅ Files skipped from review due to trivial changes (3)
  • cpp/tensorrt_llm/pybind/common/customCasters.h
  • cpp/tensorrt_llm/pybind/bindings.cpp
  • cpp/tensorrt_llm/pybind/batch_manager/bindings.cpp
🚧 Files skipped from review as they are similar to previous changes (3)
  • cpp/tensorrt_llm/nanobind/common/customCasters.h
  • cpp/tensorrt_llm/pybind/runtime/bindings.cpp
  • cpp/tensorrt_llm/pybind/batch_manager/algorithms.cpp
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{cpp,h,hpp,cc,cxx}

📄 CodeRabbit Inference Engine (CODING_GUIDELINES.md)

**/*.{cpp,h,hpp,cc,cxx}: 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.
Except 0 (used for checking signness/existence/emptiness), nullptr, true, false, all other literals should only be used for variable initialization.
Use the Allman indentation style for braces.
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 shall be a compound statement (use brace-delimited statements).
If and else should always be followed by brace-delimited statements, even if empty or a single statement.
C++ filenames should use camel case with first letter lowercase (e.g., thisIsAFilename.cpp) and must be case-insensitive unique within a compilation target.
All types (including class names) should use camel case with uppercase first letter (e.g., FooBarClass).
Local variables, methods, and namespaces should use camel case with first letter lowercase (e.g., localFooBar).
Non-magic-number global variables that are non-static and not defined in anonymous namespace should be camel case prefixed by a lower case 'g' (e.g., gDontUseGlobalFoos).
Non-magic-number global variables that are static or defined in an anonymous namespace should be camel case prefixed by a lower case 's' (e.g., sMutableStaticGlobal).
Locally visible static variable should be camel case with lowercase prefix 's' as the first letter of the name (e.g., static std::once_flag sFlag;).
Class member variables should be camel case prefixed with an 'm' (e.g., mNbFooValues). Public member variables do not require the 'm' prefix but it is highly encouraged.
Enumerations, global constants, static constants at class-scope and function-scope magic-number/literal constants are uppercase snakecase with prefix 'k' (e.g., kDIGIT_N...

Files:

  • cpp/tensorrt_llm/nanobind/batch_manager/algorithms.cpp
**/*.{cpp,h,hpp,cc,cxx,cu,py}

📄 CodeRabbit Inference Engine (CODING_GUIDELINES.md)

All TensorRT-LLM Open Source Software code should contain an NVIDIA copyright header that includes the current year. The block of text should be prepended to the top of all files, including .cpp, .h, .cu, .py, and any other source files which are compiled or interpreted.

Files:

  • cpp/tensorrt_llm/nanobind/batch_manager/algorithms.cpp
🧠 Learnings (1)
cpp/tensorrt_llm/nanobind/batch_manager/algorithms.cpp (2)

Learnt from: yechank-nvidia
PR: #6254
File: tensorrt_llm/_torch/pyexecutor/model_engine.py:1201-1204
Timestamp: 2025-07-22T09:22:14.726Z
Learning: In TensorRT-LLM's multimodal processing pipeline, shared tensor recovery using from_shared_tensor() is only needed during the context phase. Generation requests reuse the already-recovered tensor data and only need to call strip_for_generation() to remove unnecessary multimodal data while preserving the recovered tensors. This avoids redundant tensor recovery operations during generation.

Learnt from: CR
PR: NVIDIA/TensorRT-LLM#0
File: CODING_GUIDELINES.md:0-0
Timestamp: 2025-07-31T11:27:32.084Z
Learning: Applies to **/*.{cpp,h,hpp,cc,cxx,cu,py} : All TensorRT-LLM Open Source Software code should contain an NVIDIA copyright header that includes the current year. The block of text should be prepended to the top of all files, including .cpp, .h, .cu, .py, and any other source files which are compiled or interpreted.

⏰ 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 (1)
cpp/tensorrt_llm/nanobind/batch_manager/algorithms.cpp (1)

110-123: Clean removal of unused parameter from Python interface.

The modification correctly removes the medusa_buffers parameter from the Python binding while maintaining compatibility with the underlying C++ API by passing std::nullopt internally. This aligns well with the PR objective of removing unused buffers.

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai or @coderabbitai title anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@Funatiq
Copy link
Collaborator Author

Funatiq commented Jul 30, 2025

/bot run

@coderabbitai coderabbitai bot requested a review from dcampora July 30, 2025 10:50
@Funatiq Funatiq requested a review from DomBrown July 30, 2025 10:50
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

🔭 Outside diff range comments (2)
cpp/tensorrt_llm/pybind/batch_manager/algorithms.cpp (1)

2-2: Update copyright year to include 2025.

The copyright header should include the current year (2025) as required by the coding guidelines. The nanobind version correctly shows "2022-2025" while this file shows "2022-2024".

- * SPDX-FileCopyrightText: Copyright (c) 2022-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
+ * SPDX-FileCopyrightText: Copyright (c) 2022-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
cpp/tensorrt_llm/nanobind/common/customCasters.h (1)

47-51: Stale NB_MAKE_OPAQUE for Request / SamplingConfig – will not compile after header removal

NB_MAKE_OPAQUE(std::vector<tensorrt_llm::runtime::decoder_batch::Request>) and
NB_MAKE_OPAQUE(std::vector<tensorrt_llm::runtime::SamplingConfig>) rely on the
types that were just de-included in this patch.
Because no forward declaration for these symbols exists in this translation unit,
the compiler will error out with “unknown type name”.

If the intention of the PR is to drop those bindings entirely (as implied by the
removal of request.h / samplingConfig.h elsewhere), the opaque
registrations must go as well.

-NB_MAKE_OPAQUE(std::vector<tensorrt_llm::runtime::decoder_batch::Request>)
-NB_MAKE_OPAQUE(std::vector<tensorrt_llm::runtime::SamplingConfig>)

Alternatively, add forward declarations and keep the include in at least one
TU, but that contradicts the stated objective of removing the sampler
bindings.

🧹 Nitpick comments (2)
cpp/tensorrt_llm/nanobind/common/customCasters.h (1)

37-40: Duplicate & inconsistent <filesystem> / <vector> includes

<nanobind/stl/filesystem.h> already drags in <filesystem> and <nanobind/stl/vector.h> already drags in <vector>. Keeping the raw headers here adds redundant work for the compiler and increases include-order fragility.

-#include <deque>
-#include <filesystem>
-#include <vector>
+#include <deque>
cpp/tensorrt_llm/pybind/common/customCasters.h (1)

36-38: Minor include hygiene

<pybind11/stl_bind.h> already transitively includes <vector> and, via the STL
bindings, typically pulls in <filesystem> as well. While harmless, the
explicit additions grow compile times and violate the “only include what you
use” rule of thumb. Consider pruning unless a direct dependency exists.

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d980928 and 0a29aea.

📒 Files selected for processing (14)
  • cpp/include/tensorrt_llm/runtime/gptDecoder.h (0 hunks)
  • cpp/tensorrt_llm/nanobind/batch_manager/algorithms.cpp (2 hunks)
  • cpp/tensorrt_llm/nanobind/batch_manager/bindings.cpp (0 hunks)
  • cpp/tensorrt_llm/nanobind/common/customCasters.h (1 hunks)
  • cpp/tensorrt_llm/nanobind/runtime/bindings.cpp (0 hunks)
  • cpp/tensorrt_llm/pybind/CMakeLists.txt (0 hunks)
  • cpp/tensorrt_llm/pybind/batch_manager/algorithms.cpp (2 hunks)
  • cpp/tensorrt_llm/pybind/batch_manager/bindings.cpp (0 hunks)
  • cpp/tensorrt_llm/pybind/batch_manager/buffers.cpp (0 hunks)
  • cpp/tensorrt_llm/pybind/batch_manager/buffers.h (0 hunks)
  • cpp/tensorrt_llm/pybind/bindings.cpp (0 hunks)
  • cpp/tensorrt_llm/pybind/common/customCasters.h (1 hunks)
  • cpp/tensorrt_llm/pybind/runtime/bindings.cpp (0 hunks)
  • tensorrt_llm/_torch/pyexecutor/sampler.py (0 hunks)
💤 Files with no reviewable changes (10)
  • cpp/include/tensorrt_llm/runtime/gptDecoder.h
  • cpp/tensorrt_llm/pybind/CMakeLists.txt
  • cpp/tensorrt_llm/pybind/bindings.cpp
  • cpp/tensorrt_llm/nanobind/runtime/bindings.cpp
  • tensorrt_llm/_torch/pyexecutor/sampler.py
  • cpp/tensorrt_llm/nanobind/batch_manager/bindings.cpp
  • cpp/tensorrt_llm/pybind/batch_manager/buffers.h
  • cpp/tensorrt_llm/pybind/runtime/bindings.cpp
  • cpp/tensorrt_llm/pybind/batch_manager/bindings.cpp
  • cpp/tensorrt_llm/pybind/batch_manager/buffers.cpp
🧰 Additional context used
📓 Path-based instructions (3)
**/*.{cpp,h,hpp,cc,cxx}

📄 CodeRabbit Inference Engine (CODING_GUIDELINES.md)

**/*.{cpp,h,hpp,cc,cxx}: 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, as the latter are not visible to the compiler.
A variable that is not modified after its initialization should be declared as const.
Except 0 (only used in comparison for checking signness/existence/emptiness) and nullptr, true, false, all other literals should only be used for variable initialization.
Use the Allman indentation style for braces 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 shall be a compound statement (use brace-delimited statements).
If and else should always be followed by brace-delimited statements, even if empty or a single statement.
C++ filenames should use camel case with first letter lowercase (e.g., thisIsAFilename.cpp), and all files involved in a compilation target must have filenames that are case-insensitive unique.
All types (including class names) are camel case with uppercase first letter (e.g., FooBarClass).
Local variables, methods, and namespaces use camel case with first letter lowercase (e.g., localFooBar).
Non-magic-number global variables that are non-static and not defined in anonymous namespace use camel case prefixed by a lower case 'g' (e.g., gDontUseGlobalFoos).
Non-magic-number global variables that are static or defined in an anonymous namespace use camel case prefixed by a lower case 's' (e.g., sMutableStaticGlobal).
Locally visible static variable uses camel case with lowercase prefix 's' as the first letter of the name (e.g., static std::once_flag sFlag;).
Class member variables use camelcase prefixed with an 'm' (e.g., mNbFooValues). Public member variables do not require the 'm' prefix but it is encouraged for clarity.
Enumerations, global constants, static constants at class-scope, and function-scope ...

Files:

  • cpp/tensorrt_llm/pybind/common/customCasters.h
  • cpp/tensorrt_llm/nanobind/common/customCasters.h
  • cpp/tensorrt_llm/nanobind/batch_manager/algorithms.cpp
  • cpp/tensorrt_llm/pybind/batch_manager/algorithms.cpp
**/*.{h,hpp}

📄 CodeRabbit Inference Engine (CODING_GUIDELINES.md)

Use a preprocessor guard in header files. The guard name must have prefix TRTLLM_ followed by the filename, all in caps, and no trailing underscore.

Files:

  • cpp/tensorrt_llm/pybind/common/customCasters.h
  • cpp/tensorrt_llm/nanobind/common/customCasters.h
**/*.{cpp,h,cu,py}

📄 CodeRabbit Inference Engine (CODING_GUIDELINES.md)

All TensorRT-LLM Open Source Software code should contain an NVIDIA copyright header that includes the current year. This includes .cpp, .h, .cu, .py, and any other source files which are compiled or interpreted.

Files:

  • cpp/tensorrt_llm/pybind/common/customCasters.h
  • cpp/tensorrt_llm/nanobind/common/customCasters.h
  • cpp/tensorrt_llm/nanobind/batch_manager/algorithms.cpp
  • cpp/tensorrt_llm/pybind/batch_manager/algorithms.cpp
🧠 Learnings (4)
cpp/tensorrt_llm/pybind/common/customCasters.h (5)

Learnt from: CR
PR: NVIDIA/TensorRT-LLM#0
File: CODING_GUIDELINES.md:0-0
Timestamp: 2025-07-30T06:11:42.362Z
Learning: Applies to **/*.{cpp,h,cu,py} : All TensorRT-LLM Open Source Software code should contain an NVIDIA copyright header that includes the current year. This includes .cpp, .h, .cu, .py, and any other source files which are compiled or interpreted.

Learnt from: CR
PR: NVIDIA/TensorRT-LLM#0
File: CODING_GUIDELINES.md:0-0
Timestamp: 2025-07-30T06:11:42.362Z
Learning: Applies to **/*.{h,hpp} : Use a preprocessor guard in header files. The guard name must have prefix TRTLLM_ followed by the filename, all in caps, and no trailing underscore.

Learnt from: CR
PR: NVIDIA/TensorRT-LLM#0
File: CODING_GUIDELINES.md:0-0
Timestamp: 2025-07-30T06:11:42.362Z
Learning: Applies to **/*.{cpp,h,hpp,cc,cxx} : Avoid dynamic_cast in C++.

Learnt from: CR
PR: NVIDIA/TensorRT-LLM#0
File: CODING_GUIDELINES.md:0-0
Timestamp: 2025-07-30T06:11:42.362Z
Learning: Applies to **/*.{cpp,h,hpp,cc,cxx} : C headers should not be used directly. Use instead of <stdint.h>.

Learnt from: moraxu
PR: #6303
File: tests/integration/test_lists/qa/examples_test_list.txt:494-494
Timestamp: 2025-07-28T17:06:08.621Z
Learning: In TensorRT-LLM testing, it's common to have both CLI flow tests (test_cli_flow.py) and PyTorch API tests (test_llm_api_pytorch.py) for the same model. These serve different purposes: CLI flow tests validate the traditional command-line workflow, while PyTorch API tests validate the newer LLM API backend. Both are legitimate and should coexist.

cpp/tensorrt_llm/nanobind/common/customCasters.h (2)

Learnt from: CR
PR: NVIDIA/TensorRT-LLM#0
File: CODING_GUIDELINES.md:0-0
Timestamp: 2025-07-30T06:11:42.362Z
Learning: Applies to **/*.{cpp,h,cu,py} : All TensorRT-LLM Open Source Software code should contain an NVIDIA copyright header that includes the current year. This includes .cpp, .h, .cu, .py, and any other source files which are compiled or interpreted.

Learnt from: yechank-nvidia
PR: #6254
File: tensorrt_llm/_torch/pyexecutor/model_engine.py:1201-1204
Timestamp: 2025-07-22T09:22:14.726Z
Learning: In TensorRT-LLM's multimodal processing pipeline, shared tensor recovery using from_shared_tensor() is only needed during the context phase. Generation requests reuse the already-recovered tensor data and only need to call strip_for_generation() to remove unnecessary multimodal data while preserving the recovered tensors. This avoids redundant tensor recovery operations during generation.

cpp/tensorrt_llm/nanobind/batch_manager/algorithms.cpp (2)

Learnt from: yechank-nvidia
PR: #6254
File: tensorrt_llm/_torch/pyexecutor/model_engine.py:1201-1204
Timestamp: 2025-07-22T09:22:14.726Z
Learning: In TensorRT-LLM's multimodal processing pipeline, shared tensor recovery using from_shared_tensor() is only needed during the context phase. Generation requests reuse the already-recovered tensor data and only need to call strip_for_generation() to remove unnecessary multimodal data while preserving the recovered tensors. This avoids redundant tensor recovery operations during generation.

Learnt from: CR
PR: NVIDIA/TensorRT-LLM#0
File: CODING_GUIDELINES.md:0-0
Timestamp: 2025-07-30T06:11:42.362Z
Learning: Applies to **/*.{cpp,h,cu,py} : All TensorRT-LLM Open Source Software code should contain an NVIDIA copyright header that includes the current year. This includes .cpp, .h, .cu, .py, and any other source files which are compiled or interpreted.

cpp/tensorrt_llm/pybind/batch_manager/algorithms.cpp (1)

Learnt from: yechank-nvidia
PR: #6254
File: tensorrt_llm/_torch/pyexecutor/model_engine.py:1201-1204
Timestamp: 2025-07-22T09:22:14.726Z
Learning: In TensorRT-LLM's multimodal processing pipeline, shared tensor recovery using from_shared_tensor() is only needed during the context phase. Generation requests reuse the already-recovered tensor data and only need to call strip_for_generation() to remove unnecessary multimodal data while preserving the recovered tensors. This avoids redundant tensor recovery operations during generation.

⏰ 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 (3)
cpp/tensorrt_llm/nanobind/batch_manager/algorithms.cpp (2)

1-16: LGTM!

The copyright header correctly includes the current year (2025) as required by the coding guidelines.


110-123: LGTM! Clean parameter removal.

The removal of the medusa_buffers parameter from the Python interface while maintaining internal compatibility by passing std::nullopt is well implemented. This aligns with the broader refactoring to remove unused Medusa buffer functionality.

cpp/tensorrt_llm/pybind/batch_manager/algorithms.cpp (1)

112-125: LGTM! Consistent parameter removal across binding interfaces.

The removal of the medusa_buffers parameter is implemented consistently with the nanobind version, maintaining internal compatibility while simplifying the Python interface.

@tensorrt-cicd
Copy link
Collaborator

PR_Github #13527 [ run ] triggered by Bot

@tensorrt-cicd
Copy link
Collaborator

PR_Github #13527 [ run ] completed with state FAILURE
/LLM/main/L0_MergeRequest_PR pipeline #10136 completed with status: 'FAILURE'

@Funatiq Funatiq force-pushed the dev/cleanup_sampler branch from 0a29aea to 949df88 Compare July 30, 2025 11:13
@Funatiq
Copy link
Collaborator Author

Funatiq commented Jul 30, 2025

/bot run

@tensorrt-cicd
Copy link
Collaborator

PR_Github #13531 [ run ] triggered by Bot

@tensorrt-cicd
Copy link
Collaborator

PR_Github #13531 [ run ] completed with state FAILURE
/LLM/main/L0_MergeRequest_PR pipeline #10140 completed with status: 'FAILURE'

@Funatiq Funatiq force-pushed the dev/cleanup_sampler branch from 949df88 to bc14587 Compare July 30, 2025 13:07
@Funatiq
Copy link
Collaborator Author

Funatiq commented Jul 30, 2025

/bot run

@coderabbitai coderabbitai bot requested a review from syuoni July 30, 2025 13:08
@tensorrt-cicd
Copy link
Collaborator

PR_Github #13539 [ run ] triggered by Bot

@tensorrt-cicd
Copy link
Collaborator

PR_Github #13539 [ run ] completed with state SUCCESS
/LLM/main/L0_MergeRequest_PR pipeline #10148 completed with status: 'FAILURE'

@Funatiq Funatiq marked this pull request as ready for review July 31, 2025 08:24
@Funatiq Funatiq requested a review from a team as a code owner July 31, 2025 08:24
Funatiq added 6 commits July 31, 2025 13:30
…aders

- Remove unused Request class from gptDecoder.
- Remove unused Request class from bindings.

Signed-off-by: Robin Kobus <[email protected]>
…ationLogits, and MakeDecodingBatchInputOutput

- Removed unused class bindings and associated methods from both nanobind and pybind implementations.
- Cleaned up includes to streamline the codebase.

Signed-off-by: Robin Kobus <[email protected]>
…atures

- Removed MedusaBuffers class bindings from both nanobind and pybind implementations.
- Updated function signatures in initBindings to remove medusaBuffers parameter, defaulting it to std::nullopt within the function body.

Signed-off-by: Robin Kobus <[email protected]>
…d nanobind

- Deleted Buffers class and its bindings from both pybind and nanobind implementations.
- Cleaned up include statements in related files to streamline the codebase.

Signed-off-by: Robin Kobus <[email protected]>
- Updated the copyright year from 2024 to 2025 in various source files including bindings and algorithms.
- Ensured consistency across all relevant files in the codebase.

Signed-off-by: Robin Kobus <[email protected]>
@Funatiq Funatiq force-pushed the dev/cleanup_sampler branch from bc14587 to b6e9786 Compare July 31, 2025 11:30
@Funatiq
Copy link
Collaborator Author

Funatiq commented Jul 31, 2025

/bot run

@Funatiq Funatiq enabled auto-merge (squash) July 31, 2025 11:31
@tensorrt-cicd
Copy link
Collaborator

PR_Github #13668 [ run ] triggered by Bot

@tensorrt-cicd
Copy link
Collaborator

PR_Github #13668 [ run ] completed with state SUCCESS
/LLM/main/L0_MergeRequest_PR pipeline #10258 completed with status: 'FAILURE'

@Funatiq
Copy link
Collaborator Author

Funatiq commented Jul 31, 2025

/bot run

@tensorrt-cicd
Copy link
Collaborator

PR_Github #13705 [ run ] triggered by Bot

@tensorrt-cicd
Copy link
Collaborator

PR_Github #13705 [ run ] completed with state SUCCESS
/LLM/main/L0_MergeRequest_PR pipeline #10295 completed with status: 'SUCCESS'
Pipeline passed with automatic retried tests. Check the rerun report for details.

@Funatiq Funatiq merged commit d3c1468 into NVIDIA:main Aug 1, 2025
3 checks passed
@Funatiq Funatiq deleted the dev/cleanup_sampler branch August 1, 2025 07:57
lancelly pushed a commit to lancelly/TensorRT-LLM that referenced this pull request Aug 6, 2025
jain-ria pushed a commit to jain-ria/TensorRT-LLM that referenced this pull request Aug 7, 2025
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