Skip to content

Conversation

Funatiq
Copy link
Collaborator

@Funatiq Funatiq commented Sep 8, 2025

Summary by CodeRabbit

  • Refactor
    • Improved const/no-throw guarantees and clearer accessors for request APIs; reduced header coupling and removed several internal type aliases.
  • Bug Fixes
    • Clarified out-of-range error message for buffer views.
  • Tests
    • Decoder tests simplified by removing model-type dependencies; unit tests use the dedicated draft-token accessor.
  • Style
    • Numeric initializer expressed via chrono for readability.
  • Chores
    • Updated license header year to 2025.

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

  • 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.

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.

@Funatiq Funatiq marked this pull request as ready for review September 8, 2025 12:23
@Funatiq
Copy link
Collaborator Author

Funatiq commented Sep 8, 2025

/bot run

@coderabbitai coderabbitai bot changed the title @coderabbitai title [refactor] Update GenericLlmRequest qualifiers; test helpers Sep 8, 2025
@tensorrt-cicd
Copy link
Collaborator

PR_Github #18046 [ run ] triggered by Bot

Copy link
Contributor

coderabbitai bot commented Sep 8, 2025

📝 Walkthrough

Walkthrough

Header and API qualifier updates (noexcept/const/[[nodiscard]]), includes and license year bumps; executor constant initializer reformatted; BufferView exception message clarified; createNewDecoderRequests public types and includes simplified; lookaheadModule and modelConfig signature/include tweaks; tests updated to remove modelType and to use getNumDraftTokens().

Changes

Cohort / File(s) Summary
LLM request API qualifiers and includes
cpp/include/tensorrt_llm/batch_manager/llmRequest.h
License year bumped to 2025; added <cstring> and <list>; adjusted enum ordering; replaced a strict precondition with an info-bearing precheck; methods updated with noexcept, const, and [[nodiscard]] where appropriate; added explicit size casts; no behavioral change.
CreateNewDecoderRequests — public header changes
cpp/include/tensorrt_llm/batch_manager/createNewDecoderRequests.h
Replaced runtime/bufferManager.h include with executor/executor.h; removed several runtime:: forward declarations and public type aliases; changed operator() and createDecoderRequests return types to use executor::LookaheadDecodingConfig and executor-related types (and TensorPtr) instead of runtime aliases.
CreateNewDecoderRequests — implementation cleanup
cpp/tensorrt_llm/batch_manager/createNewDecoderRequests.cpp
Removed unused tk = tensorrt_llm::kernels alias; no functional change.
LookaheadModule API change
cpp/include/tensorrt_llm/runtime/lookaheadModule.h
Removed <memory> include; mExecutionConfig default init removed from ctor initializer list; getExecutionConfig() now returns [[nodiscard]] executor::LookaheadDecodingConfig const& (const reference) instead of by-value.
ModelConfig include addition
cpp/include/tensorrt_llm/runtime/modelConfig.h
Added #include "tensorrt_llm/runtime/speculativeDecodingModule.h" to expose SpeculativeDecodingModule members; no signature changes.
Executor constant formatting
cpp/include/tensorrt_llm/executor/executor.h
kDefaultMaxSeqIdleMicroseconds initializer changed to a std::chrono expression computing 3 minutes (value unchanged).
BufferView error message
cpp/tensorrt_llm/runtime/bufferView.h
Bounds check unchanged; exception message reformatted to show offset <offset> + size <size> exceeds buffer size <bufferSize> instead of the summed value.
E2E test refactor (modelType removed)
cpp/tests/e2e_tests/batch_manager/trtGptModelRealDecoderTest.cpp
Removed modelType parameter from pickRandomEndIds, loadTestData overloads, and runGptModelInference; updated all call sites—test data generation and inference helpers are now model-type-agnostic.
Unit test alignment
cpp/tests/unit_tests/batch_manager/llmRequestTest.cpp
Test assertion changed to use getNumDraftTokens() instead of checking draft tokens container size.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested reviewers

  • dcampora
  • DomBrown
  • litaotju
  • syuoni

