Skip to content

Commit

Permalink
Merge branch 'main' into fix_dialects_double_install
Browse files Browse the repository at this point in the history
  • Loading branch information
schweitzpgi authored Dec 11, 2024
2 parents dbfbf22 + c56261b commit eca4e69
Show file tree
Hide file tree
Showing 130 changed files with 3,151 additions and 717 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/config/gitlab_commits.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
nvidia-mgpu-repo: cuda-quantum/cuquantum-mgpu.git
nvidia-mgpu-commit: 5ecebd6b7642e8526baf5930634f2f854aef9ea7
nvidia-mgpu-commit: dadce3edc10564e94cd260590344d5840880087a
3 changes: 3 additions & 0 deletions .github/workflows/config/spelling_allowlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ Hadamards
Hamiltonian
Hamiltonians
IQM
InfiniBand
Infleqtion
IonQ
JIT
JSON
Expand Down Expand Up @@ -104,6 +106,7 @@ SLED
SLES
SLURM
SVD
Stim
Superpositions
TBI
TCP
Expand Down
49 changes: 37 additions & 12 deletions .github/workflows/deployments.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,14 @@ jobs:
pull_request_number: ${{ steps.pr_info.outputs.pr_number }}
pull_request_base: ${{ steps.pr_info.outputs.pr_base }}
pull_request_commit: ${{ steps.pr_info.outputs.merge_commit }}
llvm_commit: ${{ steps.repo_info.outputs.llvm_commit }}
pybind11_commit: ${{ steps.repo_info.outputs.pybind11_commit }}
llvm_commit: ${{ steps.build_config.outputs.llvm_commit }}
pybind11_commit: ${{ steps.build_config.outputs.pybind11_commit }}
cache_base: ${{ steps.build_info.outputs.cache_base }}
cache_target: ${{ steps.build_info.outputs.cache_target }}
multi_platform: ${{ steps.build_info.outputs.multi_platform }}
platforms: ${{ steps.build_info.outputs.platforms }}
build_dependencies: ${{ steps.build_config.outputs.build_dependencies }}
create_packages: ${{ steps.build_config.outputs.create_packages }}
environment: ${{ steps.build_info.outputs.environment }}

steps:
Expand Down Expand Up @@ -159,15 +161,22 @@ jobs:
ref: "${{ steps.pr_info.outputs.merge_commit }}"

- name: Configure build
id: repo_info
id: build_config
run: |
echo "llvm_commit=$(git rev-parse @:./tpls/llvm)" >> $GITHUB_OUTPUT
echo "pybind11_commit=$(git rev-parse @:./tpls/pybind11)" >> $GITHUB_OUTPUT
if ${{ github.event_name != 'workflow_run' || steps.pr_info.outputs.pr_number != '' }}; then
echo "build_dependencies=true" >> $GITHUB_OUTPUT
fi
if ${{ github.event_name == 'workflow_dispatch' && ! inputs.update_registry_cache }}; then
echo "create_packages=true" >> $GITHUB_OUTPUT
fi
devdeps:
name: Build dev dependencies
needs: metadata
if: github.event_name != 'workflow_run' || needs.metadata.outputs.pull_request_number != ''
if: needs.metadata.outputs.build_dependencies == 'true'
strategy:
matrix:
platform: ${{ fromJson(needs.metadata.outputs.multi_platform || needs.metadata.outputs.platforms).ids }}
Expand Down Expand Up @@ -195,7 +204,7 @@ jobs:
wheeldeps:
name: Build wheel dependencies
needs: metadata
if: github.event_name != 'workflow_run' || needs.metadata.outputs.pull_request_number != ''
if: needs.metadata.outputs.build_dependencies == 'true'
strategy:
matrix:
# There are currently no multi-platform manylinux images available.
Expand Down Expand Up @@ -229,7 +238,7 @@ jobs:
source_build:
name: Build cross-platform dependencies
needs: metadata
if: github.event_name != 'workflow_run' || needs.metadata.outputs.pull_request_number != ''
if: needs.metadata.outputs.build_dependencies == 'true'
strategy:
matrix:
platform: ${{ fromJson(needs.metadata.outputs.platforms).ids }}
Expand Down Expand Up @@ -260,7 +269,7 @@ jobs:
openmpi:
name: Build Open MPI
needs: metadata
if: github.event_name != 'workflow_run' || needs.metadata.outputs.pull_request_number != ''
if: needs.metadata.outputs.build_dependencies == 'true'
strategy:
matrix:
platform: ${{ fromJson(needs.metadata.outputs.multi_platform || needs.metadata.outputs.platforms).ids }}
Expand Down Expand Up @@ -311,20 +320,36 @@ jobs:
# https://github.com/actions/runner/pull/2477
config:
name: Configure build
needs: [devdeps, wheeldeps, source_build, openmpi]
if: github.event_name == 'workflow_dispatch' && ! inputs.update_registry_cache
needs: [metadata, devdeps, wheeldeps, source_build, openmpi]
if: needs.metadata.outputs.create_packages == 'true'
runs-on: ubuntu-latest

