Skip to content

[None][perf] Fold q/k/v quantization into qknorm_rope_fused kernel & remove contiguous - #17093

Open
brb-nv wants to merge 1 commit into
NVIDIA:mainfrom
brb-nv:user/brb/fold-qkv-quant-qknorm-rope-main
Open

[None][perf] Fold q/k/v quantization into qknorm_rope_fused kernel & remove contiguous#17093
brb-nv wants to merge 1 commit into
NVIDIA:mainfrom
brb-nv:user/brb/fold-qkv-quant-qknorm-rope-main

Conversation

@brb-nv

@brb-nv brb-nv commented Jul 31, 2026

Copy link
Copy Markdown
Collaborator

Description

This MR does the following:

  • Folds q/k/v quantization into fused qk norm + rope kernel.
  • Removes .contiguous() calls on main q/k as well as index q/k.

Test Coverage

$ pytest tests/integration/defs/accuracy/test_llm_api_pytorch.py::TestMiniMaxM3::test_nvfp4[use_msa=True-eval_mode=default] -s -v

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)

  • If PR introduces API changes, an appropriate PR label is added - either api-compatible or api-breaking. For api-breaking, include BREAKING in the PR title.

  • Any new dependencies have been scanned for license and vulnerabilities

  • CODEOWNERS updated if ownership changes

  • Documentation updated as needed

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

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

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

GitHub Bot Help

To see a list of available CI bot commands, please comment /bot help.

Overview

  • Added out-of-place BF16 and FP8 E4M3 output support to fused QK normalization and RoPE.
  • Added fused_qk_norm_rope_to_fp8 with CUDA and Meta implementations.
  • Updated MiniMax-M3 attention to support FP8 KV caches.
  • Replaced view with reshape for strided tensor handling.
  • Added parameterized FP8 correctness tests.

Dev Engineer Review

  • The kernel now supports templated BF16 and FP8 E4M3 output storage.
  • launchFusedQKNormRopeOut provides out-of-place QKV processing with optional V conversion.
  • The operator validates BF16 inputs and preserves the input tensor.
  • MiniMax-M3 selects FP8 or BF16 behavior based on the backend and KV-cache dtype.
  • The reshape changes support strided views and avoid unnecessary copies.
  • No configuration or test-list files changed.
  • Review risk is high because kernel launch sizing, head indexing, output layout, and FP8 conversion changed together.
  • Verify API consistency, error handling, performance, and compliance with CODING_GUIDELINES.md.

QA Engineer Review

  • Added parameterized coverage for the out-of-place FP8 fused QK normalization and RoPE path.
  • Coverage includes multiple sequence lengths, GQA head configurations, rotary modes, and partial rotary dimensions.
  • The test verifies FP8 E4M3 output shape and dtype, unchanged BF16 input, and dequantized agreement with the BF16 reference.
  • No tests/integration/test_lists/ entries changed.
  • CI or manual QA coverage is not established from the available changes.
  • Verdict: needs follow-up.

@brb-nv
brb-nv force-pushed the user/brb/fold-qkv-quant-qknorm-rope-main branch from 60af8fe to be54863 Compare August 1, 2026 20:14
@brb-nv
brb-nv marked this pull request as ready for review August 1, 2026 20:16
@brb-nv
brb-nv requested review from a team as code owners August 1, 2026 20:16
@coderabbitai

coderabbitai Bot commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

Changes

The fused QK normalization and RoPE kernel now supports out-of-place BF16 or FP8 E4M3 output, including optional V conversion. A Torch operator exposes the FP8 path. MiniMax-M3 attention selects it for supported FP8 KV-cache configurations and preserves backend-specific tensor layouts. Tests cover parameterized FP8 behavior.

FP8 fused kernel and public API

