Skip to content

Conversation

pengbowang-nv
Copy link
Collaborator

@pengbowang-nv pengbowang-nv commented Aug 22, 2025

Summary by CodeRabbit

  • New Features

    • Enabled speculative-decoding support for an additional GPU kernel path.
    • Added an environment variable to choose JIT or precompiled execution (defaults to JIT).
  • Performance

    • Optimized speculative-decoding dispatch and launch for improved throughput on supported GPUs.
  • Reliability

    • Strengthened per-kernel compatibility checks to avoid unsupported configurations.
    • Improved numerical consistency in attention masking.

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.

Copy link
Contributor

coderabbitai bot commented Aug 22, 2025

📝 Walkthrough

Walkthrough

Adds a constexpr infinity() to mha::numeric_limits<float> and uses it for mask filling. Introduces HMMA-specific speculative-decoding paths and refined per-kernel capability checks in decoderXQAImplJIT. Simplifies implementation selection in DecoderXQARunner to an environment-driven JIT vs precompiled choice.

Changes

Cohort / File(s) Summary
Numeric limits addition
cpp/kernels/xqa/mha_stdheaders.cuh
Adds static constexpr float infinity() noexcept to the numeric_limits<float> specialization, returning IEEE-754 +inf.
Mask uses new infinity
cpp/kernels/xqa/mha.cu
Replaces -INFINITY with -mha::numeric_limits<float>::infinity() in mask-application logic.
Decoder JIT — HMMA speculative-decoding
cpp/tensorrt_llm/kernels/decoderMaskedMultiheadAttention/decoderXQAImplJIT/decoderXQAImplJIT.cpp
Adds HMMA-specific speculative-decoding branch and parameter packing; introduces HMMA capability detection; refines speculative-decoding gating with per-kernel support checks (HMMA/GMMA/MLA); expands kernel param buffer and null-guard; adjusts grid/block launch configs for HMMA.
Runner impl selection simplified
cpp/tensorrt_llm/kernels/decoderMaskedMultiheadAttention/decoderXQARunner.cpp
Removes multi_query_tokens/SM/grpSize gating; selects JIT vs precompiled solely via getEnvEnableXQAJIT() (defaults to JIT if unset).

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant Caller
  participant Runner as DecoderXQARunner
  participant JIT as JIT Impl
  participant Pre as Precompiled Impl

  Caller->>Runner: getImplFromXQAParams(xqaParams)
  Runner->>Runner: read getEnvEnableXQAJIT()
  alt Env unset or true
    Runner-->>Caller: return JIT
  else Env false
    Runner-->>Caller: return Precompiled
  end
Loading
sequenceDiagram
  autonumber
  participant Host as decoderXQAImplJIT
  participant Detect as Kernel Type Detect
  participant Support as supportConfig checks
  participant HMMA as HMMA Kernel
  participant GMMA as GMMA Kernel
  participant MLA as MLA Kernel

  Host->>Detect: determine isHMMA/isGMMA/isMLA
  Detect-->>Support: query per-kernel support
  Support-->>Host: support results
  alt Speculative decoding enabled
    alt HMMA path allowed
      Host->>HMMA: pack HMMA spec-dec params (cu_seq_lens, mask, qScale, kv params, etc.)\nlaunch gridDim={multi_block, nbTokenBlocks*kvHeads, batch}, blockDim=(128,1,2)
      HMMA-->>Host: return
    else GMMA path allowed
      Host->>GMMA: existing GMMA spec-dec param pack & launch
      GMMA-->>Host: return
    else MLA path allowed
      Host->>MLA: MLA (or HMMA-in-MLA) spec-dec param pack & launch
      MLA-->>Host: return
    end
  else Non-speculative
    Host->>HMMA: or GMMA or MLA standard launch
  end
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

Suggested reviewers

  • symphonylyh
  • lucifer1004
  • jhaotingc
  • kaiyux

Tip

🔌 Remote MCP (Model Context Protocol) integration is now available!

Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats.

