Skip to content

[None][fix] Gate MoE BF16 to FP8 conversion on compiler support - #15934

Open
waynehacking8 wants to merge 1 commit into
NVIDIA:mainfrom
waynehacking8:wayne/fix-sm120-moe-a2a-cvt-build
Open

waynehacking8 wants to merge 1 commit into
NVIDIA:mainfrom
waynehacking8:wayne/fix-sm120-moe-a2a-cvt-build

Conversation

@waynehacking8

@waynehacking8 waynehacking8 commented Jul 4, 2026 •

Copy link
Copy Markdown

Description

CUDA 13.0 rejects the packed BF16 to FP8 conversion in moeAlltoAllKernels.cu with Unexpected instruction types specified for cvt. The instruction was introduced in PTX 9.1, so an architecture check alone is insufficient.

Require CUDA 13.1 and an architecture or family specific Blackwell target for this specialization. Other builds use the existing conversion through float. This also preserves the packed conversion on SM120f with CUDA 13.1.

Test Coverage

Compiled the current translation unit with its current headers and explicit family code generation flags:

Compiler and target Main This change
CUDA 13.0.88, SM120f ptxas error Pass
CUDA 13.1.115, SM120f Pass Pass

The patched translation unit also compiles for SM100f with CUDA 13.0.88. The CUDA 13.1 SM120f PTX retains the packed BF16 conversion.

These checks cover compilation and specialization selection. Full library linking and distributed inference were not rerun.

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.

Dev Engineer Review

The packed BF16-to-FP8 conversion now requires CUDA 13.1 and the required Blackwell target features. CUDA 13.0 builds use the existing float-path conversion, preventing ptxas failures on SM100f and SM120f. No API changes were made.

QA Engineer Review

No test changes.

Per-File QA Perspective

  • cpp/tensorrt_llm/kernels/moe/communication/moeAlltoAllKernels.cu: Verify CUDA 13.0 compilation on SM100f and SM120f, and CUDA 13.1 compilation on SM120f. Full library linking and distributed inference were not rerun.

@coderabbitai

coderabbitai Bot commented Jul 4, 2026 •

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: NVIDIA/TensorRT-LLM/.coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: e52fd97b-44ff-4f3e-be31-4246e4d4ca49

📥 Commits

Reviewing files that changed from the base of the PR and between eab3a90 and 337e9dd.

📒 Files selected for processing (1)
  • cpp/tensorrt_llm/kernels/moe/communication/moeAlltoAllKernels.cu

Included review availability: Your plan provides up to 12 included reviews per hour; 11 remain after this review.

Walkthrough

The BF16-to-FP8 PTX conversion specialization now compiles only for CUDA 13.1+ Blackwell-specific SM100 targets.

Changes

Architecture guard fix

Layer / File(s) Summary
Restrict specialization to CUDA 13.1+ Blackwell targets
cpp/tensorrt_llm/kernels/moe/communication/moeAlltoAllKernels.cu
The BF16-to-FP8 PTX conversion specialization now requires CUDA 13.1+ and Blackwell-specific compilation targets.

Priority: ⬇️ Low

Estimated code review effort: 1 (Trivial) | ~5 minutes

Change: Bug fix

Suggested reviewers: juney-nvidia

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 6 functions across 2 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed 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 follows the required format and clearly describes gating MoE BF16-to-FP8 conversion on compiler support.
Description check Passed The description explains the CUDA 13.0 failure, the CUDA 13.1 and Blackwell guard, fallback behavior, test coverage, and test limitations. It includes the required sections and checklist.
  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR

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

@sunnyqgg sunnyqgg left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

@waynehacking8
waynehacking8 force-pushed the wayne/fix-sm120-moe-a2a-cvt-build branch from 113a838 to eab3a90 Compare August 25, 2026 01:57
@coderabbitai

coderabbitai Bot commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

Use the existing float conversion before CUDA 13.1 and for targets without architecture or family features. Keep the packed conversion on supported Blackwell targets.

Signed-off-by: WEI CHENG CHIU <[email protected]>
@waynehacking8 waynehacking8 changed the title [None][fix] Exclude SM12x from bf16x2 FP8 cvt specialization in moe_a2a [None][fix] Gate MoE BF16 to FP8 conversion on compiler support Sep 20, 2026
@waynehacking8

Copy link
Copy Markdown
Author

Rebuilt this on current main in 337e9dd. CUDA 13.0 also rejects this instruction on SM100f, so the guard now checks CUDA 13.1 and target features instead of permanently excluding SM12x. The current translation unit builds for SM100f and SM120f with CUDA 13.0, while SM120f with CUDA 13.1 retains the packed conversion.

@waynehacking8
waynehacking8 force-pushed the wayne/fix-sm120-moe-a2a-cvt-build branch from eab3a90 to 337e9dd Compare September 20, 2026 11:19
@waynehacking8

Copy link
Copy Markdown
Author

@sunnyqgg the guard changed after your approval: since 337e9dd it checks CUDA 13.1 and the target features instead of excluding SM12x (details in my comment above). Could you take another look?

This branch has not been deployed

No deployments
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