Layer / File(s) Summary
Templated fused kernel and public API
cpp/tensorrt_llm/kernels/fusedQKNormRopeKernel.cu, cpp/tensorrt_llm/kernels/fusedQKNormRopeKernel.h
The kernel reads separate BF16 input and output buffers, stores BF16 or FP8 E4M3 values, optionally processes V heads, and updates head indexing and launch sizing. A public out-of-place launcher is added.
FP8 Torch operator and Meta registration
cpp/tensorrt_llm/thop/fusedQKNormRopeOp.cpp
The new operator validates BF16 QKV inputs, allocates FP8 output, launches the CUDA kernel, and registers CUDA and Meta implementations.
MiniMax-M3 FP8 attention integration
tensorrt_llm/_torch/models/modeling_minimaxm3.py, tensorrt_llm/_torch/attention_backend/fmha/msa_sparse_gqa.py, tensorrt_llm/_torch/attention_backend/sparse/minimax_m3/msa_backend.py
MiniMax-M3 detects FP8 KV-cache use, selects FP8 fused output when supported, preserves strided MSA views, uses contiguous tensors for other backends, and allocates attention outputs with the configured activation dtype.
FP8 output validation
tests/unittest/_torch/thop/parallel_hw_agnostic/test_fused_qk_norm_rope.py
Parameterized tests verify FP8 E4M3 shape and dtype, unchanged BF16 input, out-of-place behavior, and agreement with the BF16 reference after dequantization.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant MiniMaxM3Attention
  participant fused_qk_norm_rope_to_fp8
  participant fusedQKNormRopeKernel
  participant FP8KVCache
  MiniMaxM3Attention->>fused_qk_norm_rope_to_fp8: request FP8 fused QKV output
  fused_qk_norm_rope_to_fp8->>fusedQKNormRopeKernel: validate inputs and launch kernel
  fusedQKNormRopeKernel->>FP8KVCache: write FP8 E4M3 Q, K, and V
  FP8KVCache-->>MiniMaxM3Attention: return FP8 QKV tensors
Loading

Suggested labels: api-compatible

Suggested reviewers: perkzzheng, yuxianq, schetlur-nv

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 73.33% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly summarizes the main changes: folding Q/K/V quantization into the fused kernel and removing contiguous calls.
Description check ✅ Passed The description explains the changes, identifies test coverage, and includes the required checklist with all template sections.
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick comments (4)
tensorrt_llm/_torch/models/modeling_minimaxm3.py (1)

991-1023: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Use built-in generic types in the new return annotations.

Replace Tuple[...] with tuple[...] in both helper signatures. The project guidelines prefer built-in generic types.

Proposed change
-    ) -> Tuple[torch.Tensor, torch.Tensor, torch.Tensor]:
+    ) -> tuple[torch.Tensor, torch.Tensor, torch.Tensor]:
...
-    def _split_index_qk(self, fused_idx: torch.Tensor) -> Tuple[torch.Tensor, torch.Tensor]:
+    def _split_index_qk(self, fused_idx: torch.Tensor) -> tuple[torch.Tensor, torch.Tensor]:
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tensorrt_llm/_torch/models/modeling_minimaxm3.py` around lines 991 - 1023,
Update the return annotations of _split_main_qkv and _split_index_qk to use the
built-in tuple[...] generic instead of Tuple[...], preserving the existing
tensor element types and method behavior.

Source: Coding guidelines

tests/unittest/_torch/thop/parallel_hw_agnostic/test_fused_qk_norm_rope.py (1)

347-351: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Use a private UPPER_SNAKE_CASE constant.

fp8_num_heads_groups is a module-level non-public constant. Rename it to _FP8_NUM_HEADS_GROUPS. Prefer a tuple to prevent mutation.

As per coding guidelines, “use … UPPER_SNAKE_CASE for constants” and “Prefix non-public names with _.”

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tests/unittest/_torch/thop/parallel_hw_agnostic/test_fused_qk_norm_rope.py`
around lines 347 - 351, Rename the module-level constant fp8_num_heads_groups to
_FP8_NUM_HEADS_GROUPS and change its collection type from list to tuple,
updating all references accordingly while preserving the existing head-group
values.

Source: Coding guidelines

cpp/tensorrt_llm/thop/fusedQKNormRopeOp.cpp (1)

92-138: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Extract shared input validation to avoid duplicated checks.

The validation block in fused_qk_norm_rope_to_fp8 (dim checks, position_ids shape, weight shape, CHECK_INPUT calls, total_heads * head_dim check) duplicates the block in fused_qk_norm_rope (Lines 57-77) almost verbatim. Extract a shared private helper that both functions call, so a future validation fix does not need to land in two places.

