Skip to content

[None][perf] Allow CUDA-core NVFP4 GEMM for M up to 16#16345

Open
mihai-chiorean wants to merge 1 commit into
NVIDIA:mainfrom
mihai-chiorean:codex/cudacore-nvfp4-m16
Open

[None][perf] Allow CUDA-core NVFP4 GEMM for M up to 16#16345
mihai-chiorean wants to merge 1 commit into
NVIDIA:mainfrom
mihai-chiorean:codex/cudacore-nvfp4-m16

Conversation

@mihai-chiorean

@mihai-chiorean mihai-chiorean commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Increase CUDA-core NVFP4 GEMM autotuner eligibility from M <= 8 to M <= 16, matching the C++ cudaCoreGemmTemplateMaxM limit.
  • Update CUDA-core NVFP4 docs/errors and unit coverage for the M=16 case.
  • This does not force CUDA-core selection: CUTLASS/cuBLASLt remain available for larger shapes, and cuda_core-only configurations still fail fast when a shape exceeds CUDA-core support.

Performance

Spark SM121, Qwen3.6 35B A3B NVFP4, no-MTP graph+overlap smoke:

  • Baseline: 37.270 ms TPOT / 26.831 tok/s
  • M<=16 temp patch: 33.501 ms TPOT / 29.850 tok/s
  • Repeat M<=16 temp patch: 33.565 ms TPOT / 29.793 tok/s

Testing

  • uvx pre-commit run --files tensorrt_llm/_torch/custom_ops/torch_custom_ops.py tests/unittest/_torch/thop/parallel/test_fp4_linear.py
  • Spark SM121: pytest -q tests/unittest/_torch/thop/parallel/test_fp4_linear.py -k test_fp4_linear_cuda_core via TensorRT bindings bootstrap: 4 passed
  • Spark SM121: pytest -q tests/unittest/_torch/thop/parallel/test_fp4_linear.py -k "test_fp4_gemm_bias_per_backend and cuda_core" via TensorRT bindings bootstrap: 1 passed, 3 skipped

Summary by CodeRabbit

  • New Features

    • Expanded CUDA Core NVFP4 GEMM support for small-batch workloads with matrix dimension M up to 16.
  • Bug Fixes

    • Updated FP4 GEMM validation to correctly allow supported M=16 workloads and bias parity checks.

Signed-off-by: Mihai Chiorean <mihai.v.chiorean@gmail.com>
@mihai-chiorean mihai-chiorean requested a review from a team as a code owner July 13, 2026 23:30
@mihai-chiorean mihai-chiorean requested a review from hyukn July 13, 2026 23:30
@coderabbitai

coderabbitai Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 7d6dff96-9a11-42a9-857d-32eb73dfb0fa

📥 Commits

Reviewing files that changed from the base of the PR and between 54d484f and 8e5cce1.

📒 Files selected for processing (2)
  • tensorrt_llm/_torch/custom_ops/torch_custom_ops.py
  • tests/unittest/_torch/thop/parallel/test_fp4_linear.py

📝 Walkthrough

Walkthrough

CUDA Core NVFP4 GEMM eligibility is expanded from M ≤ 8 to M ≤ 16. Runtime documentation, the shape limit, and FP4 linear tests are updated to cover the larger dimension.

Changes

NVFP4 CUDA Core eligibility

Layer / File(s) Summary
Expand CUDA Core limit and validation
tensorrt_llm/_torch/custom_ops/torch_custom_ops.py, tests/unittest/_torch/thop/parallel/test_fp4_linear.py
The CUDA Core limit and GEMM documentation now specify M <= 16; tests add M=16 coverage and relax the bias parity skip threshold.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested reviewers: hyukn, bo-nv, xuantengh, pengbowang-nv, nv-guomingz

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 75.00% 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
Title check ✅ Passed The title matches the repository template and clearly summarizes the main change to CUDA-core NVFP4 GEMM eligibility.
Description check ✅ Passed The description follows the template well with summary, performance, and testing sections that explain what changed and how it was verified.
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.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

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.

1 participant