Build wheels #18
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build wheels | |
on: | |
workflow_dispatch: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
linux-build: | |
name: Linux build | |
#runs-on: ubuntu-latest | |
runs-on: linux-arm64-cpu8 | |
# CUDAQ requires a highly specialized environment to build. Thus, it is much | |
# easier to rely on their's devdeps images to do the building. | |
container: ghcr.io/nvidia/cuda-quantum-devdeps:manylinux-arm64-${{ matrix.toolchain.id }}-main | |
permissions: | |
actions: write | |
contents: read | |
strategy: | |
fail-fast: false | |
matrix: | |
python: ['3.10'] | |
toolchain: | |
- id: cu12.0-gcc11 | |
cc: gcc-11 | |
cxx: g++-11 | |
build-type: Release | |
steps: | |
- name: Get code | |
uses: actions/checkout@v4 | |
with: | |
set-safe-directory: true | |
- name: Get CUDAQ code | |
uses: actions/checkout@v4 | |
with: | |
repository: 'NVIDIA/cuda-quantum' | |
ref: ${{ inputs.ref }} | |
path: cudaq | |
set-safe-directory: true | |
- name: Build CUDAQ toolchain | |
run: | | |
.github/workflows/scripts/build_cudaq.sh | |
- name: Build wheels | |
run: | | |
.github/workflows/scripts/build_wheels.sh \ | |
--cudaq-prefix $HOME/.cudaq \ | |
- name: Upload artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: wheels-py${{ matrix.python }}-arm64 | |
path: /wheels/** | |
test-cudaqx-wheels: | |
name: Test CUDA-QX wheels (CPU) | |
needs: linux-build | |
runs-on: linux-arm64-cpu4 | |
container: ubuntu:22.04 | |
permissions: | |
actions: write | |
contents: read | |
strategy: | |
fail-fast: false | |
matrix: | |
platform: [arm64] | |
python: ['3.10'] | |
steps: | |
- name: Get code | |
uses: actions/checkout@v4 | |
with: | |
set-safe-directory: true | |
- name: Install Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python }} | |
- name: Install requirements | |
run: | | |
bash .github/workflows/scripts/install_git_cli.sh | |
apt install -y --no-install-recommends libgfortran5 unzip | |
- name: Download CUDAQX wheels | |
uses: actions/download-artifact@v4 | |
with: | |
name: wheels-py${{ matrix.python }}-${{ matrix.platform }} | |
path: /wheels | |
- name: Test wheels | |
run: | | |
ls /wheels | |
bash scripts/ci/test_wheels.sh ${{ matrix.python }} | |
test-wheels-gpu: | |
name: Test CUDA-QX wheels (GPU) | |
needs: linux-build | |
runs-on: linux-${{ matrix.runner.arch }}-gpu-${{ matrix.runner.gpu }}-latest-1 | |
container: | |
image: nvidia/cuda:12.0.0-base-ubuntu22.04 | |
env: | |
NVIDIA_VISIBLE_DEVICES: ${{ env.NVIDIA_VISIBLE_DEVICES }} | |
permissions: | |
actions: write | |
contents: read | |
strategy: | |
fail-fast: false | |
matrix: | |
runner: [ | |
{ arch: arm64, gpu: a100 }, | |
] | |
python: ['3.10'] | |
steps: | |
- name: Get code | |
uses: actions/checkout@v4 | |
with: | |
set-safe-directory: true | |
- name: Install Python ${{ matrix.python }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python }} | |
- name: Install requirements | |
run: | | |
bash .github/workflows/scripts/install_git_cli.sh | |
apt install -y --no-install-recommends libgfortran5 unzip | |
- name: Download CUDAQX wheels | |
uses: actions/download-artifact@v4 | |
with: | |
name: wheels-py${{ matrix.python }}-${{ matrix.runner.arch }} | |
path: /wheels | |
- name: Test wheels | |
continue-on-error: true | |
run: | | |
ls /wheels | |
bash scripts/ci/test_wheels.sh ${{ matrix.python }} | |
- name: Upload any core files | |
if: success() || failure() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: core-files-${{ matrix.python }}-arm64 | |
path: core.* |