Skip to content

Commit a3ab928

Browse files
Merge branch 'main' into warn-draw
2 parents 0152ed8 + f662540 commit a3ab928

File tree

233 files changed

+6680
-2104
lines changed

Some content is hidden

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

233 files changed

+6680
-2104
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
nvidia-mgpu-repo: cuda-quantum/cuquantum-mgpu.git
2-
nvidia-mgpu-commit: ef144598fe5beab4b80edbd30e455906373e2e0e
2+
nvidia-mgpu-commit: 438397cdc7529293c78a399243c63dc3f6c3886a

.github/workflows/config/spelling_allowlist.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -354,6 +354,7 @@ toolchain
354354
toolchains
355355
toolset
356356
transmon
357+
transpile
357358
trotterization
358359
uccsd
359360
unary

.github/workflows/docker_images.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -494,9 +494,7 @@ jobs:
494494
495495
platform_tag=${{ needs.metadata.outputs.platform_tag }}
496496
cuda_major=`echo ${{ inputs.cuda_version }} | cut -d . -f1`
497-
if [ "$cuda_major" == "11" ]; then
498-
deprecation_notice="**Note**: Support for CUDA 11 will be removed in future releases. Please update to CUDA 12."
499-
fi
497+
deprecation_notice=""
500498
image_tag=${platform_tag:+$platform_tag-}${cuda_major:+cu${cuda_major}-}
501499
if ${{ github.event.pull_request.number != '' }} || [ -n "$(echo ${{ github.ref_name }} | grep pull-request/)" ]; then
502500
pr_number=`echo ${{ github.ref_name }} | grep -o [0-9]*`
@@ -843,6 +841,7 @@ jobs:
843841
# In containers without GPU support, UCX does not work properly since it is configured to work with GPU-support.
844842
# Hence, don't enforce UCX when running these tests.
845843
docker exec cuda-quantum bash -c "python3 -m pip install --break-system-packages pandas scipy seaborn h5py contfrac"
844+
docker exec cuda-quantum bash -c "sudo apt install -y python3-venv"
846845
(docker exec cuda-quantum bash -c "unset OMPI_MCA_pml && set -o pipefail && bash validate_container.sh | tee /tmp/validation.out") && passed=true || passed=false
847846
docker cp cuda-quantum:"/tmp/validation.out" /tmp/validation.out
848847
docker stop cuda-quantum

.github/workflows/integration_tests.yml

Lines changed: 391 additions & 410 deletions
Large diffs are not rendered by default.

.github/workflows/publishing.yml

