Skip to content

[JAX] Fall back from the V2 grouped GEMM on Hopper below cuBLAS 13.4 - #3923

Merged
tdophung merged 2 commits into
NVIDIA:mainfrom
tdophung:te-jax-v2-gemm-hopper-cublas
Nov 24, 2026
Merged

tdophung merged 2 commits into
NVIDIA:mainfrom
tdophung:te-jax-v2-gemm-hopper-cublas

Conversation

@tdophung

@tdophung tdophung commented Nov 23, 2026 •

Copy link
Copy Markdown
Collaborator

Description

On Hopper, nvte_grouped_gemm needs cuBLAS 13.4+ (check_grouped_gemm_requirements in cublaslt_grouped_gemm.cu). The JAX router _is_v2_grouped_gemm_supported only checks that TE was built with the V2 kernel and that the GPU is SM90+. So with cuBLAS 13.3 on Hopper, BF16 grouped GEMM is sent to the V2 kernel and fails at run time, even though the legacy grouped GEMM handles it fine. This came up in #3908's review.

This PR makes the router decline the V2 kernel on SM90 when the run-time cuBLAS is older than 13.4, so those calls take the legacy path. With NVTE_JAX_ENFORCE_V2_GROUPED_GEMM=1, the error now says why. Blackwell, and Hopper with cuBLAS 13.4+, are unchanged.

Type of change

  • Documentation change (change only to the documentation, either a fix or a new content)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Infra/Build change
  • Code refactoring

Changes

  • transformer_engine/jax/cpp_extensions/gemm.py: _is_v2_grouped_gemm_supported returns unsupported on SM90 below cuBLAS 13.4.
  • tests/jax/test_custom_call_compute.py: test_v2_grouped_gemm_hopper_cublas checks the decision with a mocked compute capability and cuBLAS version.

Checklist:

  • I have read and followed the contributing guidelines
  • The functionality is complete
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

Signed-off-by: Teddy Do <tdophung@nvidia.com>
@tdophung

Copy link
Copy Markdown
Collaborator Author

/te-ci L1 jax

@greptile-apps greptile-apps Bot mentioned this pull request Nov 23, 2026
6 of 13 tasks
@tdophung
tdophung marked this pull request as ready for review November 23, 2026 23:58
@greptile-apps

greptile-apps Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge.

Summary

Adds a runtime cuBLAS check before JAX selects V2 grouped GEMM on Hopper.

  • Hopper grouped GEMM avoids V2 when cuBLAS is too old.

Reviews (1) · Last reviewed commit: "Merge branch 'main' into te-jax-v2-gemm-..." · Reviewed by Greptile

@tdophung
tdophung merged commit 7edef2c into NVIDIA:main Nov 24, 2026
14 checks passed
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