Skip to content

Commit 229bd2a

Browse files
authored
Script and config updates in preparation for 0.5.0 (#341)
This includes: * Bumping cuda-quantum wheel dependencies from 0.12 to 0.13. * Updating the GitHub build scripts to accept draft release artifacts that *only* hold the nv-qldpc-decoder (as opposed to duplicates of the things that are built on the public repo). * Adds CUDA 13 to .github/workflows/all_libs_release.yaml * Update some of our tests to not fail if they are nv-qldpc-decoder tests that are being run in a CPU-only environment (like some of our GitHub scripts do) --------- Signed-off-by: Ben Howe <[email protected]>
1 parent fffba47 commit 229bd2a

File tree

8 files changed

+63
-26
lines changed

8 files changed

+63
-26
lines changed

.github/workflows/all_libs.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,10 @@ jobs:
106106
LD_LIBRARY_PATH: ${{ env.MPI_PATH }}/lib:${{ env.LD_LIBRARY_PATH }}
107107
shell: bash
108108
run: |
109-
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 cuquantum-python-cu${{ steps.config.outputs.cuda_major }}==25.09
109+
# Install the correct torch first.
110+
cuda_no_dot=$(echo ${{ matrix.cuda_version }} | sed 's/\.//')
111+
pip install torch==2.9.0 --index-url https://download.pytorch.org/whl/cu${cuda_no_dot}
112+
pip install numpy pytest cupy-cuda${{ steps.config.outputs.cuda_major }}x cuquantum-cu${{ steps.config.outputs.cuda_major }} lightning ml_collections mpi4py transformers quimb opt_einsum nvidia-cublas cuquantum-python-cu${{ steps.config.outputs.cuda_major }}==25.09
110113
# The following tests are needed for docs/sphinx/examples/qec/python/tensor_network_decoder.py.
111114
if [ "$(uname -m)" == "x86_64" ]; then
112115
# Stim is not currently available on manylinux ARM wheels, so only

.github/workflows/all_libs_release.yaml

Lines changed: 33 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,11 @@ on:
1010
assets_repo:
1111
type: string
1212
description: Retrieve assets from a draft release from this repo (e.g. NVIDIA/cudaqx)
13+
default: 'NVIDIA/cudaqx'
1314
required: false
1415
assets_tag:
1516
type: string
16-
description: Retrieve assets from a draft release with this tag (e.g. installed_files-1)
17+
description: Retrieve assets from a draft release with this tag (e.g. docker-files-123)
1718
required: false
1819

1920
jobs:
@@ -26,19 +27,29 @@ jobs:
2627
{ arch: arm64, gpu: a100 },
2728
{ arch: amd64, gpu: a100 },
2829
]
29-
cuda_version: ['12.6']
30+
cuda_version: ['12.6', '13.0']
3031
runs-on: linux-${{ matrix.runner.arch }}-gpu-${{ matrix.runner.gpu }}-latest-1
3132
container:
32-
image: ${{ format('ghcr.io/nvidia/cudaqx-dev:{0}-{1}', inputs.release-number, matrix.runner.arch) }}
33+
image: >-
34+
${{
35+
inputs.release-number == '0.0.0'
36+
&& format('ghcr.io/nvidia/cudaqx-dev:{0}-{1}-cu{2}', 'latest', matrix.runner.arch, matrix.cuda_version)
37+
|| format('ghcr.io/nvidia/cudaqx-dev:{0}-{1}', inputs.release-number, matrix.runner.arch)
38+
}}
3339
env:
3440
NVIDIA_VISIBLE_DEVICES: ${{ env.NVIDIA_VISIBLE_DEVICES }}
3541
permissions: write-all
3642
steps:
43+
- name: Install dependencies
44+
run: |
45+
apt update && apt install -y --no-install-recommends zip unzip patchelf git-lfs
46+
3747
- name: Checkout repository
3848
uses: actions/checkout@v4
3949
with:
40-
ref: releases/v${{ inputs.release-number }}
50+
ref: ${{ inputs.release-number == '0.0.0' && 'main' || format('releases/v{0}', inputs.release-number) }}
4151
set-safe-directory: true
52+
lfs: true # download assets file(s) for TRT tests
4253