Lines changed: 26 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -851,7 +851,7 @@ jobs:
851851
# Seems like we will need to install build-essential for resolving nbconvert issue `RuntimeError: Unsupported compiler -- at least C++11 support is needed!`"
852852
# Given here: https://github.com/NVIDIA/cuda-quantum/blob/main/docs/sphinx/applications/python/qchem/cppe_lib.py#L18
853853
# and https://github.com/jupyter/nbconvert/issues/1742
854-
sudo apt-get update && sudo apt-get install build-essential python3-dev -y
854+
sudo apt-get update && sudo apt-get install -y build-essential python3-dev python3-venv python3-pip
855855
856856
backends_to_test=`\
857857
for file in $(ls $CUDA_QUANTUM_PATH/targets/*.yml); \
@@ -964,24 +964,15 @@ jobs:
964964
dpkg -i cuda-keyring_1.1-1_all.deb
965965
cuda_version_suffix="$(echo ${{ matrix.cuda_version }} | tr . -)"
966966
apt-get update
967-
if [ $(echo ${{ matrix.cuda_version }} | cut -d . -f1) -gt 11 ]; then
968-
apt-get install -y --no-install-recommends \
969-
cuda-cudart-$cuda_version_suffix \
970-
cuda-nvrtc-$cuda_version_suffix \
971-
libnvjitlink-$cuda_version_suffix \
972-
libcurand-$cuda_version_suffix \
973-
libcublas-$cuda_version_suffix \
974-
libcusparse-$cuda_version_suffix \
975-
libcusolver-$cuda_version_suffix
976-
else
977-
apt-get install -y --no-install-recommends \
978-
cuda-cudart-$cuda_version_suffix \
979-
cuda-nvrtc-$cuda_version_suffix \
980-
libcurand-$cuda_version_suffix \
981-
libcublas-$cuda_version_suffix \
982-
libcusparse-$cuda_version_suffix \
983-
libcusolver-$cuda_version_suffix
984-
fi
967+
apt-get install -y --no-install-recommends \
968+
cuda-cudart-$cuda_version_suffix \
969+
cuda-cudart-dev-$cuda_version_suffix \
970+
cuda-nvrtc-$cuda_version_suffix \
971+
libnvjitlink-$cuda_version_suffix \
972+
libcurand-$cuda_version_suffix \
973+
libcublas-$cuda_version_suffix \
974+
libcusparse-$cuda_version_suffix \
975+
libcusolver-$cuda_version_suffix
985976
986977
- name: Runtime dependencies (dnf)
987978
if: startsWith(matrix.os_image, 'redhat')
@@ -1048,7 +1039,7 @@ jobs:
10481039
strategy:
10491040
matrix:
10501041
platform: ['amd64-gpu-a100', 'arm64-gpu-a100']
1051-
cuda_major: ['', '11', '12']
1042+
cuda_major: ['', '12', '13']
10521043
fail-fast: false
10531044

10541045
runs-on: linux-${{ matrix.platform }}-latest-1
@@ -1086,20 +1077,22 @@ jobs:
10861077
# These simple steps are only expected to work for
10871078
# test cases that don't require MPI.
10881079
# Create clean python3 environment.
1089-
apt-get update && apt-get install -y --no-install-recommends python3 python3-pip
1090-
mkdir -p /tmp/packages && mv /tmp/wheels/* /tmp/packages && rmdir /tmp/wheels
1080+
apt-get update && apt-get install -y --no-install-recommends python3 python3-pip python3-venv
10911081
1092-
python3 -m pip install pypiserver
1093-
server=`find / -name pypi-server -executable -type f`
1094-
$server run -p 8080 /tmp/packages &
1082+
# Make a place for local wheels
1083+
mkdir -p /tmp/packages && mv /tmp/wheels/* /tmp/packages && rmdir /tmp/wheels
10951084
1085+
# Create and activate virtual environment
1086+
python3 -m venv /opt/cudaq-venv
1087+
source /opt/cudaq-venv/bin/activate
1088+
10961089
if [ -n "${{ matrix.cuda_major }}" ]; then
10971090
pip install cuda-quantum-cu${{ matrix.cuda_major }}==${{ needs.assets.outputs.cudaq_version }} -v \
1098-
--extra-index-url http://localhost:8080
1091+
--find-links "file:///tmp/packages"
10991092
else
11001093
pip install --upgrade pip
11011094
pip install cudaq==${{ needs.assets.outputs.cudaq_version }} -v \
1102-
--extra-index-url http://localhost:8080 \
1095+
--find-links "file:///tmp/packages" \
11031096
2>&1 | tee /tmp/install.out
11041097
11051098
if [ -z "$(cat /tmp/install.out | grep -o 'Autodetection succeeded')" ]; then
@@ -1143,7 +1136,10 @@ jobs:
11431136

11441137
strategy:
11451138
matrix:
1146-
cuda_version: ['12.4', '13.0']
1139+
# Note: this is the version of the conda 'nvidia/label/cuda' channel.
1140+
# Specifically, 'nvidia/label/cuda-13.0.0' does not contain proper CUDA 13 packages,
1141+
# hence we need to use later channels.
1142+
cuda_version_conda: ['12.6.0', '13.0.2']
11471143
fail-fast: false
11481144

11491145
# Must have environment to access environment secreats
@@ -1203,10 +1199,10 @@ jobs:
12031199
source validate_pycudaq.sh \
12041200
-v ${{ needs.assets.outputs.cudaq_version }} \
12051201
-i /tmp/packages -f /tmp \
1206-
-c ${{ matrix.cuda_version }} -p 3.12
1202+
-c ${{ matrix.cuda_version_conda }} -p 3.12
12071203
set -e # Re-enable exit code error checking
12081204
1209-
expected_dependency=cuda-quantum-cu$(echo ${{ matrix.cuda_version }} | cut -d . -f1)
1205+
expected_dependency=cuda-quantum-cu$(echo ${{ matrix.cuda_version_conda }} | cut -d . -f1)
12101206
if [ -z "$(python3 -m pip list | grep ${expected_dependency})" ]; then
12111207
echo "::error::Missing installation of ${expected_dependency} package."
12121208
exit 1

.github/workflows/python_metapackages.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ jobs:
6060
package_name=cudaq
6161
cuda_version_requirement="12.x or 13.x"
6262
cuda_version_conda=12.4.0 # only used as example in the install script
63-
deprecation_notice="**Note**: Support for CUDA 11 will be removed in future releases. Please update to CUDA 12."
63+
deprecation_notice=""
6464
cat python/README.md.in > python/metapackages/README.md
6565
for variable in package_name cuda_version_requirement cuda_version_conda deprecation_notice; do
6666
sed -i "s/.{{[ ]*$variable[ ]*}}/${!variable}/g" python/metapackages/README.md

.github/workflows/test_in_devenv.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ jobs:
9191
shell: bash
9292
run: |
9393
cd $CUDAQ_REPO_ROOT
94-
python3 -m pip install iqm-client==16.1
94+
python3 -m pip install iqm-client==28.0.0
9595
python3 -m pytest -v --durations=0 build/python/tests/interop/
9696
pytest_status=$?
9797
if [ ! $pytest_status -eq 0 ]; then
@@ -136,7 +136,7 @@ jobs:
136136
# Rerun the MPI plugin test
137137
cd $CUDAQ_REPO_ROOT
138138
ctest --test-dir build -R MPIApiTest -V
139-
external_plugin_status=$?
139+
external_plugin_status=$?
140140
if [ ! $external_plugin_status -eq 0 ] ; then
141141
echo "::error file=test_in_devenv.yml::Test CUDA Quantum MPI Plugin Activation failed with status $external_plugin_status."
142142
exit 1
@@ -153,7 +153,7 @@ jobs:
153153
docker run --name cuda-quantum-dev cuda-quantum-dev:local
154154
docker export cuda-quantum-dev > $output_directory/$filename.tar
155155
docker rm -f cuda-quantum-dev
156-
156+
157157
echo "filename=$filename" >> $GITHUB_OUTPUT
158158
echo "output_directory=$output_directory" >> $GITHUB_OUTPUT
159159
@@ -238,10 +238,10 @@ jobs:
238238
apt-get update -y && apt-get install -y python3-venv
239239
240240
VENV_DIR="$HOME/.venvs/cudaq"
241-
python3 -m venv "$VENV_DIR"
241+
python3 -m venv --system-site-packages "$VENV_DIR"
242242
. "$VENV_DIR/bin/activate"
243243
244-
pip install iqm-client -vvv
244+
pip install iqm-client==28.0.0
245245
pip install . -vvv
246246
pyinstall_status=$?
247247
if [ ! $pyinstall_status -eq 0 ]; then
@@ -265,9 +265,9 @@ jobs:
265265
if [ ! $pytest_status -eq 0 ] && [ ! $pytest_status -eq 5 ]; then
266266
echo "::error file=test_in_devenv.yml::Python $backendTest tests failed with status $pytest_status."
267267
exit 1
268-
fi
269-
done
270-
268+
fi
269+
done
270+
271271
- name: Save environment
272272
id: env_save
273273
if: inputs.export_environment
@@ -279,7 +279,7 @@ jobs:
279279
docker run --name dev_env dev_env:local
280280
docker export dev_env > $output_directory/$filename.tar
281281
docker rm -f dev_env
282-
282+
283283
echo "filename=$filename" >> $GITHUB_OUTPUT
284284
echo "output_directory=$output_directory" >> $GITHUB_OUTPUT
285285

.licenserc.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ header:
4141
- 'include/cudaq/Optimizer/CodeGen/OptUtils.h'
4242
- 'lib/Optimizer/CodeGen/OptUtils.cpp'
4343
- 'runtime/cudaq/algorithms/optimizers/nlopt/nlopt-src'
44+
- 'python/metapackages/MANIFEST.in'
4445

4546
comment: on-failure
4647

docker/build/assets.Dockerfile

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,8 @@ RUN source /cuda-quantum/scripts/configure_build.sh && \
164164

165165
## [Python support]
166166
FROM prereqs AS python_build
167-
ADD "pyproject.toml" /cuda-quantum/pyproject.toml
167+
# Bring all possible templates into the image, then pick the exact one
168+
ADD pyproject.toml.cu* /cuda-quantum/
168169
ADD "python" /cuda-quantum/python
169170
ADD "cmake" /cuda-quantum/cmake
170171
ADD "include" /cuda-quantum/include
@@ -186,22 +187,13 @@ RUN dnf install -y --nobest --setopt=install_weak_deps=False ${PYTHON}-devel &&
186187
${PYTHON} -m ensurepip --upgrade && \
187188
${PYTHON} -m pip install numpy build auditwheel patchelf
188189

189-
RUN cd /cuda-quantum && source scripts/configure_build.sh && \
190-
if [ "${CUDA_VERSION#12.}" != "${CUDA_VERSION}" ]; then \
191-
cublas_version=12.0 && \
192-
cusolver_version=11.4 && \
193-
cuda_runtime_version=12.0 && \
194-
cuda_nvrtc_version=12.0 && \
195-
cupy_version=13.4.1 && \
196-
sed -i "s/-cu13/-cu12/g" pyproject.toml && \
197-
sed -i "s/-cuda13/-cuda12/g" pyproject.toml && \
198-
sed -i -E "s/cupy-cuda[0-9]+x/cupy-cuda12x/g" pyproject.toml && \
199-
sed -i -E "s/(cupy-cuda[0-9]+x? ~= )[0-9\.]*/\1${cupy_version}/g" pyproject.toml && \
200-
sed -i -E "s/(nvidia-cublas-cu[0-9]* ~= )[0-9\.]*/\1${cublas_version}/g" pyproject.toml && \
201-
sed -i -E "s/(nvidia-cusolver-cu[0-9]* ~= )[0-9\.]*/\1${cusolver_version}/g" pyproject.toml && \
202-
sed -i -E "s/(nvidia-cuda-nvrtc-cu[0-9]* ~= )[0-9\.]*/\1${cuda_nvrtc_version}/g" pyproject.toml && \
203-
sed -i -E "s/(nvidia-cuda-runtime-cu[0-9]* ~= )[0-9\.]*/\1${cuda_runtime_version}/g" pyproject.toml; \
204-
fi && \
190+
RUN cd /cuda-quantum && \
191+
. scripts/configure_build.sh && \
192+
case "${CUDA_VERSION%%.*}" in \
193+
12) cp pyproject.toml.cu12 pyproject.toml || true ;; \
194+
13) cp pyproject.toml.cu13 pyproject.toml || true ;; \
195+
*) echo "Unsupported CUDA_VERSION=${CUDA_VERSION}"; exit 1 ;; \
196+
esac && \
205197
# Needed to retrigger the LLVM build, since the MLIR Python bindings
206198
# are not built in the prereqs stage.
207199
rm -rf "${LLVM_INSTALL_PREFIX}" && \

docker/build/devdeps.ext.Dockerfile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,9 @@ ENV PIP_BREAK_SYSTEM_PACKAGES=1
172172

173173
# Install cuQuantum dependencies, including cuTensor.
174174
# Install cupy version 13.4.1
175+
# Note: for docker images, we fixed the cuquantum version (with `==`) to avoid unintentional upgrades.
176+
# e.g., API marked as deprecated in a minor version upgrade may break build.
177+
# For Python pip installations, we allow minor version upgrades with `~=`, assuming the API is stable.
175178
RUN apt-get update && apt-get install -y --no-install-recommends \
176179
python3 python3-pip && \
177180
apt-get autoremove -y && apt-get clean && rm -rf /var/lib/apt/lists/* && \
@@ -180,7 +183,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
180183
else \
181184
cupy_version=13.4.1; \
182185
fi && \
183-
python3 -m pip install --break-system-packages cupy-cuda$(echo $CUDA_VERSION | cut -d . -f1)x==${cupy_version} cuquantum-cu$(echo $CUDA_VERSION | cut -d . -f1)==25.09 && \
186+
python3 -m pip install --break-system-packages cupy-cuda$(echo $CUDA_VERSION | cut -d . -f1)x==${cupy_version} cuquantum-cu$(echo $CUDA_VERSION | cut -d . -f1)==25.09.1 && \
184187
if [ "$(python3 --version | grep -o [0-9\.]* | cut -d . -f -2)" != "3.12" ]; then \
185188
echo "expecting Python version 3.12"; \
186189
fi

0 commit comments

Comments
 (0)