outputs:
json: "${{ steps.read_json.outputs.result }}"
devdeps_toolchain: gcc11

steps:
- uses: cloudposse/[email protected]
id: read_json
with:
matrix-step-name: dev_environment

coverage:
name: Update code coverage
needs: [metadata, config]
if: needs.metadata.outputs.multi_platform != ''
strategy:
matrix:
platform: [amd64]
toolchain: [clang16]
fail-fast: false
uses: ./.github/workflows/generate_cc.yml
secrets:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
platform: linux/${{ matrix.platform }}
devdeps_image: ${{ fromJson(needs.config.outputs.json).image_hash[format('{0}-{1}', fromJson(needs.metadata.outputs.multi_platform).ids[0], matrix.toolchain)] }}
export_environment: false

extdevdeps:
name: Create dev environment
needs: [metadata, config, openmpi]
Expand All @@ -340,10 +365,10 @@ jobs:
with:
platforms: ${{ fromJson(needs.metadata.outputs.multi_platform || needs.metadata.outputs.platforms)[format('{0}', matrix.platform)].docker_flag }}
dockerfile: build/devdeps.ext.Dockerfile
build_config_id: cu${{ matrix.cuda_version }}-${{ needs.config.outputs.devdeps_toolchain }}
build_config_id: cu${{ matrix.cuda_version }}-gcc11
build_args: |
cuda_version=${{ matrix.cuda_version }}
base_image=${{ fromJson(needs.config.outputs.json).image_hash[format('{0}-{1}', matrix.platform, needs.config.outputs.devdeps_toolchain)] }}
base_image=${{ fromJson(needs.config.outputs.json).image_hash[format('{0}-gcc11', matrix.platform)] }}
ompidev_image=${{ fromJson(needs.config.outputs.json).image_hash[format('{0}-cu{1}-ompi', matrix.platform, matrix.cuda_version)] }}
${{ matrix.cuda_version != '11.8' && 'cuda_packages=cuda-cudart cuda-nvrtc cuda-compiler libcublas-dev libcusolver libnvjitlink' || '' }}
registry_cache_from: ${{ needs.metadata.outputs.cache_base }}
Expand Down
23 changes: 12 additions & 11 deletions .github/workflows/generate_cc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ on:
required: false
type: string
devdeps_cache:
required: true
required: false
type: string
devdeps_archive:
required: true
required: false
type: string
export_environment:
required: false
Expand All @@ -33,24 +33,25 @@ jobs:
steps:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Restore environment
id: restore_devdeps
if: inputs.devdeps_image == ''
uses: actions/cache/restore@v4
with:
path: ${{ inputs.devdeps_archive }}
key: ${{ inputs.devdeps_cache }}
fail-on-cache-miss: true
persist-credentials: false

- name: Log in to GitHub CR
if: inputs.devdeps_image != ''
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ github.token }}

- name: Restore environment
id: restore_devdeps
if: inputs.devdeps_cache && inputs.devdeps_archive
uses: actions/cache/restore@v4
with:
path: ${{ inputs.devdeps_archive }}
key: ${{ inputs.devdeps_cache }}
fail-on-cache-miss: true

- name: Set up context for buildx
run: |
docker context create builder_context
Expand Down
82 changes: 75 additions & 7 deletions .github/workflows/integration_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ on:
- cron: 0 3 * * *

env:
# NGC nv-quantum organization: pnyjrcojiblh
NGC_QUANTUM_ORG: pnyjrcojiblh
NGC_QUANTUM_TEAM: cuda-quantum
NVQC_FUNCTION_ID: 3bfa0342-7d2a-4f1b-8e81-b6608d28ca7d
Expand All @@ -75,30 +74,90 @@ jobs:
# We need this job purely to choose the container image values because the
# `env` context is unavailable outside of "steps" contexts.
setup:
name: Set variables
name: Configure jobs
runs-on: ubuntu-latest
permissions:
packages: write

environment:
name: ghcr-deployment
url: ${{ vars.deployment_url }}

outputs:
cudaq_test_image: ${{ steps.vars.outputs.cudaq_test_image }}
cudaq_nvqc_deploy_image: ${{ steps.vars.outputs.cudaq_nvqc_deploy_image }}
cudaq_test_image: ${{ steps.vars.outputs.cudaq_nightly_image }}@${{ steps.test_image.outputs.digest }}
cudaq_nvqc_deploy_image: ${{ inputs.cudaq_nvqc_deploy_image || format('{0}@{1}', steps.vars.outputs.cudaq_nightly_image, steps.test_image.outputs.digest) }}

