From 49c8a8da9ea264c0f4a2e00cc03a6bbe104b01b7 Mon Sep 17 00:00:00 2001 From: Vincent Michaud-Rioux Date: Mon, 30 Oct 2023 08:18:47 -0400 Subject: [PATCH] Add MPI compat workflows. --- .github/workflows/changelog_reminder.yml | 2 +- .../workflows/compat-check-latest-latest.yml | 6 +++ .../workflows/compat-check-latest-stable.yml | 6 +++ .../compat-check-release-release.yml | 7 ++++ .../workflows/compat-check-stable-latest.yml | 6 +++ .../workflows/compat-check-stable-stable.yml | 6 +++ .github/workflows/format.yml | 2 +- .github/workflows/tests_gpu_kokkos.yml | 2 +- .github/workflows/tests_linux.yml | 2 +- .github/workflows/tests_linux_x86_mpi_gpu.yml | 39 +++++++++++++------ .github/workflows/tests_windows.yml | 2 +- .github/workflows/tests_without_binary.yml | 2 +- .github/workflows/update_dev_version.yml | 2 +- .github/workflows/wheel_linux_x86_64.yml | 2 +- .github/workflows/wheel_linux_x86_64_cu11.yml | 2 +- .github/workflows/wheel_macos_arm64.yml | 2 +- .github/workflows/wheel_macos_x86_64.yml | 2 +- .github/workflows/wheel_noarch.yml | 2 +- .github/workflows/wheel_win_x86_64.yml | 2 +- 19 files changed, 72 insertions(+), 24 deletions(-) diff --git a/.github/workflows/changelog_reminder.yml b/.github/workflows/changelog_reminder.yml index 2eb934c165..4d3b120541 100644 --- a/.github/workflows/changelog_reminder.yml +++ b/.github/workflows/changelog_reminder.yml @@ -1,5 +1,5 @@ on: - pull_request: + #pull_request: types: [opened, ready_for_review] name: Changelog Reminder diff --git a/.github/workflows/compat-check-latest-latest.yml b/.github/workflows/compat-check-latest-latest.yml index 71980fede6..16a11078b1 100644 --- a/.github/workflows/compat-check-latest-latest.yml +++ b/.github/workflows/compat-check-latest-latest.yml @@ -24,6 +24,12 @@ jobs: with: lightning-version: latest pennylane-version: latest + tests_lgpu_gpu_mpi: + name: Lightning Compatibility test (tests_lgpu_gpu_mpi) - latest/latest + uses: ./.github/workflows/tests_linux_x86_mpi_gpu.yml + with: + lightning-version: latest + pennylane-version: latest tests_without_binary: name: Lightning Compatibility test (tests_without_binary) - latest/latest uses: ./.github/workflows/tests_without_binary.yml diff --git a/.github/workflows/compat-check-latest-stable.yml b/.github/workflows/compat-check-latest-stable.yml index 2086d70059..d370a1240e 100644 --- a/.github/workflows/compat-check-latest-stable.yml +++ b/.github/workflows/compat-check-latest-stable.yml @@ -24,6 +24,12 @@ jobs: with: lightning-version: latest pennylane-version: stable + tests_lgpu_gpu_mpi: + name: Lightning Compatibility test (tests_lgpu_gpu_mpi) - latest/stable + uses: ./.github/workflows/tests_linux_x86_mpi_gpu.yml + with: + lightning-version: latest + pennylane-version: stable tests_without_binary: name: Lightning Compatibility test (tests_without_binary) - latest/stable uses: ./.github/workflows/tests_without_binary.yml diff --git a/.github/workflows/compat-check-release-release.yml b/.github/workflows/compat-check-release-release.yml index 8d3c6228bc..9dd9f63ad3 100644 --- a/.github/workflows/compat-check-release-release.yml +++ b/.github/workflows/compat-check-release-release.yml @@ -1,6 +1,7 @@ name: Compat Check w/PL - release/release on: + pull_request: schedule: - cron: "0 4 * * 1-5" # Run daily at 0am Mon-Fri workflow_dispatch: @@ -24,6 +25,12 @@ jobs: with: lightning-version: release pennylane-version: release + tests_lgpu_gpu_mpi: + name: Lightning Compatibility test (tests_lgpu_gpu_mpi) - release/release + uses: ./.github/workflows/tests_linux_x86_mpi_gpu.yml + with: + lightning-version: release + pennylane-version: release tests_without_binary: name: Lightning Compatibility test (tests_without_binary) - release/release uses: ./.github/workflows/tests_without_binary.yml diff --git a/.github/workflows/compat-check-stable-latest.yml b/.github/workflows/compat-check-stable-latest.yml index 9444a792f2..65eceb4aed 100644 --- a/.github/workflows/compat-check-stable-latest.yml +++ b/.github/workflows/compat-check-stable-latest.yml @@ -24,6 +24,12 @@ jobs: with: lightning-version: stable pennylane-version: latest + tests_lgpu_gpu_mpi: + name: Lightning Compatibility test (tests_lgpu_gpu_mpi) - stable/latest + uses: ./.github/workflows/tests_linux_x86_mpi_gpu.yml + with: + lightning-version: stable + pennylane-version: latest tests_without_binary: name: Lightning Compatibility test (tests_without_binary) - stable/latest uses: ./.github/workflows/tests_without_binary.yml diff --git a/.github/workflows/compat-check-stable-stable.yml b/.github/workflows/compat-check-stable-stable.yml index 049230d764..4bcba8fcbb 100644 --- a/.github/workflows/compat-check-stable-stable.yml +++ b/.github/workflows/compat-check-stable-stable.yml @@ -24,6 +24,12 @@ jobs: with: lightning-version: stable pennylane-version: stable + tests_lgpu_gpu_mpi: + name: Lightning Compatibility test (tests_lgpu_gpu_mpi) - stable/stable + uses: ./.github/workflows/tests_linux_x86_mpi_gpu.yml + with: + lightning-version: stable + pennylane-version: stable tests_without_binary: name: Lightning Compatibility test (tests_without_binary) - stable/stable uses: ./.github/workflows/tests_without_binary.yml diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml index 350312d253..c51611563c 100644 --- a/.github/workflows/format.yml +++ b/.github/workflows/format.yml @@ -1,6 +1,6 @@ name: Formatting check on: - pull_request: + #pull_request: push: branches: - master diff --git a/.github/workflows/tests_gpu_kokkos.yml b/.github/workflows/tests_gpu_kokkos.yml index 7648dc4333..a52ef9dbb4 100644 --- a/.github/workflows/tests_gpu_kokkos.yml +++ b/.github/workflows/tests_gpu_kokkos.yml @@ -10,7 +10,7 @@ on: type: string required: true description: The version of PennyLane to use. Valid values are either 'release' (most recent release candidate), 'stable' (most recent git-tag) or 'latest' (most recent commit from master) - pull_request: + #pull_request: push: branches: - master diff --git a/.github/workflows/tests_linux.yml b/.github/workflows/tests_linux.yml index a9df47f2d6..f4b8c7154d 100644 --- a/.github/workflows/tests_linux.yml +++ b/.github/workflows/tests_linux.yml @@ -10,7 +10,7 @@ on: type: string required: true description: The version of PennyLane to use. Valid values are either 'release' (most recent release candidate), 'stable' (most recent git-tag) or 'latest' (most recent commit from master) - pull_request: + #pull_request: push: branches: - master diff --git a/.github/workflows/tests_linux_x86_mpi_gpu.yml b/.github/workflows/tests_linux_x86_mpi_gpu.yml index e879415492..96688e2172 100644 --- a/.github/workflows/tests_linux_x86_mpi_gpu.yml +++ b/.github/workflows/tests_linux_x86_mpi_gpu.yml @@ -14,7 +14,7 @@ on: push: branches: - main - pull_request: + #pull_request: env: COVERAGE_FLAGS: "--cov=pennylane_lightning --cov-report=term-missing --cov-report=xml:./coverage.xml --no-flaky-report -p no:warnings --tb=native" @@ -28,7 +28,7 @@ concurrency: jobs: cpp_tests: - if: contains(github.event.pull_request.labels.*.name, 'ci:use-multi-gpu-runner') || (inputs.lightning-version != '' && inputs.pennylane-version != '') + if: contains(github.event.pull_request.labels.*.name, 'ci:use-multi-gpu-runner') && contains(fromJSON('["push", "pull_request", "release"]'), github.event_name) runs-on: - self-hosted - linux @@ -159,7 +159,7 @@ jobs: python_tests: - if: contains(github.event.pull_request.labels.*.name, 'ci:use-multi-gpu-runner') || (inputs.lightning-version != '' && inputs.pennylane-version != '') + if: contains(github.event.pull_request.labels.*.name, 'ci:use-multi-gpu-runner') runs-on: - self-hosted - linux @@ -178,12 +178,19 @@ jobs: with: fetch-tags: true + - name: Switch to release build of Lightning + if: inputs.lightning-version == 'release' + run: | + git fetch --all + git checkout $(git branch -a --list "origin/v*rc*" | tail -1) + - name: Switch to stable build of Lightning if: inputs.lightning-version == 'stable' run: | - git fetch tags --force + git fetch --tags --force git checkout $(git tag | sort -V | tail -1) + - uses: actions/setup-python@v4 id: setup_python name: Install Python @@ -222,18 +229,28 @@ jobs: echo "PIP Path => $pip_path" echo "pip=$pip_path" >> $GITHUB_OUTPUT - - name: Install Latest PennyLane - # We want to install the latest PL on non workflow_call events - if: inputs.pennylane-version == 'latest' || inputs.pennylane-version == '' - run: python -m pip install git+https://github.com/PennyLaneAI/pennylane.git@master - - name: Install required packages run: | source /etc/profile.d/modules.sh && module use /opt/modules/ && module load ${{ matrix.mpilib }} - python -m pip install pip~=22.0 - python -m pip install ninja cmake custatevec-cu11 pytest pytest-mock flaky pytest-cov mpi4py openfermionpyscf + python -m pip install -r requirements-dev.txt + python -m pip install cmake custatevec-cu11 mpi4py openfermionpyscf SKIP_COMPILATION=True PL_BACKEND=lightning_qubit python -m pip install -e . -vv + - name: Checkout PennyLane for release build + if: inputs.pennylane-version == 'release' + uses: actions/checkout@v3 + with: + path: pennylane + repository: PennyLaneAI/pennylane + + - name: Switch to release build of PennyLane + if: inputs.pennylane-version == 'release' + run: | + cd pennylane + git fetch --all + git checkout $(git branch -a --list "origin/v*rc*" | tail -1) + python -m pip uninstall -y pennylane && python -m pip install . -vv --no-deps + - name: Build and install package env: CUQUANTUM_SDK: $(python -c "import site; print( f'{site.getsitepackages()[0]}/cuquantum/lib')") diff --git a/.github/workflows/tests_windows.yml b/.github/workflows/tests_windows.yml index 36f34bf23b..98cd80b5ee 100644 --- a/.github/workflows/tests_windows.yml +++ b/.github/workflows/tests_windows.yml @@ -3,7 +3,7 @@ on: push: branches: - master - pull_request: + #pull_request: concurrency: group: tests_windows-${{ github.ref }} diff --git a/.github/workflows/tests_without_binary.yml b/.github/workflows/tests_without_binary.yml index 680b2b75c3..41374228df 100644 --- a/.github/workflows/tests_without_binary.yml +++ b/.github/workflows/tests_without_binary.yml @@ -10,7 +10,7 @@ on: type: string required: true description: The version of PennyLane to use. Valid values are either 'release' (most recent release candidate), 'stable' (most recent git-tag) or 'latest' (most recent commit from master) - pull_request: + #pull_request: push: branches: - master diff --git a/.github/workflows/update_dev_version.yml b/.github/workflows/update_dev_version.yml index bfa66e1e8b..02062bdb5c 100644 --- a/.github/workflows/update_dev_version.yml +++ b/.github/workflows/update_dev_version.yml @@ -1,6 +1,6 @@ name: Update dev version automatically on: - pull_request: + #pull_request: jobs: update-dev-version: diff --git a/.github/workflows/wheel_linux_x86_64.yml b/.github/workflows/wheel_linux_x86_64.yml index a9b7be8e07..059980d6c0 100644 --- a/.github/workflows/wheel_linux_x86_64.yml +++ b/.github/workflows/wheel_linux_x86_64.yml @@ -9,7 +9,7 @@ env: GCC_VERSION: 11 on: - pull_request: + #pull_request: push: branches: - master diff --git a/.github/workflows/wheel_linux_x86_64_cu11.yml b/.github/workflows/wheel_linux_x86_64_cu11.yml index 2b270c4b0e..c4dd47bc68 100644 --- a/.github/workflows/wheel_linux_x86_64_cu11.yml +++ b/.github/workflows/wheel_linux_x86_64_cu11.yml @@ -11,7 +11,7 @@ env: CUDA_VERSION_MINOR: 5 on: - pull_request: + #pull_request: push: branches: - master diff --git a/.github/workflows/wheel_macos_arm64.yml b/.github/workflows/wheel_macos_arm64.yml index 42155c69a9..44716b4aca 100644 --- a/.github/workflows/wheel_macos_arm64.yml +++ b/.github/workflows/wheel_macos_arm64.yml @@ -6,7 +6,7 @@ name: Wheel::MacOS::ARM # **Who does it impact**: Wheels to be uploaded to PyPI. on: - pull_request: + #pull_request: push: branches: - master diff --git a/.github/workflows/wheel_macos_x86_64.yml b/.github/workflows/wheel_macos_x86_64.yml index 188739b67d..6b54c18346 100644 --- a/.github/workflows/wheel_macos_x86_64.yml +++ b/.github/workflows/wheel_macos_x86_64.yml @@ -6,7 +6,7 @@ name: Wheel::MacOS::Intel # **Who does it impact**: Wheels to be uploaded to PyPI. on: - pull_request: + #pull_request: push: branches: - master diff --git a/.github/workflows/wheel_noarch.yml b/.github/workflows/wheel_noarch.yml index d3e6622730..000a800cf2 100644 --- a/.github/workflows/wheel_noarch.yml +++ b/.github/workflows/wheel_noarch.yml @@ -6,7 +6,7 @@ name: Wheel::Any::None # **Who does it impact**: Wheels to be uploaded to PyPI. on: - pull_request: + #pull_request: push: branches: - master diff --git a/.github/workflows/wheel_win_x86_64.yml b/.github/workflows/wheel_win_x86_64.yml index 62bd651055..dcb5157d08 100644 --- a/.github/workflows/wheel_win_x86_64.yml +++ b/.github/workflows/wheel_win_x86_64.yml @@ -6,7 +6,7 @@ name: Wheel::Windows::x86_64 # **Who does it impact**: Wheels to be uploaded to PyPI. on: - pull_request: + #pull_request: push: branches: - master