Skip to content

Commit 6d82d8f

Browse files
committed
Merge remote-tracking branch 'origin/main' into cythonize-graph-builder
Made-with: Cursor # Conflicts: # cuda_core/cuda/core/_graph/_graph_builder.pyx # cuda_core/cuda/core/_utils/cuda_utils.pyx
2 parents 59de5e2 + 613be11 commit 6d82d8f

File tree

8 files changed

+155
-2
lines changed

8 files changed

+155
-2
lines changed
Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
# SPDX-FileCopyrightText: Copyright (c) 2024-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2+
#
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
name: "CI: Enforce label/milestone on PRs"
6+
7+
on:
8+
pull_request_target:
9+
types:
10+
- opened
11+
- edited
12+
- synchronize
13+
- labeled
14+
- unlabeled
15+
- reopened
16+
- ready_for_review
17+
18+
jobs:
19+
check-metadata:
20+
name: PR has labels and milestone
21+
if: github.repository_owner == 'NVIDIA'
22+
runs-on: ubuntu-latest
23+
steps:
24+
- name: Check for labels and milestone
25+
env:
26+
LABELS: ${{ toJson(github.event.pull_request.labels) }}
27+
MILESTONE: ${{ github.event.pull_request.milestone && github.event.pull_request.milestone.title || '' }}
28+
PR_URL: ${{ github.event.pull_request.html_url }}
29+
IS_BOT: ${{ github.actor == 'dependabot[bot]' || github.actor == 'pre-commit-ci[bot]' || github.actor == 'copy-pr-bot[bot]' }}
30+
IS_DRAFT: ${{ github.event.pull_request.draft }}
31+
run: |
32+
if [ "$IS_BOT" = "true" ] || [ "$IS_DRAFT" = "true" ]; then
33+
echo "Skipping check for bot or draft PR."
34+
exit 0
35+
fi
36+
37+
LABEL_NAMES=$(echo "$LABELS" | jq -r '.[].name')
38+
ERRORS=""
39+
40+
# Module labels identify which package the PR touches.
41+
# Cross-cutting labels exempt PRs from needing a module label.
42+
MODULE_LABELS="cuda.bindings cuda.core cuda.pathfinder"
43+
MODULE_EXEMPT_LABELS="CI/CD"
44+
HAS_MODULE=false
45+
for label in $LABEL_NAMES; do
46+
for mod in $MODULE_LABELS $MODULE_EXEMPT_LABELS; do
47+
if [ "$label" = "$mod" ]; then
48+
HAS_MODULE=true
49+
break 2
50+
fi
51+
done
52+
done
53+
54+
if [ "$HAS_MODULE" = "false" ]; then
55+
ERRORS="${ERRORS}- **Missing module label**: add at least one of: \`cuda.bindings\`, \`cuda.core\`, \`cuda.pathfinder\` (or a cross-cutting label such as \`CI/CD\`).\n"
56+
fi
57+
58+
# Type labels categorize the kind of change.
59+
TYPE_LABELS="bug enhancement feature documentation test example CI/CD packaging dependencies performance experiment RFC support P0 P1 P2"
60+
HAS_TYPE=false
61+
for label in $LABEL_NAMES; do
62+
for typ in $TYPE_LABELS; do
63+
if [ "$label" = "$typ" ]; then
64+
HAS_TYPE=true
65+
break 2
66+
fi
67+
done
68+
done
69+
70+
if [ "$HAS_TYPE" = "false" ]; then
71+
ERRORS="${ERRORS}- **Missing type label**: add at least one of: \`bug\`, \`enhancement\`, \`feature\`, \`documentation\`, \`test\`, \`example\`, \`CI/CD\`, \`packaging\`, \`dependencies\`, \`performance\`, \`experiment\`, \`RFC\`, \`support\`, \`P0\`, \`P1\`, \`P2\`.\n"
72+
fi
73+
74+
if [ -z "$MILESTONE" ]; then
75+
ERRORS="${ERRORS}- **Missing milestone**: assign a milestone to this PR.\n"
76+
fi
77+
78+
# Block PRs with labels that indicate they are not ready to merge.
79+
BLOCKED_PATTERNS="blocked DO NOT MERGE do not merge"
80+
for label in $LABEL_NAMES; do
81+
for pattern in $BLOCKED_PATTERNS; do
82+
if echo "$label" | grep -qi "$pattern"; then
83+
ERRORS="${ERRORS}- **Blocked label detected**: label \`$label\` prevents merging. Remove it when the PR is ready.\n"
84+
break
85+
fi
86+
done
87+
done
88+
89+
if [ -n "$ERRORS" ]; then
90+
echo "::error::This PR is missing required metadata. See the job summary for details."
91+
{
92+
echo "## PR Metadata Check Failed"
93+
echo ""
94+
printf '%b' "$ERRORS"
95+
echo ""
96+
echo "Please update the PR at: $PR_URL"
97+
} >> "$GITHUB_STEP_SUMMARY"
98+
exit 1
99+
fi
100+
101+
LABEL_LIST=$(echo "$LABEL_NAMES" | paste -sd ', ' -)
102+
{
103+
echo "## PR Metadata Check Passed"
104+
echo ""
105+
echo "- **Labels**: $LABEL_LIST"
106+
echo "- **Milestone**: $MILESTONE"
107+
} >> "$GITHUB_STEP_SUMMARY"

.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

AGENTS.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,22 @@ guide for package-specific conventions and workflows.
1212
- `cuda_core/`: High-level Pythonic CUDA APIs built on top of bindings.
1313
- `cuda_python/`: Metapackage and docs aggregation.
1414

15+
# Pull requests
16+
17+
When creating pull requests with `gh pr create`, always assign at least one
18+
label and a milestone. CI enforces this via the `pr-metadata-check` workflow
19+
and will block PRs that are missing labels or a milestone. Use `--label` and
20+
`--milestone` flags, for example:
21+
22+
```
23+
gh pr create --title "..." --body "..." --label "bug" --milestone "v1.0"
24+
```
25+
26+
If you are unsure which label or milestone to use, check the existing labels
27+
and milestones on the repository with `gh label list` and `gh api
28+
repos/{owner}/{repo}/milestones --jq '.[].title'`, and pick the best match.
29+
30+
1531
# General
1632

1733
- When searching for text or files, prefer using `rg` or `rg --files`

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)