Skip to content

Commit 0db9dd0

Browse files
mitchdzbmhowe23
andauthored
Prepare for CUDA 13 (#308)
Co-authored-by: Ben Howe <[email protected]>
1 parent 5175dd8 commit 0db9dd0

File tree

13 files changed

+94
-39
lines changed

13 files changed

+94
-39
lines changed

.github/actions/build-lib/action.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ inputs:
44
lib:
55
description: 'Library name to build. (e.g, all, qec or solvers)'
66
required: true
7+
cuda_version:
8+
description: 'CUDA version to build against. (e.g, 12.6)'
9+
required: true
710
pr-number:
811
description: 'Unique pull request identifier.'
912
default: ''
@@ -38,7 +41,7 @@ runs:
3841
- name: Compilation cache key
3942
id: ccache-key
4043
run: |
41-
echo "main=ccache-${{ inputs.lib }}-cu12.6-gcc11-${{ inputs.platform }}" >> $GITHUB_OUTPUT
44+
echo "main=ccache-${{ inputs.lib }}-cu${{ inputs.cuda_version }}-gcc11-${{ inputs.platform }}" >> $GITHUB_OUTPUT
4245
if [[ -n "${{ inputs.pr-number }}" ]]; then
4346
echo "pr=-pr${{ inputs.pr-number }}" >> $GITHUB_OUTPUT
4447
fi

.github/actions/get-cudaq-build/action.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ inputs:
2929
default: 'false'
3030
required: false
3131
platform:
32-
description: 'Platform (amd64 or arm64)'
32+
description: 'Platform ({amd64,arm64}-cu{12,13})'
3333
default: ''
3434
required: true
3535
outputs:

.github/actions/get-cudaq-wheels/action.yaml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ inputs:
2828
description: 'Platform (amd64 or arm64)'
2929
default: ''
3030
required: true
31+
cuda_version:
32+
description: 'CUDA version to build against. (e.g, 12.6)'
33+
required: true
3134
outputs:
3235
found-cache:
3336
description: 'A boolean value to indicate that a cache entry was found.'
@@ -116,7 +119,7 @@ runs:
116119
context: cudaq
117120
file: ./cudaq/docker/release/cudaq.wheel.Dockerfile
118121
build-args: |
119-
base_image=ghcr.io/nvidia/cuda-quantum-devdeps:manylinux-${{ inputs.platform }}-cu12.6-gcc11-main
122+
base_image=ghcr.io/nvidia/cuda-quantum-devdeps:manylinux-${{ inputs.platform }}-cu${{ inputs.cuda_version }}-gcc11-main
120123
release_version=0.99.99
121124
python_version=3.11
122125
outputs: /cudaq-wheels
@@ -127,7 +130,7 @@ runs:
127130
context: cudaq
128131
file: ./cudaq/docker/release/cudaq.wheel.Dockerfile
129132
build-args: |
130-
base_image=ghcr.io/nvidia/cuda-quantum-devdeps:manylinux-${{ inputs.platform }}-cu12.6-gcc11-main
133+
base_image=ghcr.io/nvidia/cuda-quantum-devdeps:manylinux-${{ inputs.platform }}-cu${{ inputs.cuda_version }}-gcc11-main
131134
release_version=0.99.99
132135
python_version=3.12
133136
outputs: /cudaq-wheels
@@ -138,7 +141,7 @@ runs:
138141
context: cudaq
139142
file: ./cudaq/docker/release/cudaq.wheel.Dockerfile
140143
build-args: |
141-
base_image=ghcr.io/nvidia/cuda-quantum-devdeps:manylinux-${{ inputs.platform }}-cu12.6-gcc11-main
144+
base_image=ghcr.io/nvidia/cuda-quantum-devdeps:manylinux-${{ inputs.platform }}-cu${{ inputs.cuda_version }}-gcc11-main
142145
release_version=0.99.99
143146
python_version=3.13
144147
outputs: /cudaq-wheels

.github/workflows/all_libs.yaml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,9 @@ jobs:
1111
fail-fast: false
1212
matrix:
1313
platform: ['amd64', 'arm64']
14+
cuda_version: ['12.6']
1415
runs-on: ${{ startsWith(github.repository, 'NVIDIA/cudaqx') && format('linux-{0}-cpu8', matrix.platform) || 'ubuntu-latest' }}
15-
container: ghcr.io/nvidia/cuda-quantum-devdeps:ext-${{ matrix.platform }}-cu12.6-gcc11-main
16+
container: ghcr.io/nvidia/cuda-quantum-devdeps:ext-${{ matrix.platform }}-cu${{ matrix.cuda_version }}-gcc11-main
1617
permissions:
1718
actions: write
1819
contents: read
@@ -34,6 +35,12 @@ jobs:
3435
run: |
3536
echo "pr_number=${{ fromJSON(steps.get-pr-info.outputs.pr-info).number }}" >> $GITHUB_OUTPUT
3637
38+
- name: Configure
39+
id: config
40+
run: |
41+
cuda_major=`echo ${{ matrix.cuda_version }} | cut -d . -f1`
42+
echo "cuda_major=$cuda_major" >> $GITHUB_OUTPUT
43+
3744
# ========================================================================
3845
# CUDA Quantum build
3946
# ========================================================================
@@ -49,7 +56,7 @@ jobs:
4956
ref: ${{ steps.get-cudaq-version.outputs.ref }}
5057
token: ${{ secrets.CUDAQ_ACCESS_TOKEN }}
5158
pr-number: ${{ steps.export-pr-info.outputs.pr_number }}
52-
platform: ${{ matrix.platform }}
59+
platform: ${{ matrix.platform }}-cu${{ steps.config.outputs.cuda_major }}
5360

5461
# ========================================================================
5562
# Build
@@ -64,6 +71,7 @@ jobs:
6471
uses: ./.github/actions/build-lib
6572
with:
6673
lib: "all"
74+
cuda_version: ${{ matrix.cuda_version }}
6775
pr-number: ${{ steps.export-pr-info.outputs.pr_number }}
6876
save-ccache: true
6977
platform: ${{ matrix.platform }}
@@ -84,7 +92,7 @@ jobs:
8492
LD_LIBRARY_PATH: ${{ env.MPI_PATH }}/lib:${{ env.LD_LIBRARY_PATH }}
8593
shell: bash
8694
run: |
87-
pip install numpy pytest cupy-cuda12x cuquantum-cu12 torch lightning ml_collections mpi4py transformers quimb opt_einsum torch nvidia-cublas-cu12 cuquantum-python-cu12==25.06
95+
pip install numpy pytest cupy-cuda${{ steps.config.outputs.cuda_major }}x cuquantum-cu${{ steps.config.outputs.cuda_major }} torch lightning ml_collections mpi4py transformers quimb opt_einsum torch nvidia-cublas-cu${{ steps.config.outputs.cuda_major }} cuquantum-python-cu${{ steps.config.outputs.cuda_major }}==25.06
8896
# The following tests are needed for docs/sphinx/examples/qec/python/tensor_network_decoder.py.
8997
if [ "$(uname -m)" == "x86_64" ]; then
9098
# Stim is not currently available on manylinux ARM wheels, so only

.github/workflows/all_libs_release.yaml

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ jobs:
2626
{ arch: arm64, gpu: a100 },
2727
{ arch: amd64, gpu: a100 },
2828
]
29+
cuda_version: ['12.6']
2930
runs-on: linux-${{ matrix.runner.arch }}-gpu-${{ matrix.runner.gpu }}-latest-1
3031
container:
3132
image: ${{ format('ghcr.io/nvidia/cudaqx-dev:{0}-{1}', inputs.release-number, matrix.runner.arch) }}
@@ -74,7 +75,13 @@ jobs:
7475
echo "QEC_EXTERNAL_DECODERS=$(pwd)/tmp/lib/decoder-plugins/libcudaq-qec-nv-qldpc-decoder.so" >> $GITHUB_ENV
7576
fi
7677
shell: bash
77-
78+
79+
- name: Configure
80+
id: config
81+
run: |
82+
cuda_major=`echo ${{ matrix.cuda_version }} | cut -d . -f1`
83+
echo "cuda_major=$cuda_major" >> $GITHUB_OUTPUT
84+
7885
# ========================================================================
7986
# Build
8087
# ========================================================================
@@ -84,20 +91,21 @@ jobs:
8491
uses: ./.github/actions/build-lib
8592
with:
8693
lib: "all"
94+
cuda_version: ${{ matrix.cuda_version }}
8795
platform: ${{ matrix.runner.arch }}
8896
install-prefix: /usr/local/cudaq
8997