✨ 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.
    • 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.
  • 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 the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

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

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

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.

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • 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.

@pengbowang-nv
Copy link
Collaborator Author

/bot run --add-multi-gpu-test --disable-fail-fast

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 (1)
cpp/tensorrt_llm/kernels/decoderMaskedMultiheadAttention/decoderXQAImplJIT/decoderXQAImplJIT.cpp (1)

360-367: Parameter array is too small for the largest branches (risk of OOB writes)

kMAX_NB_KERNEL_PARAMS = 15 is insufficient now. Counting appendParam calls:

  • HMMA spec-dec branch can append up to 17–19 params (depending on options).
  • Non-MLA GMMA spec-dec branch can append 17.

This can overflow kernelParams and corrupt memory.

Please bump capacity and add a compile-time sanity guard:

-    constexpr uint32_t kMAX_NB_KERNEL_PARAMS = 15;
+    // Keep this comfortably above the max observed across all branches (currently ~19).
+    constexpr uint32_t kMAX_NB_KERNEL_PARAMS = 24;

Optionally add a static_assert near each branch documenting the expected upper bound, or switch kernelParams to a std::array<void*, kMAX_NB_KERNEL_PARAMS> and keep using the existing bound checks.

🧹 Nitpick comments (2)
cpp/kernels/xqa/mha_stdheaders.cuh (1)

78-81: Add constexpr infinity(): LGTM with a minor CUDA portability note

The helper cleanly centralizes +inf and aligns with the new usage site. One small nit: relying on __int_as_float inside a constexpr is generally fine under nvcc, but if this header is ever parsed by a host-only toolchain in GENERATE_CUBIN mode, that intrinsic might not be visible. Consider guarding with a fallback or annotating for device explicitly.

Apply this small tweak if you want to be extra defensive:

-    static constexpr float infinity() noexcept
-    {
-        return __int_as_float(0x7f800000);
-    }
+    DEVICE_FUNC static constexpr float infinity() noexcept
+    {
+        // IEEE-754 +Inf bit pattern
+        return __int_as_float(0x7f800000);
+    }
cpp/kernels/xqa/mha.cu (1)

508-510: Use of -mha::numeric_limits::infinity() instead of -INFINITY: LGTM

This removes reliance on a macro and is consistent with the new numeric_limits shim. As a micro-nit, you could hoist a const float negInf = -mha::numeric_limits::infinity(); outside the inner loops to make intent explicit (the compiler should hoist it anyway).

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between b8b2bd4 and 960d601.

📒 Files selected for processing (4)
  • cpp/kernels/xqa/mha.cu (1 hunks)
  • cpp/kernels/xqa/mha_stdheaders.cuh (1 hunks)
  • cpp/tensorrt_llm/kernels/decoderMaskedMultiheadAttention/decoderXQAImplJIT/decoderXQAImplJIT.cpp (3 hunks)
  • cpp/tensorrt_llm/kernels/decoderMaskedMultiheadAttention/decoderXQARunner.cpp (0 hunks)
💤 Files with no reviewable changes (1)
  • cpp/tensorrt_llm/kernels/decoderMaskedMultiheadAttention/decoderXQARunner.cpp