Pre-merge checks and finishing touches

❌ Failed checks (2 warnings, 1 inconclusive)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 15.38% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
Description Check ⚠️ Warning The pull request description includes the required template sections (Description, Test Coverage, PR Checklist) but both the Description and Test Coverage sections are empty placeholders, leaving the rationale and validation strategy for the changes unspecified. This omission makes it impossible to understand the motivation or verify that adequate tests are in place. Fill in the Description section with a concise summary of the problem addressed and the solutions implemented, and list the relevant new or updated tests in the Test Coverage section to demonstrate that the changes are verified.
Title Check ❓ Inconclusive The title “[None] [refactor] Minor cleanup and improvements” follows the ticket/type convention but is overly generic and does not summarize the specific refactoring of API signatures, addition of noexcept and nodiscard attributes, and removal of redundant parameters across multiple modules. Because it fails to convey the principal changes in a clear, concise manner, it does not meet the criteria for a descriptive pull request title. Please provide a more specific title that highlights the main refactor, for example “[None][refactor] Enforce noexcept and const-correctness in LlmRequest and remove modelType from decoder request APIs.”
✨ 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

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: 1

Caution

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

⚠️ Outside diff range comments (1)
cpp/tests/e2e_tests/batch_manager/trtGptModelRealDecoderTest.cpp (1)

287-329: Fix potential out-of-bounds when maxNewTokens <= 2 in pickRandomEndIds.

endIdCol is computed as 2 + rand() % max(maxNewTokens - 2, 1); when maxNewTokens is 1 or 2, this yields 2 and can exceed available columns, leading to OOB access. Clamp the selection for small ranges and optionally reserve the vector.

 std::vector<TokenIdType> pickRandomEndIds(TestData const& testData, std::vector<SizeType32> const& givenInputLengths,
     SizeType32 const maxNewTokens, bool replaceLogits)
 {
     auto const nbGivenInputs = testData.nbGivenInputs;
     auto const beamWidth = testData.beamWidth;
     auto* const expectedOutputData = bufferCast<TokenIdType>(*testData.expectedOutputIds);

-    std::vector<TokenIdType> endIds;
+    std::vector<TokenIdType> endIds;
+    endIds.reserve(nbGivenInputs);

     // For IFB, pick one of the output tokens as endId
     for (SizeType32 bi = 0; bi < nbGivenInputs; ++bi)
     {
         TokenIdType skippedEndId0 = 0;
         TokenIdType skippedEndId1 = 0;
         SizeType32 endIdIndex = 0;
         TokenIdType endId = 0;
         auto const endIdRow = bi;
         auto const inputLength = givenInputLengths.at(endIdRow);
         do
         {
             auto const endIdBeam = std::rand() % beamWidth;
             auto const firstOutputIndex
                 = tc::flat_index3(endIdRow, endIdBeam, inputLength, beamWidth, testData.maxSeqLen);
-            // We do not use the 1st token for EndId because of Speculative Decoding test design
-            // We skip 1st token because minLength is 1
-            auto const endIdCol = 2 + (std::rand() % std::max(maxNewTokens - 2, 1));
+            // Prefer skipping first 1–2 tokens, but clamp safely for small maxNewTokens
+            SizeType32 endIdCol = 0;
+            if (maxNewTokens <= 1)
+            {
+                endIdCol = 0;
+            }
+            else if (maxNewTokens == 2)
+            {
+                endIdCol = 1;
+            }
+            else
+            {
+                endIdCol = 2 + (std::rand() % (maxNewTokens - 2));
+            }
             endIdIndex = firstOutputIndex + endIdCol;
             skippedEndId0 = expectedOutputData[firstOutputIndex];
             skippedEndId1 = expectedOutputData[firstOutputIndex + 1];
             endId = expectedOutputData[endIdIndex];
         } while (endId == skippedEndId0 || endId == skippedEndId1);
         // Workaround: The first example has endIdIndex 14, where the generation logits are almost same at
         // token ids 257 and 373, which causes unstable generation results. Hence, we use the one previous
         // token as endId.
         if (bi == 0 && !replaceLogits)
         {
             endId = expectedOutputData[endIdIndex - 1];
         }
         endIds.push_back(endId);
     }

     return endIds;
 }