9098
- name: Save build artifacts
9199
run: |
92100
cmake --build ${{ steps.build.outputs.build-dir }} --target zip_installed_files
93101
cd ${{ steps.build.outputs.build-dir }}
94-
mv installed_files.zip installed_files-${{ matrix.runner.arch }}.zip
102+
mv installed_files.zip installed_files-${{ matrix.runner.arch }}-cu${{ matrix.cuda_version}}.zip
95103
96104
- name: Upload build artifacts
97105
uses: actions/upload-artifact@v4
98106
with:
99-
name: installed_files-${{ matrix.runner.arch }}
100-
path: ${{ steps.build.outputs.build-dir }}/installed_files-${{ matrix.runner.arch }}.zip
107+
name: installed_files-${{ matrix.runner.arch }}-cu${{ matrix.cuda_version}}
108+
path: ${{ steps.build.outputs.build-dir }}/installed_files-${{ matrix.runner.arch }}-cu${{ matrix.cuda_version}}.zip
101109

102110
# ========================================================================
103111
# Run tests
@@ -113,7 +121,7 @@ jobs:
113121
- name: Install python requirements
114122
env:
115123
LD_LIBRARY_PATH: ${{ env.MPI_PATH }}/lib:${{ env.LD_LIBRARY_PATH }}
116-
run: pip install numpy pytest cupy-cuda12x cuquantum-cu12 torch lightning ml_collections mpi4py transformers quimb opt_einsum torch
124+
run: pip install numpy pytest cupy-cuda${{ steps.config.outputs.cuda_major }}x cuquantum-cu${{ steps.config.outputs.cuda_major }} torch lightning ml_collections mpi4py transformers quimb opt_einsum torch
117125

