Skip to content

[https://nvbugs/6168859][fix] move tinygemm PDL release after reduction#14537

Merged
longlee0622 merged 4 commits into
NVIDIA:mainfrom
dongfengy:user/dongfengy/6168859-pdl-fix-clean
May 26, 2026
Merged

[https://nvbugs/6168859][fix] move tinygemm PDL release after reduction#14537
longlee0622 merged 4 commits into
NVIDIA:mainfrom
dongfengy:user/dongfengy/6168859-pdl-fix-clean

Conversation

@dongfengy
Copy link
Copy Markdown
Collaborator

@dongfengy dongfengy commented May 25, 2026

Summary by CodeRabbit

  • Chores
    • Optimized GPU kernel synchronization mechanism for improved computational efficiency.

Review Change Stack

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)

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

@dongfengy dongfengy changed the title [6168859] move tinygemm PDL release after reduction [https://nvbugs/6168859][fix] move tinygemm PDL release after reduction May 25, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 25, 2026

📝 Walkthrough

Walkthrough

The PR relocates a CUDA synchronization call within the tinygemm2 kernel. The cudaTriggerProgrammaticLaunchCompletion() call is removed from the weight-loading data path and repositioned to execute from a single thread after the reduction phase completes and before final output writes.

Changes

Kernel synchronization barrier repositioning

Layer / File(s) Summary
Kernel synchronization barrier repositioning
cpp/tensorrt_llm/kernels/tinygemm2/tinygemm2_kernel.cuh
Removed cudaTriggerProgrammaticLaunchCompletion() from the !weight_warp data-loading conditional block after cudaGridDependencySynchronize(). Added a new single-thread call to cudaTriggerProgrammaticLaunchCompletion() (guarded by threadIdx.x == 0) after __syncthreads() following reduction accumulation and before the warp_id == 0 final output epilogue.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The PR description is incomplete and contains only the empty template without any actual content explaining the changes, rationale, or test coverage. Fill in the Description section explaining what PDL release timing change was made and why, provide Test Coverage details documenting relevant tests, and complete relevant PR checklist items with specifics.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly indicates the specific change: moving the tinygemm PDL release to after the reduction phase, with proper NVBugs ticket reference and fix type.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

Copy link
Copy Markdown
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/tensorrt_llm/kernels/tinygemm2/tinygemm2_kernel.cuh (1)

1-2: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Update the NVIDIA header year.

This file is modified in this PR, so the header should reflect 2026 as the latest meaningful modification year.

As per coding guidelines, "**/*.{cpp,cc,h,hpp,py,cu,cuh}: Include NVIDIA copyright header on ALL new files; update year on modified files."

🤖 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/tinygemm2/tinygemm2_kernel.cuh` around lines 1 - 2,
The copyright header in tinygemm2_kernel.cuh still shows 2025–2025; update the
top-of-file NVIDIA copyright comment to reflect 2026 as the latest modification
year (e.g., change the year range to 2025–2026 or 2026–2026 consistent with
project style) so the file header matches the PR modifications.
🤖 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/tinygemm2/tinygemm2_kernel.cuh`:
- Around line 424-427: The Programmatic Dependent Launch trigger is invoked too
early: move the cudaTriggerProgrammaticLaunchCompletion() call so it executes
after the final global-memory stores performed by the warp_id == 0 path (the
output[...] stores) rather than immediately after filling reduction_buffer and
__syncthreads(); specifically, ensure that
cudaTriggerProgrammaticLaunchCompletion() is placed after the code block that
does the output[...] global writes (so that a dependent that returns from
cudaGridDependencySynchronize() sees the completed stores), keeping the existing
checks (threadIdx.x/warp_id conditions) consistent with the original
synchronization logic.

---

Outside diff comments:
In `@cpp/tensorrt_llm/kernels/tinygemm2/tinygemm2_kernel.cuh`:
- Around line 1-2: The copyright header in tinygemm2_kernel.cuh still shows
2025–2025; update the top-of-file NVIDIA copyright comment to reflect 2026 as
the latest modification year (e.g., change the year range to 2025–2026 or
2026–2026 consistent with project style) so the file header matches the PR
modifications.
🪄 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: 1dd17842-40b1-4cbf-85fe-4cc074c1b8d2

📥 Commits

Reviewing files that changed from the base of the PR and between 63b1d8d and 1e45056.

📒 Files selected for processing (1)
  • cpp/tensorrt_llm/kernels/tinygemm2/tinygemm2_kernel.cuh

Comment thread cpp/tensorrt_llm/kernels/tinygemm2/tinygemm2_kernel.cuh Outdated
@dongfengy dongfengy requested a review from dc3671 May 25, 2026 18:36
@dongfengy
Copy link
Copy Markdown
Collaborator Author

/bot run

@tensorrt-cicd
Copy link
Copy Markdown
Collaborator

PR_Github #50235 [ run ] triggered by Bot. Commit: 1e45056 Link to invocation

@dongfengy
Copy link
Copy Markdown
Collaborator Author

/bot run

@tensorrt-cicd
Copy link
Copy Markdown
Collaborator

PR_Github #50237 [ run ] triggered by Bot. Commit: 53bd57b Link to invocation

@tensorrt-cicd
Copy link
Copy Markdown
Collaborator

PR_Github #50235 [ run ] completed with state ABORTED. Commit: 1e45056

Link to invocation

@tensorrt-cicd
Copy link
Copy Markdown
Collaborator

PR_Github #50237 [ run ] completed with state FAILURE. Commit: 53bd57b
/LLM/main/L0_MergeRequest_PR pipeline #39773 completed with status: 'FAILURE'

CI Report

⚠️ Action Required:

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

CI Agent Failure Analysis

Link to invocation

@longlee0622
Copy link
Copy Markdown
Collaborator

/bot run --disable-fail-fast

@longlee0622 longlee0622 enabled auto-merge (squash) May 26, 2026 01:58
@tensorrt-cicd
Copy link
Copy Markdown
Collaborator

PR_Github #50251 [ run ] triggered by Bot. Commit: 53bd57b Link to invocation

Comment thread cpp/tensorrt_llm/kernels/tinygemm2/tinygemm2_kernel.cuh
@dongfengy
Copy link
Copy Markdown
Collaborator Author

/bot run

@tensorrt-cicd
Copy link
Copy Markdown
Collaborator

PR_Github #50254 [ run ] triggered by Bot. Commit: 6159db5 Link to invocation

@tensorrt-cicd
Copy link
Copy Markdown
Collaborator

PR_Github #50251 [ run ] completed with state ABORTED. Commit: 53bd57b

Link to invocation

@nvpohanh
Copy link
Copy Markdown
Collaborator

should we propagate the fix to FlashInfer ?

@dongfengy
Copy link
Copy Markdown
Collaborator Author

should we propagate the fix to FlashInfer ?

I think so if we want to be on the safe side. Although the issue seems to be only reproducible within TRTLLM. I was not able to create a standalone repro.

@tensorrt-cicd
Copy link
Copy Markdown
Collaborator

PR_Github #50254 [ run ] completed with state SUCCESS. Commit: 6159db5
/LLM/main/L0_MergeRequest_PR pipeline #39788 completed with status: 'FAILURE'

CI Report

⚠️ Action Required:

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

CI Agent Failure Analysis

Link to invocation

@dc3671
Copy link
Copy Markdown
Collaborator

dc3671 commented May 26, 2026

/bot run --disable-fail-fast

@tensorrt-cicd
Copy link
Copy Markdown
Collaborator

PR_Github #50299 [ run ] triggered by Bot. Commit: 6159db5 Link to invocation

@tensorrt-cicd
Copy link
Copy Markdown
Collaborator

PR_Github #50299 [ run ] completed with state FAILURE. Commit: 6159db5
/LLM/main/L0_MergeRequest_PR pipeline #39829 completed with status: 'FAILURE'

CI Report

⚠️ Action Required:

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

CI Agent Failure Analysis

Link to invocation

dongfengy and others added 4 commits May 26, 2026 08:07
Signed-off-by: Dongfeng Yu <dongfengy@nvidia.com>
Signed-off-by: Dongfeng Yu <dongfengy@nvidia.com>
Signed-off-by: dongfengy <99041270+dongfengy@users.noreply.github.com>
Signed-off-by: dongfengy <99041270+dongfengy@users.noreply.github.com>
@dongfengy dongfengy force-pushed the user/dongfengy/6168859-pdl-fix-clean branch from 6159db5 to cbb1b08 Compare May 26, 2026 15:07
@dongfengy
Copy link
Copy Markdown
Collaborator Author

/bot run --disable-fail-fast

@tensorrt-cicd
Copy link
Copy Markdown
Collaborator

PR_Github #50357 [ run ] triggered by Bot. Commit: cbb1b08 Link to invocation

@tensorrt-cicd
Copy link
Copy Markdown
Collaborator

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

CI Report

Link to invocation

@longlee0622 longlee0622 merged commit ba25b6a into NVIDIA:main May 26, 2026
7 checks passed
bmarimuthu-nv pushed a commit to nv-auto-deploy/TensorRT-LLM that referenced this pull request May 28, 2026
…on (NVIDIA#14537)

Signed-off-by: Dongfeng Yu <dongfengy@nvidia.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.

5 participants