4354
- name: Set git safe directory
4455
run: git config --global --add safe.directory $GITHUB_WORKSPACE
@@ -52,10 +63,6 @@ jobs:
5263
echo "Setting CUDAQX_QEC_VERSION=${{ inputs.release-number }}" >> $GITHUB_STEP_SUMMARY
5364
echo "Setting CUDAQX_SOLVERS_VERSION=${{ inputs.release-number }}" >> $GITHUB_STEP_SUMMARY
5465
55-
- name: Install dependencies
56-
run: |
57-
apt update && apt install -y --no-install-recommends zip unzip patchelf
58-
5966
- name: Fetch assets and set QEC_EXTERNAL_DECODERS
6067
env:
6168
GH_TOKEN: ${{ github.token }}
@@ -71,8 +78,8 @@ jobs:
7178
gh release view -R ${{ inputs.assets_repo }} ${{ inputs.assets_tag }} >> $GITHUB_STEP_SUMMARY
7279
# Extract the decoder that needs to be embedded in the release
7380
mkdir -p tmp
74-
unzip -d tmp installed_files-${{ matrix.runner.arch }}.zip
75-
echo "QEC_EXTERNAL_DECODERS=$(pwd)/tmp/lib/decoder-plugins/libcudaq-qec-nv-qldpc-decoder.so" >> $GITHUB_ENV
81+
tar -C tmp -xzvf nv-qldpc-decoder-${{ matrix.runner.arch }}_ubuntu24.04_cuda${{ matrix.cuda_version }}_release.tar.gz
82+
echo "QEC_EXTERNAL_DECODERS=$(pwd)/tmp/libcudaq-qec-nv-qldpc-decoder.so" >> $GITHUB_ENV
7683
fi
7784
shell: bash
7885

@@ -97,15 +104,15 @@ jobs:
97104

98105
- name: Save build artifacts
99106
run: |
100-
cmake --build ${{ steps.build.outputs.build-dir }} --target zip_installed_files
107+
cmake --build ${{ steps.build.outputs.build-dir }} --target zip_installed_files --parallel
101108
cd ${{ steps.build.outputs.build-dir }}
102-
mv installed_files.zip installed_files-${{ matrix.runner.arch }}-cu${{ matrix.cuda_version}}.zip
109+
mv installed_files.zip installed_files-${{ matrix.runner.arch }}-cu${{ matrix.cuda_version }}.zip
103110
104111
- name: Upload build artifacts
105112
uses: actions/upload-artifact@v4
106113
with:
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
114+
name: installed_files-${{ matrix.runner.arch }}-cu${{ matrix.cuda_version }}
115+
path: ${{ steps.build.outputs.build-dir }}/installed_files-${{ matrix.runner.arch }}-cu${{ matrix.cuda_version }}.zip
109116

110117
# ========================================================================
111118
# Run tests
@@ -121,7 +128,18 @@ jobs:
121128
- name: Install python requirements
122129
env:
123130
LD_LIBRARY_PATH: ${{ env.MPI_PATH }}/lib:${{ env.LD_LIBRARY_PATH }}
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
131+
shell: bash
132+
run: |
133+
# Install the correct torch first.
134+
cuda_no_dot=$(echo ${{ matrix.cuda_version }} | sed 's/\.//')
135+
pip install torch==2.9.0 --index-url https://download.pytorch.org/whl/cu${cuda_no_dot}
136+
pip install numpy pytest cupy-cuda${{ steps.config.outputs.cuda_major }}x cuquantum-cu${{ steps.config.outputs.cuda_major }} lightning ml_collections mpi4py transformers quimb opt_einsum nvidia-cublas cuquantum-python-cu${{ steps.config.outputs.cuda_major }}==25.09
137+
# The following tests are needed for docs/sphinx/examples/qec/python/tensor_network_decoder.py.
138+
if [ "$(uname -m)" == "x86_64" ]; then
139+
# Stim is not currently available on manylinux ARM wheels, so only
140+
# install for x86_64.
141+
pip install stim beliefmatching
142+
fi
125143
126144
- name: Run Python tests
127145
env:

.github/workflows/build_wheels.yaml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,11 @@ on:
2626
assets_repo:
2727
type: string
2828
description: Retrieve assets from a draft release from this repo (e.g. NVIDIA/cudaqx)
29+
default: 'NVIDIA/cudaqx'
2930
required: false
3031
assets_tag:
3132
type: string
32-
description: Retrieve assets from a draft release with this tag (e.g. installed_files-1)
33+
description: Retrieve assets from a draft release with this tag (e.g. wheels-123)
3334
required: false
3435
artifacts_from_run:
3536
type: string
@@ -147,16 +148,13 @@ jobs:
147148
.github/workflows/scripts/build_cudaq.sh --python-version ${{ matrix.python }}
148149
149150
- name: Build CUDA-QX wheels
150-
env:
151-
SUFFIX: ${{ matrix.platform == 'amd64' && 'x86_64' || 'aarch64' }}
152151
shell: bash
153152
run: |
154153
if [[ -n "${{ inputs.assets_repo }}" ]] && [[ -n "${{ inputs.assets_tag }}" ]]; then
155154
# Extract the decoder that needs to be embedded in the wheel
156155
mkdir -p tmp
157-
PYVER=$(echo ${{ matrix.python }} | tr -d '.')
158-
unzip -d tmp cudaq_qec-*-cp${PYVER}-cp${PYVER}-manylinux*${SUFFIX}*.whl
159-
export QEC_EXTERNAL_DECODERS=$(pwd)/tmp/cudaq_qec/lib/decoder-plugins/libcudaq-qec-nv-qldpc-decoder.so
156+
tar -C tmp -xzvf nv-qldpc-decoder-${{ matrix.platform }}_ubuntu24.04_cuda${{ matrix.cuda_version }}_py${{ matrix.python }}_release.tar.gz
157+
export QEC_EXTERNAL_DECODERS=$(pwd)/tmp/libcudaq-qec-nv-qldpc-decoder.so
160158
fi
161159
# This is needed to allow the "git rev-parse" commands in the build
162160
# scripts to work.

libs/qec/pyproject.toml.cu12

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ maintainers = [{name = "NVIDIA Corporation & Affiliates"}]
1111
requires-python = ">=3.11"
1212
readme = "README.md"
1313
dependencies = [
14-
'cuda-quantum-cu12 >= 0.12',
14+
'cuda-quantum-cu12 >= 0.13',
1515
]
1616
classifiers = [
1717
'Intended Audience :: Science/Research',

libs/qec/pyproject.toml.cu13

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ maintainers = [{name = "NVIDIA Corporation & Affiliates"}]
1111
requires-python = ">=3.11"
1212
readme = "README.md"
1313
dependencies = [
14-
'cuda-quantum-cu13 >= 0.12',
14+
'cuda-quantum-cu13 >= 0.13',
1515
]
1616
classifiers = [
1717
'Intended Audience :: Science/Research',

libs/qec/python/tests/test_decoding_config.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,21 @@
1414

1515
# nv_qldpc_decoder_config tests
1616

17+
18+
def is_nv_qldpc_decoder_available():
19+
"""
20+
Helper function to check if the NV-QLDPC decoder is available.
21+
"""
22+
try:
23+
H_list = [[1, 0, 0, 1, 0, 1, 1], [0, 1, 0, 1, 1, 0, 1],
24+
[0, 0, 1, 0, 1, 1, 1]]
25+
H_np = np.array(H_list, dtype=np.uint8)
26+
nv_dec_gpu_and_cpu = qec.get_decoder("nv-qldpc-decoder", H_np)
27+
return True
28+
except Exception as e:
29+
return False
30+
31+
1732
FIELDS = {
1833
"use_sparsity": (bool, True, False),
1934
"error_rate": (float, 1e-3, 5e-2),
@@ -280,6 +295,9 @@ def test_configure_decoders_from_str_smoke():
280295
decoder_config.H_sparse = [1, 2, 3, -1, 6, 7, 8, -1, -1]
281296
decoder_config.set_decoder_custom_args(nv)
282297
yaml_str = decoder_config.to_yaml_str()
298+
# Do not instantiate the decoder if it is not available.
299+
if not is_nv_qldpc_decoder_available():
300+
return
283301
status = qec.configure_decoders_from_str(yaml_str)
284302
assert isinstance(status, int)
285303
qec.finalize_decoders()

libs/solvers/pyproject.toml.cu12

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ maintainers = [{name = "NVIDIA Corporation & Affiliates"}]
1111
requires-python = ">=3.11"
1212
readme = "README.md"
1313
dependencies = [
14-
'cuda-quantum-cu12 >= 0.12',
14+
'cuda-quantum-cu12 >= 0.13',
1515
'fastapi',
1616
'networkx',
1717
'pyscf',

libs/solvers/pyproject.toml.cu13

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ maintainers = [{name = "NVIDIA Corporation & Affiliates"}]
1111
requires-python = ">=3.11"
1212
readme = "README.md"
1313
dependencies = [
14-
'cuda-quantum-cu13 >= 0.12',
14+
'cuda-quantum-cu13 >= 0.13',
1515
'fastapi',
1616
'networkx',
1717
'pyscf',

0 commit comments

Comments
 (0)