🧹 Nitpick comments (1)
cpp/include/tensorrt_llm/executor/executor.h (1)

1482-1482: Nice readability win; consider deriving from chrono to avoid magic literal.

Digit separators help, but a chrono-derived value documents intent and prevents unit drift.

Apply optionally:

-    static constexpr uint64_t kDefaultMaxSeqIdleMicroseconds = 180'000'000;
+    static constexpr uint64_t kDefaultMaxSeqIdleMicroseconds =
+        std::chrono::duration_cast<std::chrono::microseconds>(std::chrono::minutes(3)).count();
📜 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 4a1e138 and d4a021d.

📒 Files selected for processing (5)
  • cpp/include/tensorrt_llm/batch_manager/llmRequest.h (4 hunks)
  • cpp/include/tensorrt_llm/executor/executor.h (1 hunks)
  • cpp/tensorrt_llm/runtime/bufferView.h (1 hunks)
  • cpp/tests/e2e_tests/batch_manager/trtGptModelRealDecoderTest.cpp (8 hunks)
  • cpp/tests/unit_tests/batch_manager/llmRequestTest.cpp (1 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/tests/unit_tests/batch_manager/llmRequestTest.cpp
  • cpp/tensorrt_llm/runtime/bufferView.h
  • cpp/include/tensorrt_llm/executor/executor.h
  • cpp/include/tensorrt_llm/batch_manager/llmRequest.h
  • cpp/tests/e2e_tests/batch_manager/trtGptModelRealDecoderTest.cpp
**/*.{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/tests/unit_tests/batch_manager/llmRequestTest.cpp
  • cpp/tensorrt_llm/runtime/bufferView.h
  • cpp/include/tensorrt_llm/executor/executor.h
  • cpp/include/tensorrt_llm/batch_manager/llmRequest.h
  • cpp/tests/e2e_tests/batch_manager/trtGptModelRealDecoderTest.cpp
**/*.{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/tests/unit_tests/batch_manager/llmRequestTest.cpp
  • cpp/tensorrt_llm/runtime/bufferView.h
  • cpp/include/tensorrt_llm/executor/executor.h
  • cpp/include/tensorrt_llm/batch_manager/llmRequest.h
  • cpp/tests/e2e_tests/batch_manager/trtGptModelRealDecoderTest.cpp
**/*.{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/tests/unit_tests/batch_manager/llmRequestTest.cpp
  • cpp/tensorrt_llm/runtime/bufferView.h
  • cpp/include/tensorrt_llm/executor/executor.h
  • cpp/include/tensorrt_llm/batch_manager/llmRequest.h
  • cpp/tests/e2e_tests/batch_manager/trtGptModelRealDecoderTest.cpp
**/*.{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/tests/unit_tests/batch_manager/llmRequestTest.cpp
  • cpp/tensorrt_llm/runtime/bufferView.h
  • cpp/include/tensorrt_llm/executor/executor.h
  • cpp/include/tensorrt_llm/batch_manager/llmRequest.h
  • cpp/tests/e2e_tests/batch_manager/trtGptModelRealDecoderTest.cpp
**/*.{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/runtime/bufferView.h
  • cpp/include/tensorrt_llm/executor/executor.h
  • cpp/include/tensorrt_llm/batch_manager/llmRequest.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/runtime/bufferView.h
  • cpp/include/tensorrt_llm/executor/executor.h
  • cpp/include/tensorrt_llm/batch_manager/llmRequest.h
🧠 Learnings (1)
📓 Common learnings
Learnt from: venkywonka
PR: NVIDIA/TensorRT-LLM#6029
File: .github/pull_request_template.md:45-53
Timestamp: 2025-08-27T17:50:13.264Z
Learning: For PR templates in TensorRT-LLM, avoid suggesting changes that would increase developer overhead, such as converting plain bullets to mandatory checkboxes. The team prefers guidance-style bullets that don't require explicit interaction to reduce friction in the PR creation process.
🧬 Code graph analysis (2)
cpp/include/tensorrt_llm/batch_manager/llmRequest.h (1)
cpp/include/tensorrt_llm/executor/executor.h (4)
  • nodiscard (271-304)
  • nodiscard (445-471)
  • nodiscard (1510-1782)
  • nodiscard (1885-1909)
cpp/tests/e2e_tests/batch_manager/trtGptModelRealDecoderTest.cpp (2)
cpp/tests/e2e_tests/batch_manager/trtGptModelTest.cpp (2)
  • trtGptModel (108-131)
  • trtGptModel (108-109)
cpp/tests/utils/common.h (1)
  • nbGivenInputs (213-213)
⏰ 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 (15)
cpp/include/tensorrt_llm/batch_manager/llmRequest.h (6)

2-2: Header year bump looks correct.


32-33: Includes justified.

<cstring> for memcpy and <list> for bad/stop words tensor creation are appropriate.


1118-1121: Const/noexcept + explicit cast LGTM.

getNumDraftTokens() now safe and clear.


1381-1384: Const/noexcept accessor LGTM.

getGenerationLogitsFragmentsSize() returns a sized type consistently.


1386-1389: noexcept clear() LGTM.

Throws no exceptions and matches container semantics.


1391-1394: Const-correctness and [[nodiscard]] LGTM.

hasAdditionalOutputs() is now side-effect free and expressive.

cpp/tests/unit_tests/batch_manager/llmRequestTest.cpp (1)

59-59: LGTM: switched to the new accessor getNumDraftTokens().

This aligns the test with the updated public API.

cpp/tests/e2e_tests/batch_manager/trtGptModelRealDecoderTest.cpp (8)

331-334: Signature simplification (drop modelType): OK.

Callers now rely on pickRandomEndIds() to derive endIds; no regressions evident.


356-356: Callsite updated to new pickRandomEndIds() path: OK.


412-414: Overload update to remove modelType: OK.

The tuple-returning helper matches the primary overload and keeps parameter order consistent.


426-428: Delegation to primary loadTestData overload: OK.


642-644: loadTestData call updated to new signature: OK.


664-666: First runGptModelInference call updated to new signature: OK.


671-671: Second runGptModelInference call updated to new signature: OK.


437-439: All callsites updated (no stale modelType usages)
Ripgrep scan found no matches for modelType in runGptModelInference, loadTestData, or pickRandomEndIds invocations.

@Funatiq
Copy link
Collaborator Author

Funatiq commented Sep 8, 2025

@coderabbitai review

@Funatiq Funatiq changed the title [refactor] Update GenericLlmRequest qualifiers; test helpers [None] [refactor] Update GenericLlmRequest qualifiers; test helpers Sep 8, 2025
Copy link
Contributor

coderabbitai bot commented Sep 8, 2025

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

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 (2)
cpp/include/tensorrt_llm/batch_manager/createNewDecoderRequests.h (2)

44-45: Make inheritance public to preserve Algorithm polymorphism.

Currently it’s private (class default). Likely breaks code expecting CreateNewDecoderRequests as an Algorithm.

-class CreateNewDecoderRequests : Algorithm
+class CreateNewDecoderRequests : public Algorithm

20-27: Include missing headers for complete std::vector types
Add the defining headers so std::vector<runtime::SamplingConfig> and std::vector<executor::LookaheadDecodingConfig> use complete types:

 #include "tensorrt_llm/runtime/worldConfig.h"
+#include "tensorrt_llm/runtime/samplingConfig.h"   // for runtime::SamplingConfig
+#include "tensorrt_llm/executor/executor.h"        // for executor::DecodingConfig & LookaheadDecodingConfig

Also apply the same at lines 64–79.

🧹 Nitpick comments (5)
cpp/include/tensorrt_llm/batch_manager/createNewDecoderRequests.h (5)

64-71: Mark operator() as [[nodiscard]] for symmetry and to prevent accidental discard.

-    operator()(runtime::ModelConfig const& modelConfig, runtime::WorldConfig const& worldConfig,
+    [[nodiscard]] operator()(runtime::ModelConfig const& modelConfig, runtime::WorldConfig const& worldConfig,
         executor::DecodingConfig const& decodingConfig, RequestVector const& contextRequests,
         nvinfer1::DataType logitsType, DecoderInputBuffers& inputBuffers, runtime::decoder::DecoderState& decoderState,
         CudaStream const& runtimeStream, CudaStream const& decoderStream, SizeType32 maxSequenceLength,
         SizeType32 beamWidth, OptionalRef<MedusaBuffers const> medusaBuffers) const;

47-48: Prefer std::string_view for name.

Avoids array type and matches common style for constexpr identifiers.

+#include <string_view>
...
-    constexpr static auto name{"CreateNewDecoderRequests"};
+    static constexpr std::string_view name{"CreateNewDecoderRequests"};

52-54: Use the alias consistently or remove it.

SharedConstPtr is defined but not used in signatures.

Option A (use it):

-    std::tuple<TensorPtr, std::vector<runtime::SamplingConfig>, std::vector<runtime::ITensor::SharedConstPtr>,
+    std::tuple<TensorPtr, std::vector<runtime::SamplingConfig>, std::vector<SharedConstPtr>,
         std::vector<executor::LookaheadDecodingConfig>>

Option B: drop the alias if you prefer explicit types.


57-63: Make ctor explicit; consider Options to replace tri-bool.

Prevents accidental implicit conversions and improves call-site clarity.

-    CreateNewDecoderRequests(bool speculativeDecodingFastLogits, bool isLeaderInOrchMode, bool isNormalizeLogProbs)
+    explicit CreateNewDecoderRequests(bool speculativeDecodingFastLogits, bool isLeaderInOrchMode, bool isNormalizeLogProbs)

If desired, I can sketch a CreateNewDecoderRequests::Options struct to replace the three bools.


28-31: Remove redundant forward-declare if you include samplingConfig.h.

If the header is included as suggested, this forward declaration becomes unnecessary.

-namespace tensorrt_llm::runtime
-{
-class SamplingConfig;
-```
+// SamplingConfig defined via #include "tensorrt_llm/runtime/samplingConfig.h"
📜 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 d4a021d and 1a97532.

📒 Files selected for processing (3)
  • cpp/include/tensorrt_llm/batch_manager/createNewDecoderRequests.h (1 hunks)
  • cpp/include/tensorrt_llm/executor/executor.h (1 hunks)
  • cpp/tensorrt_llm/batch_manager/createNewDecoderRequests.cpp (0 hunks)
💤 Files with no reviewable changes (1)
  • cpp/tensorrt_llm/batch_manager/createNewDecoderRequests.cpp
🚧 Files skipped from review as they are similar to previous changes (1)
  • cpp/include/tensorrt_llm/executor/executor.h
⏰ 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/include/tensorrt_llm/batch_manager/createNewDecoderRequests.h (1)

2-2: License year bump looks good.

@tensorrt-cicd
Copy link
Collaborator

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

@Funatiq
Copy link
Collaborator Author

Funatiq commented Sep 15, 2025

/bot run

@tensorrt-cicd
Copy link
Collaborator

PR_Github #18621 [ run ] triggered by Bot

@tensorrt-cicd
Copy link
Collaborator

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

@Funatiq Funatiq changed the title [None] [refactor] Update GenericLlmRequest qualifiers; test helpers [None] [refactor] Minor cleanup and improvements Sep 16, 2025
@Funatiq Funatiq force-pushed the dev/misc branch 2 times, most recently from b279db4 to 3d6cc19 Compare September 16, 2025 10:19
@Funatiq
Copy link
Collaborator Author

Funatiq commented Sep 16, 2025

@coderabbitai review

Copy link
Contributor

coderabbitai bot commented Sep 16, 2025

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@Funatiq
Copy link
Collaborator Author

Funatiq commented Sep 16, 2025

/bot run

@tensorrt-cicd
Copy link
Collaborator

PR_Github #18779 [ run ] triggered by Bot

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

🧹 Nitpick comments (3)
cpp/include/tensorrt_llm/runtime/lookaheadModule.h (1)

44-47: Return-by-const-ref + [[nodiscard]]: good; add noexcept and document thread-safety.

Accessor can’t throw—mark it noexcept. Also, returning a reference changes concurrency semantics vs prior copy; ensure mExecutionConfig is write-once before concurrent reads, or document required external synchronization.

Apply this diff:

-    [[nodiscard]] executor::LookaheadDecodingConfig const& getExecutionConfig() const
+    [[nodiscard]] executor::LookaheadDecodingConfig const& getExecutionConfig() const noexcept
cpp/include/tensorrt_llm/batch_manager/createNewDecoderRequests.h (2)

65-71: Prefer a named result type over a 4-tuple for readability and API stability.

The widened tuple increases call‑site ambiguity. Consider a small struct with named fields.

Example:

-    [[nodiscard]] std::tuple<TensorPtr, std::vector<SamplingConfig>, std::vector<SharedConstPtr>,
-        std::vector<executor::LookaheadDecodingConfig>>
-    operator(... ) const;
+    struct OpResult {
+        TensorPtr inputIds;
+        std::vector<SamplingConfig> samplingConfigs;
+        std::vector<SharedConstPtr> decoderInputs;
+        std::vector<executor::LookaheadDecodingConfig> lookaheadConfigs;
+    };
+    [[nodiscard]] OpResult operator(... ) const;

73-79: Minor readability: add a local alias for LookaheadDecodingConfig.

Keeps signatures concise and consistent with existing aliases.

Apply this diff:

   using TensorPtr = runtime::ITensor::SharedPtr;
   using SharedConstPtr = runtime::ITensor::SharedConstPtr;
+  using LookaheadDecodingConfig = tensorrt_llm::executor::LookaheadDecodingConfig;
-    [[nodiscard]] std::tuple<std::vector<SharedConstPtr>, std::vector<executor::LookaheadDecodingConfig>>
+    [[nodiscard]] std::tuple<std::vector<SharedConstPtr>, std::vector<LookaheadDecodingConfig>>
     createDecoderRequests(...

And likewise for the operator() return type above.

📜 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 1a97532 and 3d6cc19.

📒 Files selected for processing (6)
  • cpp/include/tensorrt_llm/batch_manager/createNewDecoderRequests.h (3 hunks)
  • cpp/include/tensorrt_llm/batch_manager/llmRequest.h (5 hunks)
  • cpp/include/tensorrt_llm/executor/executor.h (1 hunks)
  • cpp/include/tensorrt_llm/runtime/lookaheadModule.h (1 hunks)
  • cpp/include/tensorrt_llm/runtime/modelConfig.h (1 hunks)
  • cpp/tensorrt_llm/batch_manager/createNewDecoderRequests.cpp (0 hunks)
💤 Files with no reviewable changes (1)
  • cpp/tensorrt_llm/batch_manager/createNewDecoderRequests.cpp
✅ Files skipped from review due to trivial changes (1)
  • cpp/include/tensorrt_llm/runtime/modelConfig.h
🚧 Files skipped from review as they are similar to previous changes (2)
  • cpp/include/tensorrt_llm/executor/executor.h
  • cpp/include/tensorrt_llm/batch_manager/llmRequest.h
⏰ 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/include/tensorrt_llm/batch_manager/createNewDecoderRequests.h (2)

2-2: License year bump: LGTM.


23-23: Including executor/executor.h is appropriate for the new executor types.

cpp/include/tensorrt_llm/runtime/lookaheadModule.h (1)

29-37: noexcept safe — default LookaheadDecodingConfig is non-throwing

LookaheadDecodingConfig() delegates to LookaheadDecodingConfig(kDefaultLookaheadDecodingWindow, kDefaultLookaheadDecodingNgram, kDefaultLookaheadDecodingVerificationSet); the three-arg ctor performs runtime checks that succeed for those constants, so default construction will not throw and keeping LookaheadModule ctors noexcept is safe. See cpp/include/tensorrt_llm/executor/executor.h and cpp/tensorrt_llm/executor/decodingConfig.cpp.

@tensorrt-cicd
Copy link
Collaborator

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

@Funatiq
Copy link
Collaborator Author

Funatiq commented Sep 17, 2025

/bot run

@tensorrt-cicd
Copy link
Collaborator

PR_Github #18923 [ run ] triggered by Bot

@tensorrt-cicd
Copy link
Collaborator

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

@Funatiq
Copy link
Collaborator Author

Funatiq commented Sep 29, 2025

/bot run

@tensorrt-cicd
Copy link
Collaborator

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

@Funatiq
Copy link
Collaborator Author

Funatiq commented Sep 30, 2025

/bot run

@tensorrt-cicd
Copy link
Collaborator

PR_Github #20380 [ run ] triggered by Bot

@tensorrt-cicd
Copy link
Collaborator

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

@Funatiq
Copy link
Collaborator Author

Funatiq commented Oct 1, 2025

/bot run

@tensorrt-cicd
Copy link
Collaborator

PR_Github #20445 [ run ] triggered by Bot

@tensorrt-cicd
Copy link
Collaborator

PR_Github #20445 [ run ] completed with state DISABLED
L0 testing is limited to prioritized users. User Funatiq is not in the prioritized list. L0 testing cannot be triggered.

@Funatiq
Copy link
Collaborator Author

Funatiq commented Oct 1, 2025

/bot run

@tensorrt-cicd
Copy link
Collaborator

PR_Github #20448 [ run ] triggered by Bot

@tensorrt-cicd
Copy link
Collaborator

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

…by removing redundant parameters

Signed-off-by: Robin Kobus <19427718+Funatiq@users.noreply.github.com>
Signed-off-by: Robin Kobus <19427718+Funatiq@users.noreply.github.com>
- Updated the out-of-range exception message to provide clearer context by specifying both the offset and size, enhancing readability and debugging ease.

Signed-off-by: Robin Kobus <19427718+Funatiq@users.noreply.github.com>
…specifications

- Added <cstring> and <list> includes for improved functionality.
- Updated function signatures to include noexcept and [[nodiscard]] attributes for better performance and safety.
- Removed redundant error checks to streamline the code.

Signed-off-by: Robin Kobus <19427718+Funatiq@users.noreply.github.com>
- Updated copyright year from 2024 to 2025.
- Removed unused includes for DecodingInput, DecodingOutput, GptDecoderBatched, and SpeculativeDecodingMode to streamline the code.

Signed-off-by: Robin Kobus <19427718+Funatiq@users.noreply.github.com>
Signed-off-by: Robin Kobus <19427718+Funatiq@users.noreply.github.com>
- Moved the kGENERATION_TO_COMPLETE state definition to maintain consistent ordering within the enum.
- Ensured clarity in the state transitions for better code readability.

Signed-off-by: Robin Kobus <19427718+Funatiq@users.noreply.github.com>
@Funatiq
Copy link
Collaborator Author

Funatiq commented Oct 1, 2025

/bot run

@tensorrt-cicd
Copy link
Collaborator

PR_Github #20464 [ run ] triggered by Bot

@tensorrt-cicd
Copy link
Collaborator

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

@Funatiq
Copy link
Collaborator Author

Funatiq commented Oct 2, 2025

/bot run --disable-fail-fast

@tensorrt-cicd
Copy link
Collaborator

PR_Github #20520 [ run ] triggered by Bot

@tensorrt-cicd
Copy link
Collaborator

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

@Funatiq Funatiq requested a review from DomBrown October 2, 2025 11:57
Copy link
Collaborator

@DomBrown DomBrown left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Funatiq Funatiq merged commit e2f69c5 into NVIDIA:main Oct 3, 2025
6 of 7 checks passed
@Funatiq Funatiq deleted the dev/misc branch October 3, 2025 09:40
evezhier pushed a commit to evezhier/TensorRT-LLM that referenced this pull request Oct 3, 2025
Signed-off-by: Robin Kobus <19427718+Funatiq@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