♻️ Proposed refactor sketch
namespace
{
int64_t validateFusedQKNormRopeInputs(torch::Tensor const& qkv, torch::Tensor const& position_ids,
    torch::Tensor const& q_weight, torch::Tensor const& k_weight, int64_t num_heads_q, int64_t num_heads_k,
    int64_t num_heads_v, int64_t head_dim, bool use_mrope)
{
    TORCH_CHECK(qkv.dim() == 2, "QKV tensor must be 2D: [num_tokens, (num_heads_q+num_heads_k+num_heads_v)*head_dim]");
    TORCH_CHECK(position_ids.dim() == 1 || (position_ids.dim() == 2 && position_ids.size(0) == 3),
        "Position IDs must be 1D [num_tokens] (plain RoPE) or 2D [3, num_tokens] (mRoPE)");
    TORCH_CHECK(!use_mrope || position_ids.dim() == 2, "use_mrope requires 2D [3, num_tokens] position_ids");
    TORCH_CHECK(q_weight.dim() == 1, "Query weights must be 1D: [head_dim]");
    TORCH_CHECK(k_weight.dim() == 1, "Key weights must be 1D: [head_dim]");
    TORCH_CHECK(q_weight.size(0) == head_dim, "Query weights size must match head dimension");
    TORCH_CHECK(k_weight.size(0) == head_dim, "Key weights size must match head dimension");

    CHECK_INPUT(qkv, torch::kBFloat16);
    CHECK_INPUT(position_ids, torch::kInt32);
    CHECK_INPUT(q_weight, torch::kBFloat16);
    CHECK_INPUT(k_weight, torch::kBFloat16);

    int64_t num_tokens = qkv.size(0);
    TORCH_CHECK(position_ids.size(-1) == num_tokens, "Number of tokens in position_ids must match QKV");

    int64_t total_heads = num_heads_q + num_heads_k + num_heads_v;
    TORCH_CHECK(
        qkv.size(1) == total_heads * head_dim, "QKV tensor size must match total number of heads and head dimension");
    return num_tokens;
}
} // namespace

