Skip to content

Commit accc2a9

Browse files
committed
Merge remote-tracking branch 'upstream/main' into cuda.core.system-events
2 parents b73d04b + 8725e96 commit accc2a9

16 files changed

Lines changed: 247 additions & 128 deletions

File tree

.github/workflows/ci.yml

Lines changed: 29 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ jobs:
4040
runs-on: ubuntu-latest
4141
outputs:
4242
skip: ${{ steps.get-should-skip.outputs.skip }}
43+
doc-only: ${{ steps.get-should-skip.outputs.doc_only }}
4344
steps:
4445
- name: Checkout repository
4546
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
@@ -50,11 +51,16 @@ jobs:
5051
run: |
5152
set -euxo pipefail
5253
if ${{ startsWith(github.ref_name, 'pull-request/') }}; then
53-
skip="$(gh pr view "$(grep -Po '(\d+)$' <<< '${{ github.ref_name }}')" --json title --jq '.title | contains("[no-ci]")')"
54+
pr_number="$(grep -Po '(\d+)$' <<< '${{ github.ref_name }}')"
55+
pr_title="$(gh pr view "${pr_number}" --json title --jq '.title')"
56+
skip="$(echo "${pr_title}" | grep -q '\[no-ci\]' && echo true || echo false)"
57+
doc_only="$(echo "${pr_title}" | grep -q '\[doc-only\]' && echo true || echo false)"
5458
else
5559
skip=false
60+
doc_only=false
5661
fi
5762
echo "skip=${skip}" >> "$GITHUB_OUTPUT"
63+
echo "doc_only=${doc_only}" >> "$GITHUB_OUTPUT"
5864
5965
# WARNING: make sure all of the build jobs are in sync
6066
build-linux-64:
@@ -86,7 +92,7 @@ jobs:
8692
host-platform:
8793
- linux-aarch64
8894
name: Build ${{ matrix.host-platform }}, CUDA ${{ needs.ci-vars.outputs.CUDA_BUILD_VER }}
89-
if: ${{ github.repository_owner == 'nvidia' && !fromJSON(needs.should-skip.outputs.skip) }}
95+
if: ${{ github.repository_owner == 'nvidia' && !fromJSON(needs.should-skip.outputs.skip) && !fromJSON(needs.should-skip.outputs.doc-only) }}
9096
secrets: inherit
9197
uses: ./.github/workflows/build-wheel.yml
9298
with:
@@ -105,7 +111,7 @@ jobs:
105111
host-platform:
106112
- win-64
107113
name: Build ${{ matrix.host-platform }}, CUDA ${{ needs.ci-vars.outputs.CUDA_BUILD_VER }}
108-
if: ${{ github.repository_owner == 'nvidia' && !fromJSON(needs.should-skip.outputs.skip) }}
114+
if: ${{ github.repository_owner == 'nvidia' && !fromJSON(needs.should-skip.outputs.skip) && !fromJSON(needs.should-skip.outputs.doc-only) }}
109115
secrets: inherit
110116
uses: ./.github/workflows/build-wheel.yml
111117
with:
@@ -121,11 +127,12 @@ jobs:
121127
host-platform:
122128
- linux-64
123129
name: Test ${{ matrix.host-platform }}
124-
if: ${{ github.repository_owner == 'nvidia' }}
130+
if: ${{ github.repository_owner == 'nvidia' && !fromJSON(needs.should-skip.outputs.doc-only) }}
125131
permissions:
126132
contents: read # This is required for actions/checkout
127133
needs:
128134
- ci-vars
135+
- should-skip
129136
- build-linux-64
130137
secrets: inherit
131138
uses: ./.github/workflows/test-wheel-linux.yml
@@ -142,6 +149,8 @@ jobs:
142149
host-platform:
143150
- linux-aarch64
144151
name: Test ${{ matrix.host-platform }}
152+
# Note: No doc-only check needed here - if build-linux-aarch64 is skipped,
153+
# this job is automatically skipped due to the dependency.
145154
if: ${{ github.repository_owner == 'nvidia' }}
146155
permissions:
147156
contents: read # This is required for actions/checkout
@@ -162,6 +171,8 @@ jobs:
162171
host-platform:
163172
- win-64
164173
name: Test ${{ matrix.host-platform }}
174+
# Note: No doc-only check needed here - if build-windows is skipped,
175+
# this job is automatically skipped due to the dependency.
165176
if: ${{ github.repository_owner == 'nvidia' }}
166177
permissions:
167178
contents: read # This is required for actions/checkout
@@ -196,6 +207,7 @@ jobs:
196207
if: always()
197208
runs-on: ubuntu-latest
198209
needs:
210+
- should-skip
199211
- test-linux-64
200212
- test-linux-aarch64
201213
- test-windows
@@ -219,11 +231,18 @@ jobs:
219231
# failing job(s) will timeout causing a cancellation here and the
220232
# build to succeed which we don't want (originally this was just
221233
# 'exit 0')
222-
if ${{ needs.test-linux-64.result == 'cancelled' ||
223-
needs.test-linux-aarch64.result == 'cancelled' ||
224-
needs.test-windows.result == 'cancelled' ||
225-
needs.doc.result == 'cancelled' }}; then
234+
#
235+
# Note: When [doc-only] is in PR title, test jobs are intentionally
236+
# skipped and should not cause failure.
237+
doc_only=${{ needs.should-skip.outputs.doc-only }}
238+
if ${{ needs.doc.result == 'cancelled' }}; then
226239
exit 1
227-
else
228-
exit 0
229240
fi
241+
if [[ "${doc_only}" != "true" ]]; then
242+
if ${{ needs.test-linux-64.result == 'cancelled' ||
243+
needs.test-linux-aarch64.result == 'cancelled' ||
244+
needs.test-windows.result == 'cancelled' }}; then
245+
exit 1
246+
fi
247+
fi
248+
exit 0

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

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -269,17 +269,15 @@ jobs:
269269
- name: Ensure cuda-python installable
270270
run: |
271271
if [[ "${{ matrix.LOCAL_CTK }}" == 1 ]]; then
272-
pip install cuda_python*.whl
272+
pip install --only-binary=:all: cuda_python*.whl
273273
else
274-
pip install $(ls cuda_python*.whl)[all]
274+
pip install --only-binary=:all: $(ls cuda_python*.whl)[all]
275275
fi
276276
277277
- name: Install cuda.pathfinder extra wheels for testing
278278
run: |
279279
set -euo pipefail
280280
pushd cuda_pathfinder
281-
# Install pathfinder from the pre-built wheel, since building from
282-
# source won't work in this context (we don't have a git checkout).
283281
pip install --only-binary=:all: -v ./*.whl --group "test-cu${TEST_CUDA_MAJOR}"
284282
pip list
285283
popd

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -236,16 +236,16 @@ jobs:
236236
- name: Ensure cuda-python installable
237237
run: |
238238
if ('${{ matrix.LOCAL_CTK }}' -eq '1') {
239-
pip install (Get-ChildItem -Filter cuda_python*.whl).FullName
239+
pip install --only-binary=:all: (Get-ChildItem -Filter cuda_python*.whl).FullName
240240
} else {
241-
pip install "$((Get-ChildItem -Filter cuda_python*.whl).FullName)[all]"
241+
pip install --only-binary=:all: "$((Get-ChildItem -Filter cuda_python*.whl).FullName)[all]"
242242
}
243243
244244
- name: Install cuda.pathfinder extra wheels for testing
245245
shell: bash --noprofile --norc -xeuo pipefail {0}
246246
run: |
247247
pushd cuda_pathfinder
248-
pip install --only-binary=:all: -v . --group "test-cu${TEST_CUDA_MAJOR}"
248+
pip install --only-binary=:all: -v ./*.whl --group "test-cu${TEST_CUDA_MAJOR}"
249249
pip list
250250
popd
251251

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ CUDA Python is the home for accessing NVIDIA’s CUDA platform from Python. It c
1313
* [nvshmem4py](https://docs.nvidia.com/nvshmem/api/api/language_bindings/python/index.html): Pythonic interface to the NVSHMEM library, enabling Python applications to leverage NVSHMEM's high-performance PGAS (Partitioned Global Address Space) programming model for GPU-accelerated computing
1414
* [Nsight Python](https://docs.nvidia.com/nsight-python/index.html): Python kernel profiling interface that automates performance analysis across multiple kernel configurations using NVIDIA Nsight Tools
1515
* [CUPTI Python](https://docs.nvidia.com/cupti-python/): Python APIs for creation of profiling tools that target CUDA Python applications via the CUDA Profiling Tools Interface (CUPTI)
16+
* [Accelerated Computing Hub](https://github.com/NVIDIA/accelerated-computing-hub): Open-source learning materials related to GPU computing. You will find user guides, tutorials, and other works freely available for all learners interested in GPU computing.
1617

1718
CUDA Python is currently undergoing an overhaul to improve existing and introduce new components. All of the previously available functionality from the `cuda-python` package will continue to be available, please refer to the [cuda.bindings](https://nvidia.github.io/cuda-python/cuda-bindings/latest) documentation for installation guide and further detail.
1819

cuda_bindings/tests/nvml/test_pynvml.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,13 +136,19 @@ def test_device_get_p2p_status(handles, index):
136136

137137
def test_device_get_power_usage(ngpus, handles):
138138
for i in range(ngpus):
139-
power_mwatts = nvml.device_get_power_usage(handles[i])
139+
try:
140+
power_mwatts = nvml.device_get_power_usage(handles[i])
141+
except nvml.NotSupportedError:
142+
pytest.skip("device_get_power_usage not supported")
140143
assert power_mwatts >= 0.0
141144

142145

143146
def test_device_get_total_energy_consumption(ngpus, handles):
144147
for i in range(ngpus):
145-
energy_mjoules1 = nvml.device_get_total_energy_consumption(handles[i])
148+
try:
149+
energy_mjoules1 = nvml.device_get_total_energy_consumption(handles[i])
150+
except nvml.NotSupportedError:
151+
pytest.skip("device_get_total_energy_consumption not supported")
146152
for j in range(10): # idle for 150 ms
147153
time.sleep(0.015) # and check for increase every 15 ms
148154
energy_mjoules2 = nvml.device_get_total_energy_consumption(handles[i])

0 commit comments

Comments
 (0)