Skip to content

Commit

Permalink
Merge branch 'main' into ch-pauli.as.string
Browse files Browse the repository at this point in the history
  • Loading branch information
schweitzpgi authored Nov 7, 2024
2 parents 7b69fed + 7b42224 commit 24f6528
Show file tree
Hide file tree
Showing 102 changed files with 4,324 additions and 526 deletions.
12 changes: 11 additions & 1 deletion .github/actions/run-in-docker/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ inputs:
shell:
default: "bash"
required: false
# Adding a new optional parameter for directory mapping
volume:
default: ""
required: false

runs:
using: "composite"
Expand All @@ -21,6 +25,12 @@ runs:
then additional_run_args="--gpus all"
fi
# Check if a volume mapping is specified and set the option
volume_option=""
if [ -n "${{ inputs.volume }}" ]; then
volume_option="-v ${{ inputs.volume }}"
fi
# Note: "bash -s << EOF" does not play nice with mpirun/mpiexec. It
# silently skips any shell commands that come after the mpirun/mpiexec,
# so don't use it. Use this instead, which seems to work better.
Expand All @@ -29,7 +39,7 @@ runs:
${{ inputs.run }}
EOF
container=$(docker run --user ${{ inputs.user }} $additional_run_args -id ${{ inputs.image }})
container=$(docker run --user ${{ inputs.user }} $additional_run_args $volume_option -id ${{ inputs.image }})
docker cp $tmpFile $container:$tmpFile
docker exec --user root $container chown -R ${{ inputs.user }} $tmpFile
docker exec $container ${{ inputs.shell }} $tmpFile
Expand Down
10 changes: 10 additions & 0 deletions .github/codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
coverage:
status:
project:
default:
target: 70%
threshold: 1%
ignore:
- "tpls"
fixes:
- "/workspaces/cuda-quantum::"
29 changes: 28 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,24 @@ jobs:
devdeps_archive: ${{ fromJson(needs.config.outputs.json).tar_archive[format('{0}-{1}', matrix.platform, matrix.toolchain)] }}
export_environment: ${{ github.event_name == 'workflow_dispatch' && inputs.export_environment }}

gen_code_coverage:
name: Gen code coverage
needs: config
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}', matrix.platform, matrix.toolchain)] }}
devdeps_cache: ${{ fromJson(needs.config.outputs.json).cache_key[format('{0}-{1}', matrix.platform, matrix.toolchain)] }}
devdeps_archive: ${{ fromJson(needs.config.outputs.json).tar_archive[format('{0}-{1}', matrix.platform, matrix.toolchain)] }}
export_environment: ${{ github.event_name == 'workflow_dispatch' && inputs.export_environment }}

docker_image:
name: Create Docker images
needs: config
Expand Down Expand Up @@ -225,13 +243,22 @@ jobs:
DOCKERHUB_READONLY_TOKEN: ${{ secrets.DOCKERHUB_READONLY_TOKEN }}
with:
platform: linux/${{ matrix.platform }}
build_config_id: cu${{ matrix.cuda_version }}
python_version: ${{ matrix.python_version }}
cuda_version: ${{ matrix.cuda_version }}
devdeps_image: ${{ fromJson(needs.config.outputs.json).image_hash[format('{0}-cu{1}-python', matrix.platform, matrix.cuda_version)] }}
devdeps_cache: ${{ fromJson(needs.config.outputs.json).cache_key[format('{0}-cu{1}-python', matrix.platform, matrix.cuda_version)] }}
devdeps_archive: ${{ fromJson(needs.config.outputs.json).tar_archive[format('{0}-cu{1}-python', matrix.platform, matrix.cuda_version)] }}

python_metapackages:
name: Create Python metapackages
needs: python_wheels
uses: ./.github/workflows/python_metapackages.yml
with:
cudaq_version: ${{ needs.python_wheels.outputs.cudaq_version }}
python_versions: "['3.10', '3.12']"
cuda_versions: "['', '11.8', '12.0']"
wheel_artifacts: 'pycudaq-*'