Both fused_qk_norm_rope and fused_qk_norm_rope_to_fp8 would call this helper instead of repeating the checks.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@cpp/tensorrt_llm/thop/fusedQKNormRopeOp.cpp` around lines 92 - 138, Extract
the duplicated validation from fused_qk_norm_rope and fused_qk_norm_rope_to_fp8
into a shared private validateFusedQKNormRopeInputs helper. Move all dimension,
shape, dtype, token-count, and total-head checks into that helper, have both
functions call it, and reuse its returned token count while preserving the
existing validation behavior and messages.
cpp/tensorrt_llm/kernels/fusedQKNormRopeKernel.cu (1)

435-472: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Add coverage for the BF16 out-of-place path or remove it.

The only in-tree caller passes out_fp8=true and process_v=true. No repository call site exercises out_fp8=false, process_v=true; add a BF16 out-of-place operation and test, or remove this unused branch.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@cpp/tensorrt_llm/kernels/fusedQKNormRopeKernel.cu` around lines 435 - 472,
The launchFusedQKNormRopeOut branch for out_fp8=false and process_v=true lacks
repository coverage. Add a BF16 out-of-place caller and test that exercises this
combination, or remove the unsupported unused branch while preserving the
existing FP8 path and other valid behavior.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@cpp/tensorrt_llm/kernels/fusedQKNormRopeKernel.cu`:
- Around line 435-472: The launchFusedQKNormRopeOut branch for out_fp8=false and
process_v=true lacks repository coverage. Add a BF16 out-of-place caller and
test that exercises this combination, or remove the unsupported unused branch
while preserving the existing FP8 path and other valid behavior.

In `@cpp/tensorrt_llm/thop/fusedQKNormRopeOp.cpp`:
- Around line 92-138: Extract the duplicated validation from fused_qk_norm_rope
and fused_qk_norm_rope_to_fp8 into a shared private
validateFusedQKNormRopeInputs helper. Move all dimension, shape, dtype,
token-count, and total-head checks into that helper, have both functions call
it, and reuse its returned token count while preserving the existing validation
behavior and messages.

In `@tensorrt_llm/_torch/models/modeling_minimaxm3.py`:
- Around line 991-1023: Update the return annotations of _split_main_qkv and
_split_index_qk to use the built-in tuple[...] generic instead of Tuple[...],
preserving the existing tensor element types and method behavior.

In `@tests/unittest/_torch/thop/parallel_hw_agnostic/test_fused_qk_norm_rope.py`:
- Around line 347-351: Rename the module-level constant fp8_num_heads_groups to
_FP8_NUM_HEADS_GROUPS and change its collection type from list to tuple,
updating all references accordingly while preserving the existing head-group
values.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 8b8c8f48-b47b-4c79-b3ea-31c92b6b08de

📥 Commits

Reviewing files that changed from the base of the PR and between fdf7bd5 and be54863.

📒 Files selected for processing (7)
  • cpp/tensorrt_llm/kernels/fusedQKNormRopeKernel.cu
  • cpp/tensorrt_llm/kernels/fusedQKNormRopeKernel.h
  • cpp/tensorrt_llm/thop/fusedQKNormRopeOp.cpp
  • tensorrt_llm/_torch/attention_backend/fmha/msa_sparse_gqa.py
  • tensorrt_llm/_torch/attention_backend/sparse/minimax_m3/msa_backend.py
  • tensorrt_llm/_torch/models/modeling_minimaxm3.py
  • tests/unittest/_torch/thop/parallel_hw_agnostic/test_fused_qk_norm_rope.py

@pcastonguay

Copy link
Copy Markdown
Collaborator

@brb-nv can we have a proper title and description? If it's not ready, please mark as Draft. THanks.

…remove contiguous (NVIDIA#16699)

Signed-off-by: Balaram Buddharaju <169953907+brb-nv@users.noreply.github.com>
@brb-nv
brb-nv force-pushed the user/brb/fold-qkv-quant-qknorm-rope-main branch from be54863 to 2a0c68e Compare August 3, 2026 23:07
@brb-nv brb-nv changed the title User/brb/fold qkv quant qknorm rope main [None][perf] Fold q/k/v quantization into qknorm_rope_fused kernel & remove contiguous Aug 3, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (2)
cpp/tensorrt_llm/kernels/fusedQKNormRopeKernel.cu (2)

143-145: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Add braces to the changed control-flow bodies.

Use braces for the token bounds check and the default switch case.

Proposed fix
-    if (tokenIdx >= num_tokens)
-        return;
+    if (tokenIdx >= num_tokens)
+    {
+        return;
+    }
...
-    default: TLLM_THROW("Unsupported head dimension for fusedQKNormRope: %d", head_dim);
+    default:
+    {
+        TLLM_THROW("Unsupported head dimension for fusedQKNormRope: %d", head_dim);
+    }

As per coding guidelines, “use Allman braces” and “braced control-flow bodies.”

Also applies to: 431-432

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@cpp/tensorrt_llm/kernels/fusedQKNormRopeKernel.cu` around lines 143 - 145,
Update the token bounds check near the warp token handling to use Allman-style
braces around its early-return body, and apply the same braced format to the
switch statement’s default case. Leave the existing control-flow behavior
unchanged.

Source: Coding guidelines


442-446: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Use static_cast for void* conversions.

These conversions start from void* or void const*. Use static_cast for them. Keep reinterpret_cast only where representation reinterpretation is required.

