Skip to content

Commit 6b2ea72

Browse files
authored
Merge branch 'main' into nvbug-5880275
2 parents 22859e8 + e481335 commit 6b2ea72

405 files changed

Lines changed: 47114 additions & 9254 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.coveragerc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2-
# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE
2+
# SPDX-License-Identifier: Apache-2.0
33

44
[paths]
55
source =

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
*.h binary
66
*.hpp binary
77
# Exception: headers we own
8+
benchmarks/cuda_bindings/benchmarks/cpp/*.hpp -binary text diff
89
cuda_bindings/cuda/bindings/_bindings/*.h -binary text diff
910
cuda_bindings/cuda/bindings/_lib/*.h -binary text diff
1011
cuda_core/cuda/core/_cpp/*.h -binary text diff

.github/actionlint.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2+
#
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
# Self-hosted runner labels used in CI workflows.
6+
# Without this config, actionlint rejects non-GitHub-hosted labels.
7+
self-hosted-runner:
8+
labels:
9+
- linux-amd64-cpu8

.github/actions/doc_preview/action.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ runs:
2222
# Note: the PR previews will be removed once merged to main or release/* (see below)
2323
- name: Deploy doc preview
2424
if: ${{ github.ref_name != 'main' && !startsWith(github.ref_name, 'release/') }}
25-
uses: JamesIves/github-pages-deploy-action@6c2d9db40f9296374acc17b90404b6e8864128c8 # v4.7.3
25+
uses: JamesIves/github-pages-deploy-action@d92aa235d04922e8f08b40ce78cc5442fcfbfa2f # v4.8.0
2626
with:
2727
git-config-name: cuda-python-bot
2828
git-config-email: cuda-python-bot@users.noreply.github.com
@@ -32,7 +32,7 @@ runs:
3232

3333
- name: Leave a comment after deployment
3434
if: ${{ github.ref_name != 'main' && !startsWith(github.ref_name, 'release/') }}
35-
uses: marocchino/sticky-pull-request-comment@67d0dec7b07ed060a405f9b2a64b8ab319fdd7db # v2.9.2
35+
uses: marocchino/sticky-pull-request-comment@d4d6b0936434b21bc8345ad45a440c5f7d2c40ff # v3.0.3
3636
with:
3737
header: pr-preview
3838
number: ${{ inputs.pr-number }}
@@ -49,7 +49,7 @@ runs:
4949
# The steps below are executed only when building on main or release/*.
5050
- name: Remove doc preview
5151
if: ${{ github.ref_name == 'main' || startsWith(github.ref_name, 'release/') }}
52-
uses: JamesIves/github-pages-deploy-action@6c2d9db40f9296374acc17b90404b6e8864128c8 # v4.7.3
52+
uses: JamesIves/github-pages-deploy-action@d92aa235d04922e8f08b40ce78cc5442fcfbfa2f # v4.8.0
5353
with:
5454
git-config-name: cuda-python-bot
5555
git-config-email: cuda-python-bot@users.noreply.github.com
@@ -59,7 +59,7 @@ runs:
5959

6060
- name: Leave a comment after removal
6161
if: ${{ github.ref_name == 'main' || startsWith(github.ref_name, 'release/') }}
62-
uses: marocchino/sticky-pull-request-comment@67d0dec7b07ed060a405f9b2a64b8ab319fdd7db # v2.9.2
62+
uses: marocchino/sticky-pull-request-comment@d4d6b0936434b21bc8345ad45a440c5f7d2c40ff # v3.0.3
6363
with:
6464
header: pr-preview
6565
number: ${{ inputs.pr-number }}

.github/actions/fetch_ctk/action.yml

Lines changed: 21 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# SPDX-FileCopyrightText: Copyright (c) 2024-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
1+
# SPDX-FileCopyrightText: Copyright (c) 2024-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
22
#
33
# SPDX-License-Identifier: Apache-2.0
44

@@ -14,7 +14,7 @@ inputs:
1414
cuda-components:
1515
description: "A list of the CTK components to install as a comma-separated list. e.g. 'cuda_nvcc,cuda_nvrtc,cuda_cudart'"
1616
required: false
17-
default: "cuda_nvcc,cuda_cudart,cuda_crt,libnvvm,cuda_nvrtc,cuda_profiler_api,cuda_cccl,cuda_cupti,libnvjitlink,libcufile,libnvfatbin"
17+
default: "cuda_nvcc,cuda_cudart,cuda_crt,libnvvm,cuda_nvrtc,cuda_profiler_api,cuda_cccl,cuda_cupti,libnvjitlink,libcufile,libnvfatbin,libcudla"
1818
cuda-path:
1919
description: "where the CTK components will be installed to, relative to $PWD"
2020
required: false
@@ -27,24 +27,15 @@ runs:
2727
shell: bash --noprofile --norc -xeuo pipefail {0}
2828
run: |
2929
# Pre-process the component list to ensure hash uniqueness
30+
# Use the runtime workspace mount so this also works inside container jobs.
31+
CTK_REDIST_TOOL="${GITHUB_WORKSPACE}/ci/tools/fetch_ctk_redistrib.py"
3032
CTK_CACHE_COMPONENTS=${{ inputs.cuda-components }}
31-
# Conditionally strip out libnvjitlink for CUDA versions < 12
32-
CUDA_MAJOR_VER="$(cut -d '.' -f 1 <<< ${{ inputs.cuda-version }})"
33-
if [[ "$CUDA_MAJOR_VER" -lt 12 ]]; then
34-
CTK_CACHE_COMPONENTS="${CTK_CACHE_COMPONENTS//libnvjitlink/}"
35-
fi
36-
# Conditionally strip out cuda_crt and libnvvm for CUDA versions < 13
37-
CUDA_MAJOR_VER="$(cut -d '.' -f 1 <<< ${{ inputs.cuda-version }})"
38-
if [[ "$CUDA_MAJOR_VER" -lt 13 ]]; then
39-
CTK_CACHE_COMPONENTS="${CTK_CACHE_COMPONENTS//cuda_crt/}"
40-
CTK_CACHE_COMPONENTS="${CTK_CACHE_COMPONENTS//libnvvm/}"
41-
fi
42-
# Conditionally strip out libcufile since it does not support Windows
43-
if [[ "${{ inputs.host-platform }}" == win-* ]]; then
44-
CTK_CACHE_COMPONENTS="${CTK_CACHE_COMPONENTS//libcufile/}"
45-
fi
46-
# Cleanup stray commas after removing components
47-
CTK_CACHE_COMPONENTS="${CTK_CACHE_COMPONENTS//,,/,}"
33+
CTK_JSON_URL="https://developer.download.nvidia.com/compute/cuda/redist/redistrib_${{ inputs.cuda-version }}.json"
34+
CTK_CACHE_COMPONENTS="$(python "$CTK_REDIST_TOOL" filter-components \
35+
--host-platform "${{ inputs.host-platform }}" \
36+
--cuda-version "${{ inputs.cuda-version }}" \
37+
--components "$CTK_CACHE_COMPONENTS" \
38+
--metadata-url "$CTK_JSON_URL")"
4839
4940
HASH=$(echo -n "${CTK_CACHE_COMPONENTS}" | sha256sum | awk '{print $1}')
5041
echo "CTK_CACHE_KEY=mini-ctk-${{ inputs.cuda-version }}-${{ inputs.host-platform }}-$HASH" >> $GITHUB_ENV
@@ -60,7 +51,7 @@ runs:
6051

6152
- name: Download CTK cache
6253
id: ctk-get-cache
63-
uses: actions/cache/restore@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
54+
uses: actions/cache/restore@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
6455
continue-on-error: true
6556
with:
6657
key: ${{ env.CTK_CACHE_KEY }}
@@ -78,19 +69,17 @@ runs:
7869
mkdir $CACHE_TMP_DIR
7970
8071
# The binary archives (redist) are guaranteed to be updated as part of the release posting.
72+
# Use the runtime workspace mount so this also works inside container jobs.
73+
CTK_REDIST_TOOL="${GITHUB_WORKSPACE}/ci/tools/fetch_ctk_redistrib.py"
8174
CTK_BASE_URL="https://developer.download.nvidia.com/compute/cuda/redist/"
8275
CTK_JSON_URL="$CTK_BASE_URL/redistrib_${{ inputs.cuda-version }}.json"
76+
CTK_JSON_FILE="$CACHE_TMP_DIR/redistrib.json"
77+
curl -LSs "$CTK_JSON_URL" -o "$CTK_JSON_FILE"
8378
if [[ "${{ inputs.host-platform }}" == linux* ]]; then
84-
if [[ "${{ inputs.host-platform }}" == "linux-64" ]]; then
85-
CTK_SUBDIR="linux-x86_64"
86-
elif [[ "${{ inputs.host-platform }}" == "linux-aarch64" ]]; then
87-
CTK_SUBDIR="linux-sbsa"
88-
fi
8979
function extract() {
9080
tar -xvf $1 -C $CACHE_TMP_DIR --strip-components=1
9181
}
9282
elif [[ "${{ inputs.host-platform }}" == "win-64" ]]; then
93-
CTK_SUBDIR="windows-x86_64"
9483
function extract() {
9584
_TEMP_DIR_=$(mktemp -d)
9685
unzip $1 -d $_TEMP_DIR_
@@ -103,11 +92,13 @@ runs:
10392
function populate_cuda_path() {
10493
# take the component name as a argument
10594
function download() {
106-
curl -kLSs $1 -o $2
95+
curl -LSs $1 -o $2
10796
}
10897
CTK_COMPONENT=$1
109-
CTK_COMPONENT_REL_PATH="$(curl -s $CTK_JSON_URL |
110-
python -c "import sys, json; print(json.load(sys.stdin)['${CTK_COMPONENT}']['${CTK_SUBDIR}']['relative_path'])")"
98+
CTK_COMPONENT_REL_PATH="$(python "$CTK_REDIST_TOOL" component-relative-path \
99+
--host-platform "${{ inputs.host-platform }}" \
100+
--component "$CTK_COMPONENT" \
101+
--metadata-path "$CTK_JSON_FILE")"
111102
CTK_COMPONENT_URL="${CTK_BASE_URL}/${CTK_COMPONENT_REL_PATH}"
112103
CTK_COMPONENT_COMPONENT_FILENAME="$(basename $CTK_COMPONENT_REL_PATH)"
113104
download $CTK_COMPONENT_URL $CTK_COMPONENT_COMPONENT_FILENAME
@@ -142,7 +133,7 @@ runs:
142133
- name: Upload CTK cache
143134
if: ${{ !cancelled() &&
144135
steps.ctk-get-cache.outputs.cache-hit != 'true' }}
145-
uses: actions/cache/save@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
136+
uses: actions/cache/save@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
146137
with:
147138
key: ${{ env.CTK_CACHE_KEY }}
148139
path: ./${{ env.CTK_CACHE_FILENAME }}
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2+
#
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
name: sccache summary
6+
description: Parse sccache stats JSON and write a summary table to GITHUB_STEP_SUMMARY
7+
8+
# Inspired by NVIDIA/cccl's prepare-execution-summary.py (PR #3621).
9+
10+
inputs:
11+
json-file:
12+
description: "Path to the sccache stats JSON file (from sccache --show-stats --stats-format=json)"
13+
required: true
14+
label:
15+
description: "Label for the stats row (e.g. cuda.bindings, cuda.core)"
16+
required: false
17+
default: "sccache"
18+
build-step:
19+
description: "Name of the cibuildwheel build step (for deep-link in summary)"
20+
required: false
21+
default: ""
22+
23+
runs:
24+
using: composite
25+
steps:
26+
- name: Report sccache stats
27+
shell: bash --noprofile --norc -euo pipefail {0}
28+
env:
29+
SCCACHE_JSON: ${{ inputs.json-file }}
30+
SCCACHE_LABEL: ${{ inputs.label }}
31+
SCCACHE_BUILD_STEP: ${{ inputs.build-step }}
32+
run: |
33+
if [ ! -f "$SCCACHE_JSON" ]; then
34+
echo "::warning::sccache stats file not found: $SCCACHE_JSON"
35+
exit 0
36+
fi
37+
38+
python3 - <<'PYEOF'
39+
import json, os, urllib.parse
40+
41+
json_file = os.environ["SCCACHE_JSON"]
42+
label = os.environ["SCCACHE_LABEL"]
43+
build_step = os.environ.get("SCCACHE_BUILD_STEP", "")
44+
45+
with open(json_file) as f:
46+
stats = json.load(f)["stats"]
47+
48+
# compile_requests only counts top-level nvcc invocations, but each
49+
# invocation spawns sub-tool compilations (cudafe++, cicc, ptxas) that
50+
# sccache tracks under separate language keys. Count all of them so
51+
# the reported rate matches sccache's own "Cache hits rate".
52+
counted_languages = {"C/C++", "CUDA", "CUDA (Device code)", "PTX", "CUBIN"}
53+
hits = sum(
54+
v for k, v in stats.get("cache_hits", {}).get("counts", {}).items()
55+
if k in counted_languages
56+
)
57+
misses = sum(
58+
v for k, v in stats.get("cache_misses", {}).get("counts", {}).items()
59+
if k in counted_languages
60+
)
61+
total = hits + misses
62+
pct = int(100 * hits / total) if total > 0 else 0
63+
64+
# Build a deep-link to the cibuildwheel step if step name is provided.
65+
# GHA step summary links use the format: #step:N:L but we can't know the
66+
# step number here. Instead, link to the job page with a search hint.
67+
link_note = ""
68+
if build_step:
69+
link_note = f"\n\n_Full stats in the **{build_step}** step log._\n"
70+
71+
summary_file = os.environ.get("GITHUB_STEP_SUMMARY", "")
72+
if summary_file:
73+
with open(summary_file, "a") as sf:
74+
sf.write(f"### 📊 {label} — sccache stats\n")
75+
sf.write("| Hit Rate | Hits | Misses | Requests |\n")
76+
sf.write("|----------|------|--------|----------|\n")
77+
sf.write(f"| {pct}% | {hits} | {misses} | {total} |{link_note}\n")
78+
79+
print(f"{label}: {pct}% hit rate ({hits}/{total})")
80+
PYEOF

.github/labeler.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2+
#
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
# Configuration for https://github.com/actions/labeler
6+
# Auto-applies labels based on which files a PR changes.
7+
8+
cuda.bindings:
9+
- changed-files:
10+
- any-glob-to-any-file: 'cuda_bindings/**'
11+
12+
cuda.core:
13+
- changed-files:
14+
- any-glob-to-any-file: 'cuda_core/**'
15+
16+
cuda.pathfinder:
17+
- changed-files:
18+
- any-glob-to-any-file: 'cuda_pathfinder/**'
19+
20+
CI/CD:
21+
- changed-files:
22+
- any-glob-to-any-file:
23+
- '.github/**'
24+
- 'ci/**'

.github/workflows/backport.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
echo "OLD_BRANCH=${OLD_BRANCH}" >> $GITHUB_ENV
4444
4545
- name: Create backport pull requests
46-
uses: korthout/backport-action@3c06f323a58619da1e8522229ebc8d5de2633e46 # v4.3.0
46+
uses: korthout/backport-action@7c3f6cd5843cac11bc59a04a1b7699af93261670 # v4.5.0
4747
with:
4848
copy_assignees: true
4949
copy_labels_pattern: true
@@ -67,7 +67,7 @@ jobs:
6767
run: echo "BACKPORT_BRANCH=${{ inputs.backport-branch }}" >> $GITHUB_ENV
6868

6969
- name: Create backport pull requests
70-
uses: korthout/backport-action@3c06f323a58619da1e8522229ebc8d5de2633e46 # v4.3.0
70+
uses: korthout/backport-action@7c3f6cd5843cac11bc59a04a1b7699af93261670 # v4.5.0
7171
with:
7272
copy_assignees: true
7373
copy_labels_pattern: true

.github/workflows/bandit.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
2424

2525
- name: Install uv
26-
uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0
26+
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
2727
with:
2828
enable-cache: false
2929

@@ -38,10 +38,10 @@ jobs:
3838
3939
echo "codes=$(uvx toml2json ./ruff.toml | jq -r '.lint.ignore | map(select(test("^S\\d+"))) | join(",")')" >> "$GITHUB_OUTPUT"
4040
- name: Perform Bandit Analysis using Ruff
41-
uses: astral-sh/ruff-action@4919ec5cf1f49eff0871dbcea0da843445b837e6 # v3.6.1
41+
uses: astral-sh/ruff-action@0ce1b0bf8b818ef400413f810f8a11cdbda0034b # v4.0.0
4242
with:
4343
args: "check --select S --ignore ${{ steps.ignore-codes.outputs.codes }} --output-format sarif --output-file results.sarif"
4444
- name: Upload SARIF file
45-
uses: github/codeql-action/upload-sarif@v4.35.1
45+
uses: github/codeql-action/upload-sarif@e46ed2cbd01164d986452f91f178727624ae40d7 # v4.35.3
4646
with:
4747
sarif_file: results.sarif

.github/workflows/build-docs.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ jobs:
6262
# TODO: This workflow runs on GH-hosted runner and cannot use the proxy cache
6363

6464
- name: Set up miniforge
65-
uses: conda-incubator/setup-miniconda@fc2d68f6413eb2d87b895e92f8584b5b94a10167 # v3.3.0
65+
uses: conda-incubator/setup-miniconda@8ee1f361103df19b6f8c8655fd3967a8ecb162d5 # v4.0.1
6666
with:
6767
activate-environment: cuda-python-docs
6868
environment-file: ./cuda_python/docs/environment-docs.yml
@@ -244,7 +244,7 @@ jobs:
244244
245245
# TODO: Consider removing this step?
246246
- name: Upload doc artifacts
247-
uses: actions/upload-pages-artifact@7b1f4a764d45c48632c6b24a0339c27f5614fb0b # v4.0.0
247+
uses: actions/upload-pages-artifact@fc324d3547104276b827a68afc52ff2a11cc49c9 # v5.0.0
248248
with:
249249
path: artifacts/
250250
retention-days: 3

0 commit comments

Comments
 (0)