118126
- name: Run Python tests
119127
env:

.github/workflows/build_dev.yaml

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ jobs:
2525
strategy:
2626
matrix:
2727
platform: [amd64, arm64]
28+
cuda_version: ['12.6']
2829
fail-fast: false
2930
runs-on: linux-${{ matrix.platform }}-cpu8
3031
steps:
@@ -77,10 +78,10 @@ jobs:
7778
echo "Versioned release: $ver"
7879
other_tag=$ver
7980
fi
80-
TAGS="-t ghcr.io/nvidia/cudaqx-dev:${{ steps.get-cudaq-version-short.outputs.commit_date }}-${{ steps.get-cudaq-version-short.outputs.shortref }}-${{ matrix.platform }}"
81-
TAGS+=" -t ghcr.io/nvidia/cudaqx-dev:${{ steps.get-cudaq-version-short.outputs.shortref }}-${{ matrix.platform }}"
82-
TAGS+=" -t ghcr.io/nvidia/cudaqx-dev:${other_tag}-${{ matrix.platform }}"
83-
docker build $TAGS -f docker/build_env/cudaqx.dev.Dockerfile . --build-arg base_image=ghcr.io/nvidia/cuda-quantum-devdeps:ext-${{ matrix.platform }}-cu12.6-gcc11-main
81+
TAGS="-t ghcr.io/nvidia/cudaqx-dev:${{ steps.get-cudaq-version-short.outputs.commit_date }}-${{ steps.get-cudaq-version-short.outputs.shortref }}-${{ matrix.platform }}-cu${{ matrix.cuda_version }}"
82+
TAGS+=" -t ghcr.io/nvidia/cudaqx-dev:${{ steps.get-cudaq-version-short.outputs.shortref }}-${{ matrix.platform }}-cu${{ matrix.cuda_version }}"
83+
TAGS+=" -t ghcr.io/nvidia/cudaqx-dev:${other_tag}-${{ matrix.platform }}-cu${{ matrix.cuda_version }}"
84+
docker build $TAGS -f docker/build_env/cudaqx.dev.Dockerfile . --build-arg base_image=ghcr.io/nvidia/cuda-quantum-devdeps:ext-${{ matrix.platform }}-cu${{ matrix.cuda_version }}-gcc11-main
8485
docker push -a ghcr.io/nvidia/cudaqx-dev
8586
shell: bash --noprofile --norc -euo pipefail {0}
8687

