Skip to content

Commit e202ed2

Browse files
authored
Add CUDA 13 support and add metapackages (#320)
## Summary This PR adds support for CUDA 13 (preserving full support for CUDA 12). ## Details * Bump CUDA-Q commit to one that supports CUDA 13 (NVIDIA/cuda-quantum#3502) * Produce *2 sets* of wheels, bringing our total number of *regular* wheels to 4: * cudaq-qec-cu12 * cudaq-qec-cu13 * cudaq-solvers-cu12 * cudaq-solvers-cu13 * Additionally, produce meta-packages (cudaq-qec and cudaq-solvers) which will automatically choose the appropriate subpackage. We already have cudaq-qec and cudaq-solvers wheels; these 0.5.0 meta-packages will just replace the older 0.4.0 packages at the time of release. * These meta-packages will contain the same optional dependencies as the child packages. That is - `pip install cudaq-qec[tensor-network-decoder]` will use the metapackage to automatically transform that into `pip install cudaq-qec-cuXY[tensor-network-decoder]`, where `XY` is the appropriate CUDA version. This also applies to `cudaq-solvers[gqe]`. * Matrix the build and test portion of the CI to be running both 12.6 and 13.0. ## Todo (in a separate PR) * Once internal pipelines are updated, update the "release" workflows to incorporate private artifacts from both cu12 and cu13 images. * Consider removing the `torch` dependency, and instead update the docs to have users manually install the version that they want (pending discussion). --------- Signed-off-by: Ben Howe <[email protected]>
1 parent 333a06c commit e202ed2

31 files changed

+907
-64
lines changed

.cudaq_version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"cudaq": {
33
"repository": "NVIDIA/cuda-quantum",
4-
"ref": "7781a8c856b84d5d7714a66ce6a26e4dc804830e"
4+
"ref": "43f539c7e45a0a47c56d43be237ffc673b23222b"
55
}
66
}

.github/actions/get-cudaq-build/build_cudaq.sh

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,13 @@ LAUNCHER=${2:-""}
1313
CC=${3:-"gcc"}
1414
CXX=${4:-"g++"}
1515

16+
# Set CUDA suffix to, for example, "cu12" or "cu13", based on the cuquantum
17+
# package name.
18+
CUDA_SUFFIX=$(pip list | grep cuquantum-cu | head -1 | cut -d' ' -f1 | cut -d'-' -f2)
19+
1620
LLVM_INSTALL_PREFIX=/usr/local/llvm
17-
CUQUANTUM_INSTALL_PREFIX="$(pip show cuquantum-cu12 | grep "Location:" | cut -d " " -f 2)/cuquantum"
18-
CUTENSOR_INSTALL_PREFIX="$(pip show cutensor-cu12 | grep "Location:" | cut -d " " -f 2)/cutensor"
21+
CUQUANTUM_INSTALL_PREFIX="$(pip show cuquantum-${CUDA_SUFFIX} | grep "Location:" | cut -d " " -f 2)/cuquantum"
22+
CUTENSOR_INSTALL_PREFIX="$(pip show cutensor-${CUDA_SUFFIX} | grep "Location:" | cut -d " " -f 2)/cutensor"
1923

2024
cd cudaq
2125

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ runs:
5252
.cudaq_version
5353
run: |
5454
hash=${{ hashFiles(format('{0}', env.to_hash)) }}
55-
echo "main=cudaq-wheels-${{ inputs.platform }}-${{ inputs.ref }}-$hash" >> $GITHUB_OUTPUT
55+
echo "main=cudaq-wheels-${{ inputs.platform }}-cu${{ inputs.cuda_version }}-${{ inputs.ref }}-$hash" >> $GITHUB_OUTPUT
5656
if [[ -n "${{ inputs.pr-number }}" ]]; then
5757
echo "pr=-pr${{ inputs.pr-number }}" >> $GITHUB_OUTPUT
5858
fi

.github/workflows/all_libs.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
fail-fast: false
1212
matrix:
1313
platform: ['amd64', 'arm64']
14-
cuda_version: ['12.6']
14+
cuda_version: ['12.6', '13.0']
1515
runs-on: ${{ startsWith(github.repository, 'NVIDIA/cudaqx') && format('linux-{0}-cpu8', matrix.platform) || 'ubuntu-latest' }}
1616
container: ghcr.io/nvidia/cuda-quantum-devdeps:ext-${{ matrix.platform }}-cu${{ matrix.cuda_version }}-gcc11-main
1717
permissions:

.github/workflows/build_dev.yaml

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
strategy:
2626
matrix:
2727
platform: [amd64, arm64]
28-
cuda_version: ['12.6']
28+
cuda_version: ['12.6', '13.0']
2929
fail-fast: false
3030
runs-on: linux-${{ matrix.platform }}-cpu8
3131
steps:
@@ -71,17 +71,24 @@ jobs:
7171
- name: Build and push
7272
if: ${{ inputs.force_rebuild || steps.check-image.outputs.IMAGE_EXISTS == 'false' }}
7373
run: |
74-
other_tag="latest"
74+
other_tag=""
75+
is_main_branch=${{ github.ref_name == 'main' }}
7576
is_versioned=${{ startsWith(github.ref_name, 'releases/') }}
76-
if ${is_versioned}; then
77+
if ${is_main_branch}; then
78+
other_tag="latest"
79+
elif ${is_versioned}; then
7780
ver=`echo ${{ github.ref_name }} | egrep -o "([0-9]{1,}\.)+[0-9]{1,}"`
7881
echo "Versioned release: $ver"
7982
other_tag=$ver
8083
fi
8184
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 }}"
8285
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
86+
if [ -n "$other_tag" ]; then
87+
TAGS+=" -t ghcr.io/nvidia/cudaqx-dev:${other_tag}-${{ matrix.platform }}-cu${{ matrix.cuda_version }}"
88+
fi
89+
docker build $TAGS -f docker/build_env/cudaqx.dev.Dockerfile . \
90+
--build-arg base_image=ghcr.io/nvidia/cuda-quantum-devdeps:ext-${{ matrix.platform }}-cu${{ matrix.cuda_version }}-gcc11-main \
91+
--build-arg cuda_version=${{ matrix.cuda_version }}
8592
docker push -a ghcr.io/nvidia/cudaqx-dev
8693
shell: bash --noprofile --norc -euo pipefail {0}
8794

@@ -92,7 +99,7 @@ jobs:
9299
matrix:
93100
python: ['3.11', '3.12', '3.13']
94101
platform: ['amd64', 'arm64']
95-
cuda_version: ['12.6']
102+
cuda_version: ['12.6', '13.0']
96103
fail-fast: false
97104
runs-on: linux-${{ matrix.platform }}-cpu8
98105
steps:
@@ -155,6 +162,7 @@ jobs:
155162
base_image=ghcr.io/nvidia/cuda-quantum-devdeps:manylinux-${{ matrix.platform }}-cu${{ matrix.cuda_version }}-gcc11-main
156163
release_version=0.99.99
157164
python_version=${{ matrix.python }}
165+
cuda_version=${{ matrix.cuda_version }}
158166
outputs: type=local,dest=/tmp/wheels
159167

160168
- name: Build and push dev image with prebuilt CUDA-Q wheels
@@ -168,17 +176,23 @@ jobs:
168176
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 }}"
169177
TAGS+=" -t ghcr.io/nvidia/cudaqx-dev:${{ steps.get-cudaq-version-short.outputs.shortref }}-py${{ matrix.python }}-${{ matrix.platform }}-cu${{ matrix.cuda_version }}"
170178
171-
other_tag="latest"
179+
other_tag=""
180+
is_main_branch=${{ github.ref_name == 'main' }}
172181
is_versioned=${{ startsWith(github.ref_name, 'releases/') }}
173-
if ${is_versioned}; then
182+
if ${is_main_branch}; then
183+
other_tag="latest"
184+
elif ${is_versioned}; then
174185
ver=`echo ${{ github.ref_name }} | egrep -o "([0-9]{1,}\.)+[0-9]{1,}"`
175186
echo "Versioned release: $ver"
176187
other_tag=$ver
177188
fi
178189
179-
TAGS+=" -t ghcr.io/nvidia/cudaqx-dev:${other_tag}-py${{ matrix.python }}-${{ matrix.platform }}-cu${{ matrix.cuda_version }}"
190+
if [ -n "$other_tag" ]; then
191+
TAGS+=" -t ghcr.io/nvidia/cudaqx-dev:${other_tag}-py${{ matrix.python }}-${{ matrix.platform }}-cu${{ matrix.cuda_version }}"
192+
fi
180193
BUILDARGS="--build-arg base_image=ghcr.io/nvidia/cuda-quantum-devdeps:manylinux-${{ matrix.platform }}-cu${{ matrix.cuda_version }}-gcc11-main"
181194
BUILDARGS+=" --build-arg python_version=${{ matrix.python }}"
195+
BUILDARGS+=" --build-arg cuda_version=${{ matrix.cuda_version }}"
182196
# For some reason, this fails on amd64 unless DOCKER_BUILDKIT=0 is set.
183197
# The exact error is: too many open files.
184198
DOCKER_BUILDKIT=0 docker build $TAGS $BUILDARGS -f docker/build_env/cudaqx.wheel.Dockerfile .

0 commit comments

Comments
 (0)