Skip to content

Commit fc5babd

Browse files
authored
Add pathfinder.locate_nvidia_header_directory support for mathdx, cutlass, cute (#1816)
* Add nvidia-libmathdx-cu13 in cuda_pathfinder/pyproject.toml * Remove cufftMp, mathdx from _is_expected_load_nvidia_dynamic_lib_failure cufftMp should have been removed in PR #1315 (cuda-bindings v13.1.0 release), but this was overlooked. * Add HeaderDescriptorSpec for mathdx * Add HeaderDescriptorSpec entries for cute, cutlass * Restore mathdx in IMPORTLIB_METADATA_DISTRIBUTIONS_NAMES The cu13 Windows CI jobs do not run `pip install --group test-cu13`, so nvidia-libmathdx is not installed when the all_must_work pathfinder test run executes. Without the distribution-presence check the test fails unconditionally. Restore the entry so the test treats a missing mathdx wheel as an expected failure under all_must_work strictness. Made-with: Cursor * Skip all_must_work pathfinder tests for free-threaded Python on Windows (#1820) The nvidia-cutlass wheel contains paths that exceed the 260-char Windows MAX_PATH limit when installed under the longer x64-freethreaded site-packages prefix. Skip the pip --group install and the all_must_work test run for free-threaded builds until the CI runners enable LongPathsEnabled. Made-with: Cursor * Fix mathdx site_packages_windows path for cu13 The nvidia-libmathdx-cu13 wheel installs mathdx64_0.dll under nvidia/cu13/bin, not nvidia/cu13/bin/x86_64. The x86_64 subdirectory is used by cuda-toolkit CTK packages, but nvidia-libmathdx is packaged separately and follows the flat layout (matching nvidia-cudss and the cu12 mathdx wheel). Made-with: Cursor
1 parent 079f937 commit fc5babd

6 files changed

Lines changed: 32 additions & 2 deletions

File tree

.github/workflows/test-wheel-windows.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,7 @@ jobs:
263263
}
264264
265265
- name: Install cuda.pathfinder extra wheels for testing
266+
if: ${{ !endsWith(matrix.PY_VER, 't') }} # see issue #1820
266267
shell: bash --noprofile --norc -xeuo pipefail {0}
267268
run: |
268269
pushd cuda_pathfinder
@@ -271,6 +272,7 @@ jobs:
271272
popd
272273
273274
- name: Run cuda.pathfinder tests with all_must_work
275+
if: ${{ !endsWith(matrix.PY_VER, 't') }} # see issue #1820
274276
env:
275277
CUDA_PATHFINDER_TEST_LOAD_NVIDIA_DYNAMIC_LIB_STRICTNESS: all_must_work
276278
CUDA_PATHFINDER_TEST_FIND_NVIDIA_HEADERS_STRICTNESS: all_must_work

cuda_pathfinder/cuda/pathfinder/_dynamic_libs/descriptor_catalog.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ class DescriptorSpec:
314314
linux_sonames=("libmathdx.so.0",),
315315
windows_dlls=("mathdx64_0.dll",),
316316
site_packages_linux=("nvidia/cu13/lib", "nvidia/cu12/lib"),
317-
site_packages_windows=("nvidia/cu13/bin/x86_64", "nvidia/cu12/bin"),
317+
site_packages_windows=("nvidia/cu13/bin", "nvidia/cu12/bin"),
318318
dependencies=("nvrtc",),
319319
),
320320
DescriptorSpec(

cuda_pathfinder/cuda/pathfinder/_headers/header_descriptor_catalog.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,14 @@ class HeaderDescriptorSpec:
145145
conda_targets_layout=False,
146146
use_ctk_root_canary=False,
147147
),
148+
HeaderDescriptorSpec(
149+
name="cute",
150+
packaged_with="other",
151+
header_basename="cute/tensor.hpp",
152+
site_packages_dirs=("cutlass_library/source/include",),
153+
conda_targets_layout=False,
154+
use_ctk_root_canary=False,
155+
),
148156
HeaderDescriptorSpec(
149157
name="cutensor",
150158
packaged_with="other",
@@ -153,6 +161,22 @@ class HeaderDescriptorSpec:
153161
conda_targets_layout=False,
154162
use_ctk_root_canary=False,
155163
),
164+
HeaderDescriptorSpec(
165+
name="cutlass",
166+
packaged_with="other",
167+
header_basename="cutlass/cutlass.h",
168+
site_packages_dirs=("cutlass_library/source/include",),
169+
conda_targets_layout=False,
170+
use_ctk_root_canary=False,
171+
),
172+
HeaderDescriptorSpec(
173+
name="mathdx",
174+
packaged_with="other",
175+
header_basename="libmathdx.h",
176+
site_packages_dirs=("nvidia/cu13/include", "nvidia/cu12/include"),
177+
conda_targets_layout=False,
178+
use_ctk_root_canary=False,
179+
),
156180
HeaderDescriptorSpec(
157181
name="nvshmem",
158182
packaged_with="other",

cuda_pathfinder/pyproject.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,12 @@ cu13 = [
3838
"nvidia-cudss-cu13",
3939
"nvidia-cufftmp-cu13; sys_platform != 'win32'",
4040
"nvidia-cusparselt-cu13",
41+
"nvidia-libmathdx-cu13",
4142
"nvidia-nccl-cu13; sys_platform != 'win32'",
4243
"nvidia-nvshmem-cu13; sys_platform != 'win32'",
4344
]
4445
host = [
46+
"nvidia-cutlass",
4547
"nvpl-fft; platform_system == 'Linux' and platform_machine == 'aarch64'",
4648
]
4749

cuda_pathfinder/tests/test_find_nvidia_headers.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,10 @@
4141

4242
NON_CTK_IMPORTLIB_METADATA_DISTRIBUTIONS_NAMES = {
4343
"cusparseLt": r"^nvidia-cusparselt-.*$",
44+
"cute": r"^nvidia-cutlass$",
4445
"cutensor": r"^cutensor-.*$",
46+
"cutlass": r"^nvidia-cutlass$",
47+
"mathdx": r"^nvidia-libmathdx-.*$",
4548
"nvshmem": r"^nvidia-nvshmem-.*$",
4649
}
4750

cuda_pathfinder/tests/test_load_nvidia_dynamic_lib.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,6 @@ def test_known_but_platform_unavailable_libname_raises_dynamic_lib_not_available
9090

9191

9292
IMPORTLIB_METADATA_DISTRIBUTIONS_NAMES = {
93-
"cufftMp": r"^nvidia-cufftmp-.*$",
9493
"mathdx": r"^nvidia-libmathdx-.*$",
9594
}
9695

0 commit comments

Comments
 (0)