@@ -91,6 +92,7 @@ jobs:
9192
matrix:
9293
python: ['3.11', '3.12', '3.13']
9394
platform: ['amd64', 'arm64']
95+
cuda_version: ['12.6']
9496
fail-fast: false
9597
runs-on: linux-${{ matrix.platform }}-cpu8
9698
steps:
@@ -150,7 +152,7 @@ jobs:
150152
context: cudaq
151153
file: cudaq/docker/release/cudaq.wheel.Dockerfile
152154
build-args: |
153-
base_image=ghcr.io/nvidia/cuda-quantum-devdeps:manylinux-${{ matrix.platform }}-cu12.6-gcc11-main
155+
base_image=ghcr.io/nvidia/cuda-quantum-devdeps:manylinux-${{ matrix.platform }}-cu${{ matrix.cuda_version }}-gcc11-main
154156
release_version=0.99.99
155157
python_version=${{ matrix.python }}
156158
outputs: type=local,dest=/tmp/wheels
@@ -163,8 +165,8 @@ jobs:
163165
cp /tmp/wheels/*.whl cudaq-wheels/
164166
165167
# Perform build
166-
TAGS="-t ghcr.io/nvidia/cudaqx-dev:${{ steps.get-cudaq-version-short.outputs.commit_date }}-${{ steps.get-cudaq-version-short.outputs.shortref }}-py${{ matrix.python }}-${{ matrix.platform }}"
167-
TAGS+=" -t ghcr.io/nvidia/cudaqx-dev:${{ steps.get-cudaq-version-short.outputs.shortref }}-py${{ matrix.python }}-${{ matrix.platform }}"
168+
TAGS="-t ghcr.io/nvidia/cudaqx-dev:${{ steps.get-cudaq-version-short.outputs.commit_date }}-${{ steps.get-cudaq-version-short.outputs.shortref }}-py${{ matrix.python }}-${{ matrix.platform }}-cu${{ matrix.cuda_version }}"
169+
TAGS+=" -t ghcr.io/nvidia/cudaqx-dev:${{ steps.get-cudaq-version-short.outputs.shortref }}-py${{ matrix.python }}-${{ matrix.platform }}-cu${{ matrix.cuda_version }}"
168170
169171
other_tag="latest"
170172
is_versioned=${{ startsWith(github.ref_name, 'releases/') }}
@@ -174,8 +176,8 @@ jobs:
174176
other_tag=$ver
175177
fi
176178
177-
TAGS+=" -t ghcr.io/nvidia/cudaqx-dev:${other_tag}-py${{ matrix.python }}-${{ matrix.platform }}"
178-
BUILDARGS="--build-arg base_image=ghcr.io/nvidia/cuda-quantum-devdeps:manylinux-${{ matrix.platform }}-cu12.6-gcc11-main"
179+
TAGS+=" -t ghcr.io/nvidia/cudaqx-dev:${other_tag}-py${{ matrix.python }}-${{ matrix.platform }}-cu${{ matrix.cuda_version }}"
180+
BUILDARGS="--build-arg base_image=ghcr.io/nvidia/cuda-quantum-devdeps:manylinux-${{ matrix.platform }}-cu${{ matrix.cuda_version }}-gcc11-main"
179181
BUILDARGS+=" --build-arg python_version=${{ matrix.python }}"
180182
# For some reason, this fails on amd64 unless DOCKER_BUILDKIT=0 is set.
181183
# The exact error is: too many open files.

.github/workflows/build_wheels.yaml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,16 +49,16 @@ jobs:
4949
# easier to rely on their's devdeps images to do the building.
5050
# FIXME: there is no guarantee that this CUDA-Q image aligns with the CUDA-Q
5151
# commit that we are trying to align with.
52-
container: ghcr.io/nvidia/cuda-quantum-devdeps:manylinux-${{ matrix.platform }}-${{ matrix.toolchain.id }}-main
52+
container: ghcr.io/nvidia/cuda-quantum-devdeps:manylinux-${{ matrix.platform }}-cu${{ matrix.cuda_version }}-gcc11-main
5353
permissions: write-all
5454
strategy:
5555
fail-fast: false
5656
matrix:
5757
python: ['3.11', '3.12', '3.13']
5858
platform: ['amd64', 'arm64']
59+
cuda_version: ['12.6']
5960
toolchain:
60-
- id: cu12.6-gcc11
61-
cc: gcc-11
61+
- cc: gcc-11
6262
cxx: g++-11
6363
build-type: Release
6464

@@ -133,6 +133,7 @@ jobs:
133133
fail-fast: false
134134
matrix:
135135
platform: ['amd64', 'arm64']
136+
cuda_version: ['12.6']
136137
# Use 32 CPUs rather than 8 (above) because we are only spawning one job per
137138
# platform rather than one job per Python version per platform.
138139
runs-on: ${{ startsWith(github.repository, 'NVIDIA/cudaqx') && format('linux-{0}-cpu32', matrix.platform) || 'ubuntu-latest' }}
@@ -153,6 +154,7 @@ jobs:
153154
- name: Get CUDAQ wheels
154155
uses: ./.github/actions/get-cudaq-wheels
155156
with:
157+
cuda_version: ${{ matrix.cuda_version }}
156158
repo: ${{ steps.get-cudaq-version.outputs.repo }}
157159
ref: ${{ steps.get-cudaq-version.outputs.ref }}
158160
token: ${{ secrets.CUDAQ_ACCESS_TOKEN }}
@@ -233,7 +235,7 @@ jobs:
233235
if: ${{ !failure() && !cancelled() }}
234236
runs-on: linux-${{ matrix.runner.arch }}-gpu-${{ matrix.runner.gpu }}-latest-1
235237
container:
236-
image: nvidia/cuda:12.6.0-base-ubuntu24.04
238+
image: nvidia/cuda:${{ matrix.cuda_version }}.0-base-ubuntu24.04
237239
# Enable this if you want to collect core files. (You may might to enable
238240
# Debug builds if you're doing this.)
239241
#options: --privileged --ulimit core=-1 --security-opt seccomp=unconfined
@@ -250,6 +252,7 @@ jobs:
250252
{ arch: amd64, gpu: a100 },
251253
]
252254
python: ['3.11', '3.12', '3.13']
255+
cuda_version: ['12.6']
253256

254257
steps:
255258
- name: Get code

.github/workflows/cudaq_cache.yaml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,9 @@ jobs:
2424
fail-fast: false
2525
matrix:
2626
platform: ['amd64', 'arm64']
27+
cuda_version: ['12.6']
2728
runs-on: ${{ startsWith(github.repository, 'NVIDIA/cudaqx') && format('linux-{0}-cpu32', matrix.platform) || 'ubuntu-latest' }}
28-
container: ghcr.io/nvidia/cuda-quantum-devdeps:ext-${{ matrix.platform }}-cu12.6-gcc11-main
29+
container: ghcr.io/nvidia/cuda-quantum-devdeps:ext-${{ matrix.platform }}-cu${{ matrix.cuda_version }}-gcc11-main
2930
permissions:
3031
actions: write
3132
contents: read
@@ -36,6 +37,12 @@ jobs:
3637
with:
3738
set-safe-directory: true
3839

40+
- name: Configure
41+
id: config
42+
run: |
43+
cuda_major=`echo ${{ matrix.cuda_version }} | cut -d . -f1`
44+
echo "cuda_major=$cuda_major" >> $GITHUB_OUTPUT
45+
3946
- name: Get required CUDAQ version
4047
id: get-cudaq-version
4148
uses: ./.github/actions/get-cudaq-version
@@ -48,5 +55,5 @@ jobs:
4855
token: ${{ secrets.CUDAQ_ACCESS_TOKEN }}
4956
save-build: true
5057
save-ccache: true
51-
platform: ${{ matrix.platform }}
58+
platform: ${{ matrix.platform }}-cu${{ steps.config.outputs.cuda_major }}
5259

.github/workflows/docs.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ jobs:
4949
repo: ${{ steps.get-cudaq-version.outputs.repo }}
5050
ref: ${{ steps.get-cudaq-version.outputs.ref }}
5151
token: ${{ secrets.CUDAQ_ACCESS_TOKEN }}
52-
platform: 'amd64'
52+
platform: 'amd64-cu12' # Just choose one platform for docs
5353

5454
# ========================================================================
5555
# Build docs

.github/workflows/lib_qec.yaml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,9 @@ jobs:
1111
fail-fast: false
1212
matrix:
1313
platform: ['amd64', 'arm64']
14+
cuda_version: ['12.6']
1415
runs-on: ${{ startsWith(github.repository, 'NVIDIA/cudaqx') && format('linux-{0}-cpu8', matrix.platform) || 'ubuntu-latest' }}
15-
container: ghcr.io/nvidia/cuda-quantum-devdeps:ext-${{ matrix.platform }}-cu12.6-gcc11-main
16+
container: ghcr.io/nvidia/cuda-quantum-devdeps:ext-${{ matrix.platform }}-cu${{ matrix.cuda_version }}-gcc11-main
1617
permissions:
1718
actions: write
1819
contents: read
@@ -34,6 +35,12 @@ jobs:
3435
run: |
3536
echo "pr_number=${{ fromJSON(steps.get-pr-info.outputs.pr-info).number }}" >> $GITHUB_OUTPUT
3637
38+
- name: Configure
39+
id: config
40+
run: |
41+
cuda_major=`echo ${{ matrix.cuda_version }} | cut -d . -f1`
42+
echo "cuda_major=$cuda_major" >> $GITHUB_OUTPUT
43+
3744
# ========================================================================
3845
# CUDA Quantum build
3946
# ========================================================================
@@ -49,7 +56,7 @@ jobs:
4956
ref: ${{ steps.get-cudaq-version.outputs.ref }}
5057
token: ${{ secrets.CUDAQ_ACCESS_TOKEN }}
5158
pr-number: ${{ steps.export-pr-info.outputs.pr_number }}
52-
platform: ${{ matrix.platform }}
59+
platform: ${{ matrix.platform }}-cu${{ steps.config.outputs.cuda_major }}
5360

5461
# ========================================================================
5562
# Build library
@@ -78,7 +85,7 @@ jobs:
7885
- name: Install python requirements
7986
shell: bash
8087
run: |
81-
pip install numpy pytest cupy-cuda12x cuquantum-cu12 quimb opt_einsum torch nvidia-cublas-cu12 cuquantum-python-cu12==25.06
88+
pip install numpy pytest cupy-cuda${{ steps.config.outputs.cuda_major }}x cuquantum-cu${{ steps.config.outputs.cuda_major }} quimb opt_einsum torch nvidia-cublas-cu${{ steps.config.outputs.cuda_major }} cuquantum-python-cu${{ steps.config.outputs.cuda_major }}==25.06
8289
# The following tests are needed for docs/sphinx/examples/qec/python/tensor_network_decoder.py.
8390
if [ "$(uname -m)" == "x86_64" ]; then
8491
# Stim is not currently available on manylinux ARM wheels, so only

0 commit comments

Comments
 (0)