Skip to content

Commit e4ad71b

Browse files
authored
Merge branch 'main' into feature/installer-cmake-test
2 parents 35371f7 + c94878e commit e4ad71b

File tree

256 files changed

+9671
-2658
lines changed

Some content is hidden

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

256 files changed

+9671
-2658
lines changed

.github/pre-commit/spelling_allowlist.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,10 @@ QPP
108108
QPU
109109
QPUs
110110
QPU’s
111+
QRMI
111112
QTX
112113
QX
114+
QaaS
113115
Qiskit
114116
QuEra
115117
QuTiP
@@ -123,12 +125,14 @@ SLED
123125
SLES
124126
SLURM
125127
SVD
128+
Scaleway
126129
Sqale
127130
Stim
128131
Superpositions
129132
Superstaq
130133
TBI
131134
TCP
135+
TII
132136
TableGen
133137
Toffoli
134138
Toshiko
@@ -206,6 +210,7 @@ decrementing
206210
dendrogram
207211
dependence
208212
dependences
213+
deserialization
209214
deserialize
210215
destructor
211216
detuning
@@ -310,6 +315,7 @@ programmatically
310315
pybind
311316
qaoa
312317
qed
318+
qio
313319
quantize
314320
quantized
315321
qubit
@@ -363,7 +369,9 @@ toolchain
363369
toolchains
364370
toolset
365371
transmon
372+
transpilation
366373
transpile
374+
trixie
367375
trotterization
368376
uccsd
369377
unary
@@ -377,6 +385,7 @@ unmarshal
377385
unmarshalling
378386
unoptimized
379387
upvote
388+
url
380389
variadic
381390
variational
382391
vazirani

.github/pull_request_template.md

Lines changed: 0 additions & 14 deletions
This file was deleted.

.github/workflows/build_package_sources.yml