🧰 Additional context used
📓 Path-based instructions (5)
**/*.{cpp,cxx,cc,cu,h,hpp,hxx,hh,cuh}

📄 CodeRabbit inference engine (CODING_GUIDELINES.md)

**/*.{cpp,cxx,cc,cu,h,hpp,hxx,hh,cuh}: In C++, close namespaces with a comment naming the namespace (e.g., } // namespace foo)
Prefer const/constexpr variables over #define for constants
Declare variables const if not modified after initialization
Use Allman brace style in C++
C++ filenames use lowerCamelCase and must be case-insensitively unique within a build target
C++ type names use UpperCamelCase
Local variables, methods, and namespaces use lowerCamelCase
Global non-static variables not in anonymous namespace use gPrefix lowerCamelCase (e.g., gExample)
Static globals or globals in anonymous namespaces use sPrefix lowerCamelCase
Locally visible static variables start with 's' (e.g., static std::once_flag sFlag;)
Member variables use mPrefix lowerCamelCase; public members may omit but are encouraged to use 'm'
Constants (enums, global/static/function-scope magic numbers) use kPREFIXED_UPPER_SNAKE (e.g., kDIGIT_NUM)
If macros are unavoidable, use UPPER_SNAKE_CASE (prefer constants over #define)
Constructor parameter that conflicts with a public member name gets trailing underscore (foo_)
Literal suffixes should be uppercase (e.g., 1234L not 1234l)
C++: use spaces only; indent 4 spaces
Run clang-format (LLVM style) before submitting; wrap lines at 120 characters
If formatting must be bypassed, use // clang-format off/on around the section
Prefer smart pointers; use unique_ptr for sole ownership, shared_ptr for shared; weak_ptr only in exceptional cases
Do not use deprecated pre-C++11 smart pointers
Use C++ style comments; avoid C comments except special inline cases; prefer // single-line
Capitalize and punctuate full-sentence comments
Follow Doxygen rules: use //! for comments and //!< for members in C++
Disable code with #if/#endif and mnemonic conditions; avoid commented-out code; avoid dead code
Do not throw exceptions across library boundaries
Use least-forceful casts; avoid removing const/volatile; avoid C-style and functional casts (except constructors); p...

Files:

  • cpp/kernels/xqa/mha.cu
  • cpp/kernels/xqa/mha_stdheaders.cuh
  • cpp/tensorrt_llm/kernels/decoderMaskedMultiheadAttention/decoderXQAImplJIT/decoderXQAImplJIT.cpp
**/*.{cpp,cxx,cc,cu}

📄 CodeRabbit inference engine (CODING_GUIDELINES.md)

**/*.{cpp,cxx,cc,cu}: Avoid literal values except for 0, nullptr, true, false; use named constexpr for other literals
Place semicolon of empty for/while loop on a new line
Always use brace-delimited bodies for switch/while/do-for/if/else
Use inline C comments in argument lists when parameter meaning is unclear (e.g., /* checkForErrors = */ false)
Do not use assignment in subexpressions (e.g., if (x = y) ... is forbidden)
Switch on enums should enumerate all values and omit default to catch new values at compile time
Structure switch statements; prohibit fallthrough except between empty cases; each case ends with break or throw; return at end of case not allowed; put break inside braces for compound case
Prefer anonymous namespaces over static for internal linkage of functions
Every defined function must be called at least once (no unused methods)

Files:

  • cpp/kernels/xqa/mha.cu
  • cpp/tensorrt_llm/kernels/decoderMaskedMultiheadAttention/decoderXQAImplJIT/decoderXQAImplJIT.cpp
**/*.{h,hpp,hxx,hh,cuh,cpp,cxx,cc,cu}

📄 CodeRabbit inference engine (CODING_GUIDELINES.md)

Parameter names must be consistent between declarations and definitions

Files:

  • cpp/kernels/xqa/mha.cu
  • cpp/kernels/xqa/mha_stdheaders.cuh
  • cpp/tensorrt_llm/kernels/decoderMaskedMultiheadAttention/decoderXQAImplJIT/decoderXQAImplJIT.cpp
**/*.{cpp,cxx,cc,cu,h,hpp,hxx,hh,cuh,py}

📄 CodeRabbit inference engine (CODING_GUIDELINES.md)

Prepend NVIDIA copyright header (current year) to all source files

Files:

  • cpp/kernels/xqa/mha.cu
  • cpp/kernels/xqa/mha_stdheaders.cuh
  • cpp/tensorrt_llm/kernels/decoderMaskedMultiheadAttention/decoderXQAImplJIT/decoderXQAImplJIT.cpp
**/*.{h,hpp,hxx,hh,cuh}

📄 CodeRabbit inference engine (CODING_GUIDELINES.md)

Header files must use include guards named TRTLLM__H without underscores prefix/suffix (e.g., TRTLLM_FOO_BAR_HELLO_H)

Files:

  • cpp/kernels/xqa/mha_stdheaders.cuh
🔇 Additional comments (4)
cpp/tensorrt_llm/kernels/decoderMaskedMultiheadAttention/decoderXQAImplJIT/decoderXQAImplJIT.cpp (4)

212-215: Kernel-type flags are clear and correctly derived from cubinObj

The new flags (isHMMAKernel, isGMMAKernel, isMLAKernel) improve readability of the dispatch branches. No issues.


215-221: Spec-dec + MLA constraint is reasonable; verify HMMA variable-length coverage

You forbid variable generation length for MLA (good). For HMMA spec-dec, the new path should cover both fixed and variable generation lengths; please confirm tests exercise both, since grid sizing differs.

Would you confirm:

  • HMMA spec-dec with spec_decoding_is_generation_length_variable = true is exercised in CI?
  • Max per-batch q length is respected by your grid sizing (see follow-up comment below)?

488-495: GMMA-only spec-dec constraint in the default path: OK and consistent

The debug check that spec-dec here implies GMMA is consistent with the dedicated HMMA-spec-dec branch above. No action needed.


396-448: I wasn’t able to automatically extract the SpecDecParams definition or a multi_block_mode field—please confirm those in decoderXQAImplCommon.h and xqaParams.h. Ensure:

• The SpecDecParams struct’s member types (especially for mask and qCuSeqLens) match your reinterpret_casts.
• There is no xqaParams.multi_block_mode; guard unsupported multi-block by asserting multi_block == 1.
• All possible appendParam calls (including conditional ones for sliding windows, FP8 output, and beam width) fit within kMAX_NB_KERNEL_PARAMS—bump it if needed.

Once verified, apply the refactor diff with these corrections.

@tensorrt-cicd
Copy link
Collaborator

PR_Github #16173 [ run ] triggered by Bot

@pengbowang-nv
Copy link
Collaborator Author

/bot kill

@tensorrt-cicd
Copy link
Collaborator

PR_Github #16174 [ kill ] triggered by Bot

@tensorrt-cicd
Copy link
Collaborator

PR_Github #16173 [ run ] completed with state ABORTED

@tensorrt-cicd
Copy link
Collaborator

PR_Github #16174 [ kill ] completed with state SUCCESS
Successfully killed previous jobs for commit 960d601

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 (4)
cpp/tensorrt_llm/kernels/decoderMaskedMultiheadAttention/decoderXQAImplJIT/decoderXQAImplJIT.cpp (4)

360-367: Kernel param vector cap raised to 20: consider hardening for future additions.

20 covers current worst cases, but this area is brittle as params evolve across paths. Two optional hardening ideas:

  • Document the maximum param count per path next to this constant for quick validation.
  • Add a small helper wrapper that counts params per path and asserts a safety margin (e.g., >= max + 2), so future additions trip fast.

No blocker; just future-proofing.


396-448: HMMA spec-dec path: align pointer types with GMMA path and assert no multi-block; name warp/thread constants.

  • Types: In GMMA spec-dec, qCuSeqLens/mask are treated as uint32_t-based. Here they are int*. Aligning to uint32_t improves consistency and avoids ambiguity about sign-extension and ABI expectations, even though it’s typically benign at launch time.
  • Multi-block: Since HMMA spec-dec doesn't support multi-block, add a debug assertion to catch accidental enablement.
  • Magic numbers: Replace 128/2 with constexprs to clarify intent and ease future tuning.

Suggested diff:

@@
-        int const* maskPtr = xqaParams.spec_decoding_packed_mask;
-        int const* cuQSeqLens = launchParams.cu_seq_lens;
+        // Keep types consistent with GMMA spec-dec path (uint32_t).
+        auto const* maskPtr = reinterpret_cast<uint32_t const*>(xqaParams.spec_decoding_packed_mask);
+        auto const* cuQSeqLens = reinterpret_cast<uint32_t const*>(launchParams.cu_seq_lens);
@@
-        uint32_t multi_block = 1;
+        uint32_t multi_block = 1;
+        TLLM_CHECK_DEBUG(!xqaParams.multi_block_mode); // HMMA spec-dec kernel does not support multi-block mode.
@@
-        dim3 const blockDim(128, 1, 2);
+        constexpr uint32_t kHMMAThreadsX = 128;
+        constexpr uint32_t kHMMAWarpsZ = 2;
+        dim3 const blockDim(kHMMAThreadsX, 1, kHMMAWarpsZ);

Please also double-check (out of band) that the presence/absence of slidingWindowSize in the parameter list exactly matches the HMMA spec-dec cubin signature for both tree and chained tokens; precompiled kernels can be unforgiving if the signature diverges.


493-494: Guard against zero denominator when computing specDecBlocks.

If num_q_heads_over_kv > 64, (64 / num_q_heads_over_kv) becomes 0, making divUp’s denominator zero. It’s unlikely in practice, but cheap to guard.

-            specDecBlocks = divUp(specDecParams.qSeqLen, 64 / num_q_heads_over_kv);
+            {
+                uint32_t denom = 64U / static_cast<uint32_t>(num_q_heads_over_kv);
+                if (denom == 0U) { denom = 1U; }
+                specDecBlocks = divUp(specDecParams.qSeqLen, denom);
+            }

2-2: Update copyright year.

Guidelines require the current year. Recommend updating the header to include 2025.

- * Copyright (c) 2020-2023, NVIDIA CORPORATION.  All rights reserved.
+ * Copyright (c) 2020-2025, NVIDIA CORPORATION.  All rights reserved.
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 960d601 and 3be2c6a.

📒 Files selected for processing (1)
  • cpp/tensorrt_llm/kernels/decoderMaskedMultiheadAttention/decoderXQAImplJIT/decoderXQAImplJIT.cpp (4 hunks)
🧰 Additional context used
📓 Path-based instructions (4)
**/*.{cpp,cxx,cc,cu,h,hpp,hxx,hh,cuh}

📄 CodeRabbit inference engine (CODING_GUIDELINES.md)

**/*.{cpp,cxx,cc,cu,h,hpp,hxx,hh,cuh}: In C++, close namespaces with a comment naming the namespace (e.g., } // namespace foo)
Prefer const/constexpr variables over #define for constants
Declare variables const if not modified after initialization
Use Allman brace style in C++
C++ filenames use lowerCamelCase and must be case-insensitively unique within a build target
C++ type names use UpperCamelCase
Local variables, methods, and namespaces use lowerCamelCase
Global non-static variables not in anonymous namespace use gPrefix lowerCamelCase (e.g., gExample)
Static globals or globals in anonymous namespaces use sPrefix lowerCamelCase
Locally visible static variables start with 's' (e.g., static std::once_flag sFlag;)
Member variables use mPrefix lowerCamelCase; public members may omit but are encouraged to use 'm'
Constants (enums, global/static/function-scope magic numbers) use kPREFIXED_UPPER_SNAKE (e.g., kDIGIT_NUM)
If macros are unavoidable, use UPPER_SNAKE_CASE (prefer constants over #define)
Constructor parameter that conflicts with a public member name gets trailing underscore (foo_)
Literal suffixes should be uppercase (e.g., 1234L not 1234l)
C++: use spaces only; indent 4 spaces
Run clang-format (LLVM style) before submitting; wrap lines at 120 characters
If formatting must be bypassed, use // clang-format off/on around the section
Prefer smart pointers; use unique_ptr for sole ownership, shared_ptr for shared; weak_ptr only in exceptional cases
Do not use deprecated pre-C++11 smart pointers
Use C++ style comments; avoid C comments except special inline cases; prefer // single-line
Capitalize and punctuate full-sentence comments
Follow Doxygen rules: use //! for comments and //!< for members in C++
Disable code with #if/#endif and mnemonic conditions; avoid commented-out code; avoid dead code
Do not throw exceptions across library boundaries
Use least-forceful casts; avoid removing const/volatile; avoid C-style and functional casts (except constructors); p...

Files:

  • cpp/tensorrt_llm/kernels/decoderMaskedMultiheadAttention/decoderXQAImplJIT/decoderXQAImplJIT.cpp
**/*.{cpp,cxx,cc,cu}

📄 CodeRabbit inference engine (CODING_GUIDELINES.md)

**/*.{cpp,cxx,cc,cu}: Avoid literal values except for 0, nullptr, true, false; use named constexpr for other literals
Place semicolon of empty for/while loop on a new line
Always use brace-delimited bodies for switch/while/do-for/if/else
Use inline C comments in argument lists when parameter meaning is unclear (e.g., /* checkForErrors = */ false)
Do not use assignment in subexpressions (e.g., if (x = y) ... is forbidden)
Switch on enums should enumerate all values and omit default to catch new values at compile time
Structure switch statements; prohibit fallthrough except between empty cases; each case ends with break or throw; return at end of case not allowed; put break inside braces for compound case
Prefer anonymous namespaces over static for internal linkage of functions
Every defined function must be called at least once (no unused methods)