steps:
- name: Set variables
id: vars
run: |
echo "cudaq_test_image=${{ inputs.cudaq_test_image || vars.cudaq_test_image }}" >> $GITHUB_OUTPUT
echo "cudaq_nvqc_deploy_image=${{ inputs.cudaq_nvqc_deploy_image || vars.cudaq_test_image }}" >> $GITHUB_OUTPUT
cudaq_test_image=${{ inputs.cudaq_test_image || vars.cudaq_test_image }}
cudaq_nightly_image=ghcr.io/nvidia/${{ vars.packages_prefix }}cuda-quantum
sudo apt-get update && sudo apt-get install -y --no-install-recommends curl
curl -L https://github.com/regclient/regclient/releases/latest/download/regctl-linux-amd64 > regctl
chmod 755 regctl
manifest=`./regctl image manifest $cudaq_test_image --format "{{ json . }}"`
platforms=`echo $manifest | jq -r '.manifests | map("\(.platform.os)/\(.platform.architecture)") | .[]'`
echo "FROM $cudaq_test_image" >> test_image.Dockerfile
echo "platforms=$(echo $platforms | tr ' ' ,)" >> $GITHUB_OUTPUT
echo "cudaq_nightly_image=$cudaq_nightly_image" >> $GITHUB_OUTPUT
- name: Log in to GitHub CR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ github.token }}

- name: Set up context for buildx
run: |
docker context create builder_context
- name: Set up buildx runner
uses: docker/setup-buildx-action@v3
with:
endpoint: builder_context

- name: Extract metadata
id: metadata
uses: docker/metadata-action@v5
with:
images: ${{ steps.vars.outputs.cudaq_nightly_image }}
flavor: latest=false
tags: type=raw,value=nightly
labels: |
org.opencontainers.image.title=cuda-quantum
org.opencontainers.image.description=CUDA-Q image used for nightly integration tests
- name: Update nightly image on GHCR
id: test_image
uses: docker/build-push-action@v5
with:
context: .
file: test_image.Dockerfile
tags: ${{ steps.metadata.outputs.tags }}
labels: ${{ steps.metadata.outputs.labels }}
platforms: ${{ steps.vars.outputs.platforms }}
push: true

metadata:
name: Retrieve commit info
runs-on: ubuntu-latest
needs: setup

container:
image: ${{ needs.setup.outputs.cudaq_test_image }}
options: --user root
credentials:
username: ${{ github.actor }}
password: ${{ github.token }}

outputs:
cudaq_commit: ${{ steps.commit-sha.outputs.sha }}

steps:
- name: Get commit SHA
id: commit-sha
Expand Down Expand Up @@ -248,6 +307,9 @@ jobs:
container:
image: ${{ needs.setup.outputs.cudaq_test_image }}
options: --user root
credentials:
username: ${{ github.actor }}
password: ${{ github.token }}

steps:
- name: Get code
Expand Down Expand Up @@ -620,10 +682,16 @@ jobs:
packages: read

# Must have environment protection
environment: ghcr-deployment
environment:
name: ghcr-deployment
url: ${{ vars.deployment_url }}

container:
image: ${{ needs.setup.outputs.cudaq_test_image }}
options: --user root
credentials:
username: ${{ github.actor }}
password: ${{ github.token }}

steps:
- name: Get code
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/publishing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1128,14 +1128,14 @@ jobs:
tar xf /tmp/packages/${cudaq_metapackage}.tar.gz && mv -v ${cudaq_metapackage}/README.md .
rm -rf ${cudaq_metapackage} && readme=README.md
# Setup links for validate_pycudaq.sh script
ln -s $GITHUB_WORKSPACE/scripts/validate_pycudaq.sh .
ln -s $GITHUB_WORKSPACE/docs/sphinx/examples/python /tmp/examples
ln -s $GITHUB_WORKSPACE/docs/sphinx/applications/python /tmp/applications
ln -s $GITHUB_WORKSPACE/docs/sphinx/targets/python /tmp/targets
ln -s $GITHUB_WORKSPACE/docs/sphinx/snippets/python /tmp/snippets
ln -s $GITHUB_WORKSPACE/python/tests /tmp/tests
ln -s $GITHUB_WORKSPACE/$readme /tmp/README.md
# Setup files for validate_pycudaq.sh script
cp $GITHUB_WORKSPACE/scripts/validate_pycudaq.sh .
cp -r $GITHUB_WORKSPACE/docs/sphinx/examples/python /tmp/examples/
cp -r $GITHUB_WORKSPACE/docs/sphinx/applications/python /tmp/applications/
cp -r $GITHUB_WORKSPACE/docs/sphinx/targets/python /tmp/targets/
cp -r $GITHUB_WORKSPACE/docs/sphinx/snippets/python /tmp/snippets/
cp -r $GITHUB_WORKSPACE/python/tests /tmp/tests/
cp $GITHUB_WORKSPACE/$readme /tmp/README.md
# Run the script w/ -q to run a shortened test
set +e # Allow script to keep going through errors (needed for skipped tests)
Expand Down
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,3 @@
[submodule "tpls/Stim"]
path = tpls/Stim
url = https://github.com/quantumlib/Stim
[submodule "tpls/aws-sdk-cpp"]
path = tpls/aws-sdk-cpp
url = https://github.com/aws/aws-sdk-cpp.git
Loading

0 comments on commit eca4e69

Please sign in to comment.