Skip to content

Commit 85d269c

Browse files
committed
Restrict PTX 88 to sm_121 for CUDA 12.9+
PTX version 88 breaks other configurations with CUDA 12.9. This change ensures PTX 88 is only used for GB10/sm_121 (DGX Spark), while other architectures use the safer PTX 87. Co-Authored-By: Hari Sadasivan <hsadasivan@nvidia.com>
1 parent f61900d commit 85d269c

1 file changed

Lines changed: 14 additions & 2 deletions

File tree

cuequivariance_jax/cuequivariance_jax/triangle/triton_utils.py

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,11 +87,12 @@
8787
}
8888

8989
_PTXAS_VERSION_CACHE = None
90+
_CUDA_VERSION_CACHE = None
9091

9192

9293
def _get_max_ptx_version():
9394
"""Detects the maximum PTX version supported by the available ptxas."""
94-
global _PTXAS_VERSION_CACHE
95+
global _PTXAS_VERSION_CACHE, _CUDA_VERSION_CACHE
9596
if _PTXAS_VERSION_CACHE is not None:
9697
return _PTXAS_VERSION_CACHE
9798

@@ -105,10 +106,11 @@ def _get_max_ptx_version():
105106
match = re.search(r"release (\d+)\.(\d+)", result.stdout)
106107
if match:
107108
major, minor = int(match.group(1)), int(match.group(2))
109+
_CUDA_VERSION_CACHE = (major, minor)
108110
# Map CUDA version to PTX version
109111
if major == 12:
110112
if minor >= 9:
111-
version = 87 # 88 breaks some triton tests
113+
version = 87 # 88 only for sm_121 (GB10/DGX Spark)
112114
elif minor >= 8:
113115
version = 87
114116
elif minor >= 5:
@@ -166,6 +168,16 @@ def _compile_triton(
166168
# Detect maximum supported PTX version
167169
max_ptx_version = _get_max_ptx_version()
168170

171+
# For CUDA 12.9+, use PTX 88 only for sm_121 (GB10/DGX Spark)
172+
# PTX 88 breaks other configurations
173+
if (
174+
_CUDA_VERSION_CACHE
175+
and _CUDA_VERSION_CACHE[0] == 12
176+
and _CUDA_VERSION_CACHE[1] >= 9
177+
and compute_capability == 121
178+
):
179+
max_ptx_version = 88
180+
169181
# Base options supported by all Triton versions
170182
cuda_options_kwargs = {
171183
"num_warps": num_warps,

0 commit comments

Comments
 (0)