Files:

  • cpp/tensorrt_llm/kernels/decoderMaskedMultiheadAttention/decoderXQAImplJIT/decoderXQAImplJIT.cpp
**/*.{h,hpp,hxx,hh,cuh,cpp,cxx,cc,cu}

📄 CodeRabbit inference engine (CODING_GUIDELINES.md)

Parameter names must be consistent between declarations and definitions

Files:

  • cpp/tensorrt_llm/kernels/decoderMaskedMultiheadAttention/decoderXQAImplJIT/decoderXQAImplJIT.cpp
**/*.{cpp,cxx,cc,cu,h,hpp,hxx,hh,cuh,py}

📄 CodeRabbit inference engine (CODING_GUIDELINES.md)

Prepend NVIDIA copyright header (current year) to all source files

Files:

  • cpp/tensorrt_llm/kernels/decoderMaskedMultiheadAttention/decoderXQAImplJIT/decoderXQAImplJIT.cpp
⏰ 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/kernels/decoderMaskedMultiheadAttention/decoderXQAImplJIT/decoderXQAImplJIT.cpp (3)

212-212: Clear kernel-type detection for Ampere HMMA. LGTM.

Accurately distinguishes HMMA kernels from GMMA/MLA, enabling path-specific handling.


215-221: Spec-dec gating and per-kernel capability checks look correct.

  • Enforces uniform/linear constraints for MLA spec-dec.
  • Debug-time guards tie launch paths to their support checks.

No action needed.


488-488: Spec-dec under non-MLA path enforced to GMMA. LGTM.

This preserves the invariant that GMMA is required for spec-dec in the non-HMMA precompiled path.

@pengbowang-nv
Copy link
Collaborator Author

/bot run --add-multi-gpu-test --disable-fail-fast

@tensorrt-cicd
Copy link
Collaborator

PR_Github #16183 [ run ] triggered by Bot

@pengbowang-nv
Copy link
Collaborator Author

/bot run --add-multi-gpu-test --disable-fail-fast

@tensorrt-cicd
Copy link
Collaborator

PR_Github #16276 [ run ] triggered by Bot

@tensorrt-cicd
Copy link
Collaborator

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

@pengbowang-nv
Copy link
Collaborator Author

/bot run --add-multi-gpu-test --disable-fail-fast

@tensorrt-cicd
Copy link
Collaborator

PR_Github #16311 [ run ] triggered by Bot

@tensorrt-cicd
Copy link
Collaborator

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

@pengbowang-nv
Copy link
Collaborator Author

close as implemented in #6078

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.

2 participants