Proposed fix
-    launchFusedQKNormRopeImpl<__nv_bfloat16>(reinterpret_cast<__nv_bfloat16 const*>(qkv),
-        reinterpret_cast<__nv_bfloat16*>(qkv), /*process_v=*/false, num_tokens, num_heads_q, num_heads_k, num_heads_v,
+    launchFusedQKNormRopeImpl<__nv_bfloat16>(static_cast<__nv_bfloat16 const*>(qkv),
+        static_cast<__nv_bfloat16*>(qkv), /*process_v=*/false, num_tokens, num_heads_q, num_heads_k, num_heads_v,
...
-    auto const* in = reinterpret_cast<__nv_bfloat16 const*>(qkv_in);
+    auto const* in = static_cast<__nv_bfloat16 const*>(qkv_in);

As per coding guidelines, “use static_cast from void*.”

Also applies to: 455-469

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@cpp/tensorrt_llm/kernels/fusedQKNormRopeKernel.cu` around lines 442 - 446,
Update the QKV pointer conversions in the launchFusedQKNormRopeImpl calls around
the shown code and the corresponding lines at 455–469: replace reinterpret_cast
conversions from void* or void const* with static_cast, while preserving
reinterpret_cast only for conversions that require representation
reinterpretation.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@cpp/tensorrt_llm/kernels/fusedQKNormRopeKernel.cu`:
- Around line 371-377: Validate rotary_dim in launchFusedQKNormRopeImpl before
calculating launch dimensions or dispatching the kernel, rejecting values less
than 1 or greater than head_dim while preserving the existing evenness
validation. Ensure invalid values cannot reach RoPE frequency calculation or
kernel launch.

---

Nitpick comments:
In `@cpp/tensorrt_llm/kernels/fusedQKNormRopeKernel.cu`:
- Around line 143-145: Update the token bounds check near the warp token
handling to use Allman-style braces around its early-return body, and apply the
same braced format to the switch statement’s default case. Leave the existing
control-flow behavior unchanged.
- Around line 442-446: Update the QKV pointer conversions in the
launchFusedQKNormRopeImpl calls around the shown code and the corresponding
lines at 455–469: replace reinterpret_cast conversions from void* or void const*
with static_cast, while preserving reinterpret_cast only for conversions that
require representation reinterpretation.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 63421f10-2851-4fde-b98a-74282933f119

📥 Commits

Reviewing files that changed from the base of the PR and between be54863 and 2a0c68e.

📒 Files selected for processing (7)
  • cpp/tensorrt_llm/kernels/fusedQKNormRopeKernel.cu
  • cpp/tensorrt_llm/kernels/fusedQKNormRopeKernel.h
  • cpp/tensorrt_llm/thop/fusedQKNormRopeOp.cpp
  • tensorrt_llm/_torch/attention_backend/fmha/msa_sparse_gqa.py
  • tensorrt_llm/_torch/attention_backend/sparse/minimax_m3/msa_backend.py
  • tensorrt_llm/_torch/models/modeling_minimaxm3.py
  • tests/unittest/_torch/thop/parallel_hw_agnostic/test_fused_qk_norm_rope.py
🚧 Files skipped from review as they are similar to previous changes (6)
  • cpp/tensorrt_llm/kernels/fusedQKNormRopeKernel.h
  • tests/unittest/_torch/thop/parallel_hw_agnostic/test_fused_qk_norm_rope.py
  • tensorrt_llm/_torch/attention_backend/sparse/minimax_m3/msa_backend.py
  • tensorrt_llm/_torch/attention_backend/fmha/msa_sparse_gqa.py
  • tensorrt_llm/_torch/models/modeling_minimaxm3.py
  • cpp/tensorrt_llm/thop/fusedQKNormRopeOp.cpp

Comment on lines +371 to +377
template <typename OutT>
static void launchFusedQKNormRopeImpl(__nv_bfloat16 const* qkv_in, OutT* qkv_out, bool const process_v,
int const num_tokens, int const num_heads_q, int const num_heads_k, int const num_heads_v, int const head_dim,
int const rotary_dim, float const eps, __nv_bfloat16 const* q_weight, __nv_bfloat16 const* k_weight,
float const base, bool const interleave, int const* position_ids, float factor, float low, float high,
float attention_factor, cudaStream_t stream, bool is_qk_norm, bool use_gemma, bool use_mrope, int mrope_section1,
int mrope_section2)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Validate rotary_dim before dispatch.

The FP8 operator checks tensor shapes but does not constrain rotary_dim. A value of 0 passes the existing evenness check and then causes division by zero during RoPE frequency calculation. A value greater than head_dim also violates the kernel pairing assumptions. Reject values outside 1..head_dim before calculating launch dimensions.

Proposed fix
-    TLLM_CHECK_WITH_INFO(rotary_dim % 2 == 0, "rotary_dim must be even");
+    TLLM_CHECK_WITH_INFO(
+        rotary_dim > 0 && rotary_dim <= head_dim && rotary_dim % 2 == 0,
+        "rotary_dim must be positive, no greater than head_dim, and even");
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@cpp/tensorrt_llm/kernels/fusedQKNormRopeKernel.cu` around lines 371 - 377,
Validate rotary_dim in launchFusedQKNormRopeImpl before calculating launch
dimensions or dispatching the kernel, rejecting values less than 1 or greater
than head_dim while preserving the existing evenness validation. Ensure invalid
values cannot reach RoPE frequency calculation or kernel launch.

@brb-nv

brb-nv commented Aug 3, 2026

Copy link
Copy Markdown
Collaborator Author

/bot run --disable-fail-fast

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #63577 [ run ] triggered by Bot. Commit: 2a0c68e Link to invocation

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