Skip to content

Commit

Permalink
Merge branch 'main' into dynamics_cpp_operators
Browse files Browse the repository at this point in the history
  • Loading branch information
sacpis authored Dec 19, 2024
2 parents b26a440 + 1a4f99e commit 0f6496d
Show file tree
Hide file tree
Showing 173 changed files with 4,254 additions and 1,636 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
2 changes: 1 addition & 1 deletion .github/workflows/docker_images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -694,7 +694,7 @@ jobs:
fi
image_tag=`docker inspect $cudaq_image --format='{{json .Config.Labels}}' | jq -r '."org.opencontainers.image.version"'`
docs_version="CUDA_QUANTUM_VERSION=${image_tag%-base}"
docs_version="CUDA_QUANTUM_VERSION=$(echo $image_tag | sed -re 's/^(cu[0-9]+-)?(.*)-base$/\2/')"
docker image rm $cudaq_image
docker image prune --force
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
Loading

0 comments on commit 0f6496d

Please sign in to comment.