Lines changed: 65 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,6 @@
2424
on:
2525
workflow_dispatch:
2626
inputs:
27-
push_to_NGC:
28-
required: false
29-
type: boolean
30-
default: false
31-
description: 'Push the built source image to NGC, otherwise push to GHCR.'
32-
environment:
33-
required: false
34-
type: string
3527
artifact_url:
3628
required: false
3729
type: string
@@ -322,6 +314,38 @@ jobs:
322314
fi
323315
ls -la "$d"/*trimmed* 2>/dev/null || true
324316
317+
- name: Generate pip attribution (NOTICE_PIP per variant + CUDA version)
318+
run: |
319+
cuda_major=$(echo "${{ matrix.cuda }}" | cut -d. -f1)
320+
suffix="_cu${cuda_major}"
321+
python3 scripts/generate_pip_attribution.py \
322+
package-source-diff/pip_packages_cudaq.txt \
323+
-o "NOTICE_PIP_cudaq${suffix}"
324+
325+
python3 scripts/generate_pip_attribution.py \
326+
package-source-diff/pip_packages_cudaqx.txt \
327+
-o "NOTICE_PIP_cudaqx${suffix}"
328+
329+
python3 scripts/generate_pip_attribution.py \
330+
package-source-diff/pip_packages_macos.txt \
331+
-o "NOTICE_PIP_macos${suffix}"
332+
ls -la NOTICE_PIP_*
333+
head -50 "NOTICE_PIP_cudaq${suffix}"
334+
335+
- name: Generate apt attribution (NOTICE_APT per variant + CUDA version)
336+
run: |
337+
cuda_major=$(echo "${{ matrix.cuda }}" | cut -d. -f1)
338+
suffix="_cu${cuda_major}"
339+
python3 scripts/generate_apt_attribution.py \
340+
package-source-diff/apt_packages_cudaq.txt \
341+
-o "NOTICE_APT_cudaq${suffix}"
342+
343+
python3 scripts/generate_apt_attribution.py \
344+
package-source-diff/apt_packages_cudaqx.txt \
345+
-o "NOTICE_APT_cudaqx${suffix}"
346+
ls -la NOTICE_APT_*
347+
head -50 "NOTICE_APT_cudaq${suffix}"
348+
325349
- name: Generate tpls lock file
326350
run: |
327351
chmod +x scripts/generate_tpls_lock.sh
@@ -346,39 +370,52 @@ jobs:
346370
push: false
347371

348372
- name: Log in to GitHub CR
349-
if: github.event.inputs.push_to_NGC != 'true'
350373
uses: docker/login-action@v3
351374
with:
352375
registry: ghcr.io
353376
username: ${{ github.actor }}
354377
password: ${{ github.token }}
355378

356-
- name: Log in to NGC
357-
if: github.event.inputs.push_to_NGC == 'true'
358-
uses: docker/login-action@v3
359-
with:
360-
registry: nvcr.io
361-
username: '$oauthtoken'
362-
password: ${{ secrets.NGC_CREDENTIALS }}
363-
364-
- name: Tag and push to GHCR or NGC
379+
- name: Tag and push amd64 image
365380
id: push
366381
run: |
367382
docker load --input /tmp/package-sources.tar
368383
cuda_major=$(echo "${{ matrix.cuda }}" | cut -d. -f1)
369384
target_image="nvcr.io/nvidia/nightly/cuda-quantum:cu${cuda_major}-latest"
370385
tag_suffix="${target_image##*:}"
371-
if [ "${{ github.event.inputs.push_to_NGC }}" = "true" ]; then
372-
# Derive push destination from target_image: .../cuda-quantum:tag -> .../cuda-quantum-src:tag
373-
repo_part="${target_image%:*}"
374-
tag="${repo_part}-src:${tag_suffix}"
375-
else
376-
owner_lower=$(echo "${{ github.repository_owner }}" | tr '[:upper:]' '[:lower:]')
377-
tag="ghcr.io/${owner_lower}/cuda-quantum-src:${tag_suffix}"
378-
fi
379-
docker tag package-sources:latest "$tag"
380-
docker push "$tag"
386+
owner_lower=$(echo "${{ github.repository_owner }}" | tr '[:upper:]' '[:lower:]')
387+
tag="ghcr.io/${owner_lower}/cuda-quantum-src:${tag_suffix}"
388+
tag_amd64="${tag}-amd64"
389+
tag_arm64="${tag}-arm64"
390+
docker tag package-sources:latest "$tag_amd64"
391+
docker push "$tag_amd64"
381392
echo "image_tag=$tag" | tee -a $GITHUB_OUTPUT
393+
echo "tag_amd64=$tag_amd64" | tee -a $GITHUB_OUTPUT
394+
echo "tag_arm64=$tag_arm64" | tee -a $GITHUB_OUTPUT
395+
396+
- name: Create arm64 image (copy /sources from amd64)
397+
run: |
398+
tag_amd64="${{ steps.push.outputs.tag_amd64 }}"
399+
tag_arm64="${{ steps.push.outputs.tag_arm64 }}"
400+
base_image="${{ steps.base-image.outputs.base_image }}"
401+
# Extract /sources from amd64 image
402+
cid=$(docker create "$tag_amd64")
403+
docker cp "$cid:/sources" ./sources-from-amd64
404+
docker rm "$cid"
405+
# Build arm64 image: same base, add /sources
406+
cat > Dockerfile.arm64 << EOF
407+
FROM ${base_image}
408+
COPY sources-from-amd64 /sources
409+
EOF
410+
docker buildx build --platform linux/arm64 -f Dockerfile.arm64 -t "$tag_arm64" --load .
411+
docker push "$tag_arm64"
412+
413+
- name: Create and push multi-arch manifest
414+
run: |
415+
tag="${{ steps.push.outputs.image_tag }}"
416+
tag_amd64="${{ steps.push.outputs.tag_amd64 }}"
417+
tag_arm64="${{ steps.push.outputs.tag_arm64 }}"
418+
docker buildx imagetools create --tag "$tag" "$tag_amd64" "$tag_arm64"
382419
383420
- name: Summary
384421
run: |

.github/workflows/ci_macos.yml

Lines changed: 51 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,15 @@
11
on:
2+
workflow_call:
3+
inputs:
4+
cache_base:
5+
required: false
6+
type: string
7+
default: main
8+
cudaq_version:
9+
required: false
10+
type: string
11+
description: 'Override version for wheel/installer (e.g. when called from deployments for a release).'
12+
default: ''
213
# Daily rebuild on main to ensure devdeps rebuilt as needed
314
schedule:
415
- cron: '0 4 * * *' # aim to be ready by 9am CET/CEST
@@ -59,11 +70,16 @@ jobs:
5970

6071
- id: version
6172
run: |
62-
is_versioned=${{ github.ref_type == 'tag' || startsWith(github.ref_name, 'releases/') || startsWith(github.ref_name, 'staging/') }}
63-
if ${is_versioned}; then
64-
cudaq_version=$(echo ${{ github.ref_name }} | egrep -o "([0-9]{1,}\.)+[0-9]{1,}")
73+
if [ -n "${{ inputs.cudaq_version }}" ]; then
74+
cudaq_version=$(echo "${{ inputs.cudaq_version }}" | egrep -o "([0-9]{1,}\.)+[0-9]{1,}([A-Za-z0-9_\-\.]*)" || true)
75+
cudaq_version=${cudaq_version:-0.0.0}
6576
else
66-
cudaq_version=0.0.0
77+
is_versioned=${{ github.ref_type == 'tag' || startsWith(github.ref_name, 'releases/') || startsWith(github.ref_name, 'staging/') }}
78+
if ${is_versioned}; then
79+
cudaq_version=$(echo ${{ github.ref_name }} | egrep -o "([0-9]{1,}\.)+[0-9]{1,}")
80+
else
81+
cudaq_version=0.0.0
82+
fi
6783
fi
6884
echo "cudaq_version=$cudaq_version" >> $GITHUB_OUTPUT
6985
@@ -88,8 +104,9 @@ jobs:
88104
name: Build & Test (arm64)
89105
needs: devdeps
90106
runs-on: macos-26
91-
timeout-minutes: 180
92107
env:
108+
CC: clang
109+
CXX: clang++
93110
MACOSX_DEPLOYMENT_TARGET: '13.0'
94111

95112
steps:
@@ -127,8 +144,6 @@ jobs:
127144
- name: Build MLIR Python bindings
128145
run: |
129146
source scripts/set_env_defaults.sh
130-
131-
# Incremental rebuild: add python-bindings to cached LLVM build
132147
Python3_EXECUTABLE="$(which python3)" \
133148
LLVM_PROJECTS='clang;lld;mlir;openmp;python-bindings' \
134149
LLVM_SOURCE="$HOME/.llvm-project" \
@@ -152,8 +167,9 @@ jobs:
152167
python_version: ['3.11', '3.12', '3.13']
153168
fail-fast: false
154169
runs-on: macos-26
155-
timeout-minutes: 90
156170
env:
171+
CC: clang
172+
CXX: clang++
157173
MACOSX_DEPLOYMENT_TARGET: '13.0'
158174
outputs:
159175
cudaq_version: ${{ needs.metadata.outputs.cudaq_version }}
@@ -189,8 +205,6 @@ jobs:
189205
- name: Build MLIR Python bindings
190206
run: |
191207
source scripts/set_env_defaults.sh
192-
193-
# Incremental rebuild: add python-bindings to cached LLVM build
194208
Python3_EXECUTABLE="$(which python3)" \
195209
LLVM_PROJECTS='clang;lld;mlir;openmp;python-bindings' \
196210
LLVM_SOURCE="$HOME/.llvm-project" \
@@ -216,7 +230,7 @@ jobs:
216230
# Consistent with Linux: pycudaq-<python_version_dashed>-<platform_info>
217231
name: pycudaq-${{ matrix.python_version }}-darwin-arm64
218232
path: dist/cuda_quantum*.whl
219-
retention-days: 1
233+
retention-days: 3
220234
if-no-files-found: error
221235

222236
# ============================================================================
@@ -230,7 +244,6 @@ jobs:
230244
python_version: ['3.11', '3.12', '3.13']
231245
fail-fast: false
232246
runs-on: macos-26
233-
timeout-minutes: 30
234247

235248
steps:
236249
- name: Checkout repository
@@ -268,8 +281,9 @@ jobs:
268281
name: Installer (arm64)
269282
needs: [devdeps, metadata]
270283
runs-on: macos-26
271-
timeout-minutes: 120
272284
env:
285+
CC: clang
286+
CXX: clang++
273287
MACOSX_DEPLOYMENT_TARGET: '13.0'
274288
outputs:
275289
cudaq_version: ${{ needs.metadata.outputs.cudaq_version }}
@@ -307,8 +321,6 @@ jobs:
307321
- name: Build MLIR Python bindings
308322
run: |
309323
source scripts/set_env_defaults.sh
310-
311-
# Incremental rebuild: add python-bindings to cached LLVM build
312324
Python3_EXECUTABLE="$(which python3)" \
313325
LLVM_PROJECTS='clang;lld;mlir;openmp;python-bindings' \
314326
LLVM_SOURCE="$HOME/.llvm-project" \
@@ -332,7 +344,7 @@ jobs:
332344
# Consistent with Linux: cudaq-<platform>-<config>-installer-<run_id>
333345
name: cudaq-arm64-darwin-installer-${{ github.run_id }}
334346
path: out/install_cuda_quantum*
335-
retention-days: 1
347+
retention-days: 3
336348
if-no-files-found: error
337349

338350
# ============================================================================
@@ -343,7 +355,6 @@ jobs:
343355
name: Validate Installation (arm64)
344356
needs: [installer, wheel]
345357
runs-on: macos-26
346-
timeout-minutes: 30
347358

348359
steps:
349360
- name: Checkout repository
@@ -366,16 +377,34 @@ jobs:
366377
name: pycudaq-3.12-darwin-arm64
367378
path: wheel/
368379

369-
- name: Install CUDA-Q (C++ via installer)
380+
- name: Create test user
381+
run: |
382+
sudo sysadminctl -addUser cudaqtest -password 'cudaqtest123' -admin
383+
sudo mkdir -p /Users/cudaqtest
384+
sudo chown cudaqtest /Users/cudaqtest
385+
386+
- name: Install CUDA-Q (C++ via installer to neutral path)
370387
run: |
388+
install_path=/opt/cudaq-test
389+
sudo mkdir -p "$install_path"
390+
sudo chown cudaqtest "$install_path"
371391
chmod +x installer/install_cuda_quantum*
372-
bash installer/install_cuda_quantum* --accept -- --installpath $HOME/.cudaq
392+
sudo -u cudaqtest bash installer/install_cuda_quantum* --accept -- --installpath "$install_path"
373393
374394
- name: Install CUDA-Q (Python via wheel)
375395
run: |
376-
pip install wheel/*.whl
396+
sudo -u cudaqtest -H python3 -m venv /Users/cudaqtest/venv
397+
sudo -u cudaqtest -H /Users/cudaqtest/venv/bin/pip install wheel/*.whl
377398
378399
- name: Validate installation
379400
run: |
380-
source $HOME/.zshrc
381-
bash scripts/validate_installation.sh
401+
install_path=/opt/cudaq-test
402+
workdir=$(sudo -u cudaqtest mktemp -d)
403+
sudo cp -R scripts docs "$workdir/"
404+
sudo chown -R cudaqtest "$workdir"
405+
sudo -u cudaqtest bash -lc "
406+
source /Users/cudaqtest/venv/bin/activate
407+
source ${install_path}/set_env.sh
408+
cd ${workdir}
409+
bash scripts/validate_installation.sh
410+
"

.github/workflows/deployments.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,11 @@ on:
3030
description: Create a GitHub release with the given version number (e.g. 0.3.0). A GitHub release with that version must not exist already.
3131
required: false
3232
default: ''
33+
include_macos:
34+
type: boolean
35+
description: Build and include macOS wheels and installer.
36+
required: false
37+
default: true
3338
workflow_run:
3439
workflows:
3540
- PR merged
@@ -809,3 +814,14 @@ jobs:
809814
cuda_version: ${{ matrix.cuda_version }}
810815
build_cache: ${{ fromJson(needs.config.outputs.json).build_cache[format('{0}-cu{1}-installer', matrix.platform, matrix.cuda_version)] }}
811816
environment: ghcr-deployment
817+
818+
macos_ci:
819+
name: macOS CI
820+
needs: metadata
821+
if: >-
822+
needs.metadata.outputs.create_packages == 'true'
823+
&& (github.event_name != 'workflow_dispatch' || inputs.include_macos != false)
824+
uses: ./.github/workflows/ci_macos.yml
825+
with:
826+
cache_base: ${{ needs.metadata.outputs.cache_base }}
827+
cudaq_version: ${{ inputs.create_release }}

0 commit comments

Comments
 (0)