binaries:
name: Create CUDA Quantum installer
needs: [metadata, config]
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/config/ghcr_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
"platforms": "linux/amd64,linux/arm64",
"tags":
[
"38", "40"
"38", "39"
]
},
{
Expand Down
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: 330f24ac69b31f0332710d791410b30fe91c24b8
nvidia-mgpu-commit: b63a90466dc49d7c0c950984d3a882097b7db870
1 change: 1 addition & 0 deletions .github/workflows/config/spelling_allowlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Anyon
Asynchronous
BFGS
Bloch
Braket
CLA
CLI
CMake
Expand Down
77 changes: 63 additions & 14 deletions .github/workflows/config/validation_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@
"python":
[
{
"version": 3.10,
"version": "3.10",
"operating_systems":
[
"ubuntu:22.04",
"fedora:40",
"fedora:39",
"opensuse/leap:15.5"
]
},
{
"version": 3.11,
"version": "3.11",
"operating_systems":
[
"ubuntu:22.04",
Expand All @@ -22,11 +22,11 @@
]
},
{
"version": 3.12,
"version": "3.12",
"operating_systems":
[
"ubuntu:24.04",
"fedora:40",
"fedora:39",
"redhat/ubi9:9.2",
"opensuse/leap:15.6"
]
Expand All @@ -39,13 +39,41 @@
"cuda_major": 12,
"operating_systems":
[
"debian:12"
"ubuntu:22.04",
"debian:12",
"redhat/ubi9:9.2",
"opensuse/leap:15.5",
"fedora:39"
],
"ubuntu:22.04":
{
"libcdev_package": "libc6-dev",
"cudart_version": "12.0",
"cuda_distribution": "ubuntu2204"
},
"debian:12":
{
"libcdev_package": "libc6-dev",
"cudart_version": 12.3,
"cudart_version": "12.6",
"cuda_distribution": "debian12"
},
"redhat/ubi9:9.2":
{
"libcdev_package": "glibc-devel",
"cudart_version": "12.0",
"cuda_distribution": "rhel9"
},
"opensuse/leap:15.5":
{
"libcdev_package": "glibc-devel",
"cudart_version": "12.0",
"cuda_distribution": "opensuse15"
},
"fedora:39":
{
"libcdev_package": "glibc-devel",
"cudart_version": "12.4",
"cuda_distribution": "fedora39"
}
},
{
Expand All @@ -61,25 +89,46 @@
"ubuntu:22.04":
{
"libcdev_package": "libc6-dev",
"cudart_version": 11.8,
"cudart_version": "11.8",
"cuda_distribution": "ubuntu2204"
},
"redhat/ubi8:8.0":
{
"libcdev_package": "glibc-devel",
"cudart_version": 11.8,
"cudart_version": "11.8",
"cuda_distribution": "rhel9"
},
"opensuse/leap:15.5":
{
"libcdev_package": "glibc-devel",
"cudart_version": 11.8,
"cudart_version": "11.8",
"cuda_distribution": "opensuse15"
},
"fedora:38":
{
"libcdev_package": "glibc-devel",
"cudart_version": 11.8,
"cudart_version": "11.8",
"cuda_distribution": "rhel9"
}
},
{
"platform": "linux/arm64",
"cuda_major": 12,
"operating_systems":
[
"ubuntu:22.04",
"redhat/ubi9:9.2"
],
"ubuntu:22.04":
{
"libcdev_package": "libc6-dev",
"cudart_version": "12.0",
"cuda_distribution": "ubuntu2204"
},
"redhat/ubi9:9.2":
{
"libcdev_package": "glibc-devel",
"cudart_version": "12.0",
"cuda_distribution": "rhel9"
}
},
Expand All @@ -95,19 +144,19 @@
"ubuntu:22.04":
{
"libcdev_package": "libc6-dev",
"cudart_version": 11.8,
"cudart_version": "11.8",
"cuda_distribution": "ubuntu2204"
},
"redhat/ubi8:8.0":
{
"libcdev_package": "glibc-devel",
"cudart_version": 11.8,
"cudart_version": "11.8",
"cuda_distribution": "rhel9"
},
"fedora:38":
{
"libcdev_package": "glibc-devel",
"cudart_version": 11.8,
"cudart_version": "11.8",
"cuda_distribution": "rhel9"
}
}
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/deployments.yml
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,6 @@ jobs:
DOCKERHUB_READONLY_TOKEN: ${{ secrets.DOCKERHUB_READONLY_TOKEN }}
with:
platform: ${{ fromJson(needs.metadata.outputs.platforms)[format('{0}', matrix.platform)].docker_flag }}
build_config_id: cu${{ matrix.cuda_version }}
python_version: ${{ matrix.python_version }}
cuda_version: ${{ matrix.cuda_version }}
devdeps_image: ${{ fromJson(needs.config.outputs.json).image_hash[format('{0}-cu{1}-python', matrix.platform, matrix.cuda_version)] }}
Expand Down
50 changes: 33 additions & 17 deletions .github/workflows/docker_images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ jobs:
platform_tag: ${{ steps.info.outputs.platform_tag }}
build_docs: ${{ steps.info.outputs.build_docs }}
push_to_ngc: ${{ steps.info.outputs.push_to_ngc }}
is_versioned: ${{ steps.info.outputs.is_versioned }}

# Needed to define metadata depending on whether an environment secret is defined.
environment:
Expand All @@ -62,10 +63,10 @@ jobs:
# multi-platform builds get no platform tag
echo "runner=linux-amd64-cpu8" >> $GITHUB_OUTPUT
echo "build_docs=${{ inputs.build_docs != 'false' }}" >> $GITHUB_OUTPUT
is_versioned=${{ github.ref_type == 'tag' || github.ref_name == 'main' || startsWith(github.ref_name, 'releases/') }}
is_staging_branch=${{ startsWith(github.ref_name, 'staging/') }}
is_experimental=${{ startsWith(github.ref_name, 'experimental/') }}
push_to_ngc=`${{ inputs.environment && secrets.NGC_CREDENTIALS != '' }} && ($is_versioned || $is_staging_branch || $is_experimental) && echo true || echo`
is_versioned=${{ github.ref_type == 'tag' || startsWith(github.ref_name, 'releases/') || startsWith(github.ref_name, 'staging/') }}
has_continuous_deployment=${{ startsWith(github.ref_name, 'experimental/') || github.ref_name == 'main' }}
push_to_ngc=`${{ inputs.environment && secrets.NGC_CREDENTIALS != '' }} && ($is_versioned || $has_continuous_deployment) && echo true || echo`
echo "is_versioned=$is_versioned" >> $GITHUB_OUTPUT
echo "push_to_ngc=$push_to_ngc" >> $GITHUB_OUTPUT
elif [ -n "$(echo ${{ inputs.platforms }} | grep -i arm)" ]; then
platform_tag=`echo ${{ inputs.platforms }} | sed 's/linux\///g' | tr -d ' '`
Expand Down Expand Up @@ -481,7 +482,7 @@ jobs:
image_tag+=pr-${pr_number:-${{ github.event.pull_request.number }}}
elif ${{ github.ref_type == 'branch' && github.ref_name == 'main' }}; then
image_tag+=latest
elif ${{ github.ref_type == 'tag' || startsWith(github.ref_name, 'releases/') }}; then
elif ${{ needs.metadata.outputs.is_versioned == 'true' }}; then
image_tag+=`echo ${{ github.ref_name }} | egrep -o "([0-9]{1,}\.)+[0-9]{1,}"`
else
image_tag+=`echo ${{ github.ref_name }} | tr '/' '-'`
Expand Down Expand Up @@ -756,6 +757,9 @@ jobs:
contents: read
packages: read

outputs:
artifact_id: "${{ steps.job_summary.outputs.artifact_id }}"

steps:
- name: Checkout repository
uses: actions/checkout@v4
Expand Down Expand Up @@ -815,16 +819,33 @@ jobs:
fi
- name: Create job summary
id: job_summary
if: always() && !cancelled()
run: |
cuda_major=`echo ${{ inputs.cuda_version }} | cut -d . -f1`
platform_id=${{ needs.metadata.outputs.platform_tag }}
artifact_id=image${platform_id:+_$platform_id}${cuda_major:+_cu$cuda_major} # changing the artifact name requires updating other workflows
echo "artifact_id=$artifact_id" >> $GITHUB_OUTPUT
if [ -f /tmp/validation.out ]; then
echo "## Validation" >> $GITHUB_STEP_SUMMARY
echo "The validation of the cuda-quantum image produced the following output:" >> $GITHUB_STEP_SUMMARY
echo '```text' >> $GITHUB_STEP_SUMMARY
cat /tmp/validation.out >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
summary=/tmp/summary.txt
echo "## Validation" > $summary
echo "The validation of the cuda-quantum image produced the following output:" >> $summary
echo '```text' >> $summary
cat /tmp/validation.out >> $summary
echo '```' >> $summary
echo "validation_summary=$summary" >> $GITHUB_OUTPUT
fi
- name: Upload job summary
if: steps.job_summary.outputs.validation_summary != ''
uses: actions/upload-artifact@v4
with:
name: ${{ steps.job_summary.outputs.artifact_id }}_validation
path: ${{ steps.job_summary.outputs.validation_summary }}
retention-days: 1
if-no-files-found: warn

staging:
name: Staging
needs: [metadata, cudaqdev_image, cudaq_image, validation]
Expand All @@ -846,8 +867,7 @@ jobs:
run: |
cudaqdev_hash=${{ needs.cudaqdev_image.outputs.image_hash }}
cudaq_hash=${{ needs.cudaq_image.outputs.image_hash }}
cuda_major=`echo ${{ inputs.cuda_version }} | cut -d . -f1`
artifact_name=image_${cuda_major:+cu${cuda_major}_}publishing # changing the artifact name requires updating other workflows
artifact_name=${{ needs.validation.outputs.artifact_id }}_publishing # changing the artifact name requires updating other workflows
echo "artifact_name=$artifact_name" >> $GITHUB_OUTPUT
info_file="$artifact_name.txt"
echo "info_file=$info_file" >> $GITHUB_OUTPUT
Expand Down Expand Up @@ -884,11 +904,7 @@ jobs:
keys+=" ${{ needs.cudaq_image.outputs.tar_cache }}"
keys+=" ${{ needs.ompi_image.outputs.tar_cache }}"
echo "$keys" >> cache_keys.txt
platform_tag=${{ needs.metadata.outputs.platform_tag }}
cuda_major=`echo ${{ inputs.cuda_version }} | cut -d . -f1`
artifact_name=cache_keys${platform_tag:+_$platform_tag}${cuda_major:+_cu$cuda_major}_images
echo "artifact_name=$artifact_name" >> $GITHUB_OUTPUT
echo "artifact_name=${{ needs.validation.outputs.artifact_id }}_cache_keys" >> $GITHUB_OUTPUT
- uses: actions/upload-artifact@v4
with:
Expand Down
Loading

0 comments on commit 24f6528

Please sign in to comment.