From bebe55117a438661f29fcb8465e3e3084978781f Mon Sep 17 00:00:00 2001 From: Vincent Michaud-Rioux Date: Thu, 26 Oct 2023 15:12:00 -0400 Subject: [PATCH] Add GPU test workflows to plugin test matrix [sc-48529] (#528) * update measurement * add openmp to adjgpu * Auto update version * Add support for building multiple backend simulators (#497) * Add PL_BACKEND_LIST * Update the support * Exclude Python bindings * Update HermitianObs name scope conflicts * Auto update version * Cleanup * Update CI to build and check C++ tests of multiple backends (Linux) * Update changelog * Update .github/workflows/tests_linux.yml Co-authored-by: Vincent Michaud-Rioux * Apply code review suggestions * Update .github/workflows/tests_linux.yml Co-authored-by: Amintor Dusko <87949283+AmintorDusko@users.noreply.github.com> --------- Co-authored-by: Dev version update bot Co-authored-by: Vincent Michaud-Rioux Co-authored-by: Amintor Dusko <87949283+AmintorDusko@users.noreply.github.com> * add python layer & isingxy gate in the cpp layer * add batched adjoint method * Update DefaultQubit to DefaultQubitLegacy (#500) * Update DefaultQubit to DefaultQubitLegacy * Update changelog * update pylint disable on fallback * Auto update version * add batch support for adjoint method * add gitignore * tidy up code * Auto update version * make format * revert complexT delete in LKokkosBingds * make format * update based on tidy * fix tidy format * add_gpu_runners_tests * add cuquantum_sdk path to ci workflow * debug * add path to cuquantum sdk * add python layer tests in ci workflow * ci tests * quick fix * skip pr ci for some workflows * quick fix * quick fix * update python ci tests * remove dependency on lightning_qubit in ci * fix directory * fix directory * quick fix * quick fix * test for cuda-12 * update measurement * updata cu12 workflows * add getDataVector support to LQubitRaw * install lightning.qubit before lightning.gpu in ci * update test_obs * activate all CI checks * quick fix * tidy up code * tidy up code * make format * update ci for more tests * tidy up code * tidy up code * tidy up code * make format * fix for codecov * codecov fix * quick fix * quick fix * quick fix * quick test * fix test * fix tests * another quick fix * coverage fix * update ci tests * update ci for no binary * codecov fix * update adj tests for no binary case * update python layer tests * fix codecov * make format * initial commit for MPI * revert to cu11 * enable more py tests * update CI * upload codecov ci * add more tests for statevectorcudamanaged * add more unit tests * add more tests * make format * add more cpp tests * skip cpp tests pauli param gates * make format * add more files to gitignore * Auto update version * init commit * Trigger CI * update gpu runner * quick fix * update fix * add cpp layer for LGPU-MPI backend * add py layer * quick fix * make format * fix for fp32 support in expval calculation * quick fix * fix for cray_mpich_serialize_py * copy to move for hamiltonian operation * add unit tests for adjoint method * add more tests * resolve comments py layer * remove omp support in LGPU * update version * Auto update version * fix based on comments * Add L-GPU and L-Kokkos as package extras (#515) * Add L-GPU and L-Kokkos as package extras * Auto update version * Update changelog * Temp enable the x86 wheel cache * Return wheel storage functionality to normal * Update readme * Auto update version * Trigger CI * Update README.rst Co-authored-by: Amintor Dusko <87949283+AmintorDusko@users.noreply.github.com> --------- Co-authored-by: Dev version update bot Co-authored-by: Amintor Dusko <87949283+AmintorDusko@users.noreply.github.com> * Auto update version * make format * remove sparseH * remove applyHostMatrixGate * Add wheel_linux_x86_64_cu11.yml (#517) * Add wheel_linux_x86_64_cu11.yml * echo COMPILER=g++ >> * python3.9 => python * reinstall g++11 * Try that * Use env vars for versions. * Fix var syntax. * Hardcode versions * Fix custatevec-cu11 * Revert triggers. * Update changelog [skip ci] * resolve more comments * add more tests to non_param gates * resolve cpp tests comments * remove unused methods in measurement class * remove unused methods * resolve more comments * add changelog and matrixhasher * quick update * add more tests and merge base branch * add mpi unit tests for algorithm base class * add more unit tests for utils * ctor test for MPIManager * Add mpi tests to LGPU (#519) * Initial commit mpi tests * Remove label guards * Fix PL_DEVICE * Install lightning_qubit. * Fix ENABLE_MPI * print cuquantum * export cu_sdk * revert define * Debug cpp tests. * Debug cpp tests. * Fix cmake options. * Compile with mpicxx * Specify backend. * Specify backend. * Remove obsolete line. * Specify cov backend * Merge test/cov & try simplifying python * if-no-files-found: error and fix python tests. * Fix mpi find * Install real lightning. * Revert python tests. * Hardcode backend values in python tests * Install lightning_qubit with gpu in python tests * Remove explicit mpich mentions. * Parametrize mpilib name. * Add openmpi tests. * Build only openmpi python tests. * Add timeouts * test/test_apply.py * Revert pull triggers. * Clean gpu-mpi test workflows. * Revert to 804ed24. * Revert back. * Update tests_linux_x86_mpi.yml [ci skip] * Add jobs dep. * Remove module unload * Simplify mpi-gpu tests. * trigger CI * unset CFLAGS. * set CFLAGS * Revert triggers. * Fix pull_request: [skip ci] * trigger CI * Rename test_gpu_cu11.yml -> tests_gpu_cu11.yml [skip ci] * add CI checks for cpp unit tests * add cpp layer ci check for mpi backend * Auto update version * remove redundant blank lines * tidy up code * Trigger CI * remove single GPU backend tests in mpi ci * upload codecov results * add more unit tests * add tests for pauli word based expval * add more docs * add more tests * skip lcov for native gates * add mpi_helpers * add more docstrings * add change log * Auto update version * Auto update version * fix failures caused by merging * add changelog * Trigger multi-GPU runner * add more fp32 tests to the measurement class * add number of devices and mpi procs check * Add coverage for py-mpitests. (#522) * Initial commit mpi tests * Remove label guards * Fix PL_DEVICE * Install lightning_qubit. * Fix ENABLE_MPI * print cuquantum * export cu_sdk * revert define * Debug cpp tests. * Debug cpp tests. * Fix cmake options. * Compile with mpicxx * Specify backend. * Specify backend. * Remove obsolete line. * Specify cov backend * Merge test/cov & try simplifying python * if-no-files-found: error and fix python tests. * Fix mpi find * Install real lightning. * Revert python tests. * Hardcode backend values in python tests * Install lightning_qubit with gpu in python tests * Remove explicit mpich mentions. * Parametrize mpilib name. * Add openmpi tests. * Build only openmpi python tests. * Add timeouts * test/test_apply.py * Revert pull triggers. * Clean gpu-mpi test workflows. * Revert to 804ed24. * Revert back. * Update tests_linux_x86_mpi.yml [ci skip] * Add jobs dep. * Remove module unload * Simplify mpi-gpu tests. * trigger CI * unset CFLAGS. * set CFLAGS * Revert triggers. * Fix pull_request: [skip ci] * trigger CI * Rename test_gpu_cu11.yml -> tests_gpu_cu11.yml [skip ci] * Add coverage for py-mpitests. * Upload mpi-gpu test coverage. * Try other paths. * trigger CI * Add mpi tests. * Fix couple tests. * Fixx test_apply tests? * Add MPI sparse measurements. * Fix format. * Add MPI_Init checks in MPIManager constructors. * Reformat mpitests and add cov for proc > dev error. * Refactor makefile. * Revert to full mpirun path. * Fix couple tests. * Name coverage after matrix.mpilib. * Remove oversubscribe MPI test. * Update changelog [skip ci]. --------- Co-authored-by: Shuli <08cnbj@gmail.com> * add more tests in obs base class * Revert "Merge branch 'add_LGPUMPI' into add_py_LGPUMPI" This reverts commit d3af81987fa6553d1975abf9b5aa9c17bd0edf63, reversing changes made to 6ad1c7c8fd4cee21d7ca3b91aa349e7d1dd2e8ed. * Fix pylint [skip ci] * resolve comments on source codes and tidy up code * Use CRTP to define initSV and remove initSV_MPI * resolve more typos * resolve more typoes * resolve adjoint class * remove py&pybind layer * resolve more comments * Remove redundant blank line * add num mpi & ngpudevice proc check * fix typo * remove unused lines * add more tests * remove initsv_mpi * add reset * make format * use_mpi as _use_mpi in QuantumScriptSerializer * resolve more comments * check->require * make format * rename mpi workflow * Update license. * Add GPU tests in compat workflows. * Add pull_request triggers. * Comment pull_request triggers except compat. * Comment pull_request triggers except compat-latest-latest. * shush CI [skip ci] * Add sparseH for LGPU (#526) * Init commit * Fix std::endl; * Use more generic indices in base std::size_t. * add pybind layer * add python layer * Quick and dirty spham bindings. * Add sparse_ham serialization. * Add sparse_ham tests in tests/test_adjoint_jacobian.py' * Bug fix sparse product. * add sparseH * Trigger CI * Fix python bindings LGPU idxT * Fix serial tests and update changelog. * add more unit tests for sparseH base class * Fix tidy & sparse adjoint test device name. * Fix tidy warning for sparse_ham. * Send backend-specific ops in respective modules. * Fix sparse_hamiltonianmpi_c and add getWires test. * Add sparseH diff capability in LQ. * Add sparse Hamiltonian support for Lightning-Kokkos (#527) * Use more generic indices in base std::size_t. * Quick and dirty spham bindings. * Add sparse_ham serialization. * Add sparse_ham tests in tests/test_adjoint_jacobian.py' * Bug fix sparse product. * Fix python bindings LGPU idxT * Fix serial tests and update changelog. * Fix tidy & sparse adjoint test device name. * Fix tidy warning for sparse_ham. * Send backend-specific ops in respective modules. * Fix sparse_hamiltonianmpi_c and add getWires test. * Fix clang tidy * Comment workflows but tidy. * Fix tidy warn * Add override to sp::getWires * Restore triggers * Update tests_linux_x86_mpi.yml * Add constructibility tests. * Move L-Kokkos-CUDA tests to workflow call, called from tests_gpu_cu11.yml. * Remove GPU deadlock. * Bug fix Python MPI. * Upload both outputs. * Update gcc version in format.yml. * Update .github/CHANGELOG.md [skip ci] Co-authored-by: Amintor Dusko <87949283+AmintorDusko@users.noreply.github.com> * Update .github/workflows/tests_gpu_kokkos.yml [skip ci] Co-authored-by: Amintor Dusko <87949283+AmintorDusko@users.noreply.github.com> * rename argn [skip ci] * Remove unused lines [skip ci] * Fix SparseHamiltonianBase::isEqual. [skip ci] * Trigger CI * Auto update version * Trigger CI * resolve comments * rename dev_kokkos to dev * Fix tidy. --------- Co-authored-by: Vincent Michaud-Rioux Co-authored-by: Vincent Michaud-Rioux Co-authored-by: Amintor Dusko <87949283+AmintorDusko@users.noreply.github.com> Co-authored-by: Dev version update bot * update work flow * resolve comments for unit tests * add more unit tests for sparseH * quick fix * add fp32 tests * tidy up code * remove redundant lines * add pylintrc to mpitests * add mpitests dir to commit-config * add mpitests to .coveragerc * add mpitests path to coveragerc * Add LGPU cu11 workflow to compat. * Add all workflows to latest-latest. * Fix jobs names. * Fix mpitests/test_adjoint_jacobian.py * Fix pylint in mpitests/test_apply [skip ci]. * pylint fix for mpi py_d_e_m_p tets * tidy up cpp code * fix codefactor * revert skipp condition for openfermionpyscf * codefactor fix * add sparseH tests for mpi backend * Install openfermion in CI workflows and fix H2 QChem integration test. * Add LGPU_MPI tests to compat. * update changelog * Add gpu workflows to all compat [skip ci]. * Trigger CI * Change cron time. * Fix tests_lgpu_gpu_mpi name * Fix gpu runner * Turn off compat CPP tests. * workflow_call => pull_request temp * rm -rf Kokkos before mkdir * Dont' run cpp-tests * Use random parameters in test_integration_H2_Hamiltonian * Use 2 contains * Use pytest-rerunfailures in mpi_gpu step * Change cov.xml name * Remove rerun-failures * Try symmetry-breaking mol close to eq. * Add parallel True in .cov * Revert params and add diff names for cov.xml * Add barrier. * Test runscript openmpi * Fix yml format * call bash * Revert couple changes and remove MPI from compat workflows. * Revert changes to src and tests. * Revert triggers. * Auto update version * Remove pull_req trigger from compats. * Revert changes to MPI workflow. [skip ci] * Trigger CI --------- Co-authored-by: Shuli Shu <08cnbj@gmail.com> Co-authored-by: Dev version update bot Co-authored-by: Ali Asadi Co-authored-by: Amintor Dusko <87949283+AmintorDusko@users.noreply.github.com> Co-authored-by: Lee James O'Riordan Co-authored-by: Shuli Shu <31480676+multiphaseCFD@users.noreply.github.com> --- .../workflows/compat-check-latest-latest.yml | 18 +++++- .../workflows/compat-check-latest-stable.yml | 18 +++++- .../workflows/compat-check-stable-latest.yml | 18 +++++- .../workflows/compat-check-stable-stable.yml | 16 ++++- .github/workflows/tests_gpu_cu11.yml | 61 +++++++++++++------ .github/workflows/tests_gpu_kokkos.yml | 42 ++++++++++--- .github/workflows/tests_linux.yml | 11 ++-- pennylane_lightning/core/_version.py | 2 +- 8 files changed, 144 insertions(+), 42 deletions(-) diff --git a/.github/workflows/compat-check-latest-latest.yml b/.github/workflows/compat-check-latest-latest.yml index a1281401f8..71980fede6 100644 --- a/.github/workflows/compat-check-latest-latest.yml +++ b/.github/workflows/compat-check-latest-latest.yml @@ -2,18 +2,30 @@ name: Compat Check w/PL - latest/latest on: schedule: - - cron: "0 3 * * 1-5" # Run daily at 3am Mon-Fri + - cron: "0 0 * * 1-5" # Run daily at 0am Mon-Fri workflow_dispatch: jobs: tests_linux: - name: Lightning-Kokkos Compatibility test (tests_linux) - latest/latest + name: Lightning Compatibility test (tests_linux) - latest/latest uses: ./.github/workflows/tests_linux.yml with: lightning-version: latest pennylane-version: latest + tests_lkokkos_gpu: + name: Lightning Compatibility test (tests_lkokkos_gpu) - latest/latest + uses: ./.github/workflows/tests_gpu_kokkos.yml + with: + lightning-version: latest + pennylane-version: latest + tests_lgpu_gpu: + name: Lightning Compatibility test (tests_lgpu_gpu) - latest/latest + uses: ./.github/workflows/tests_gpu_cu11.yml + with: + lightning-version: latest + pennylane-version: latest tests_without_binary: - name: Lightning-Kokkos Compatibility test (tests_without_binary) - latest/latest + name: Lightning Compatibility test (tests_without_binary) - latest/latest uses: ./.github/workflows/tests_without_binary.yml with: lightning-version: latest diff --git a/.github/workflows/compat-check-latest-stable.yml b/.github/workflows/compat-check-latest-stable.yml index dca7f38a43..2086d70059 100644 --- a/.github/workflows/compat-check-latest-stable.yml +++ b/.github/workflows/compat-check-latest-stable.yml @@ -2,18 +2,30 @@ name: Compat Check w/PL - latest/stable on: schedule: - - cron: "0 3 * * 1-5" # Run daily at 3am Mon-Fri + - cron: "0 1 * * 1-5" # Run daily at 3am Mon-Fri workflow_dispatch: jobs: tests_linux: - name: Lightning-Kokkos Compatibility test (tests_linux) - latest/stable + name: Lightning Compatibility test (tests_linux) - latest/stable uses: ./.github/workflows/tests_linux.yml with: lightning-version: latest pennylane-version: stable + tests_lkokkos_gpu: + name: Lightning Compatibility test (tests_lkokkos_gpu) - latest/stable + uses: ./.github/workflows/tests_gpu_kokkos.yml + with: + lightning-version: latest + pennylane-version: stable + tests_lgpu_gpu: + name: Lightning Compatibility test (tests_lgpu_gpu) - latest/stable + uses: ./.github/workflows/tests_gpu_cu11.yml + with: + lightning-version: latest + pennylane-version: stable tests_without_binary: - name: Lightning-Kokkos Compatibility test (tests_without_binary) - latest/stable + name: Lightning Compatibility test (tests_without_binary) - latest/stable uses: ./.github/workflows/tests_without_binary.yml with: lightning-version: latest diff --git a/.github/workflows/compat-check-stable-latest.yml b/.github/workflows/compat-check-stable-latest.yml index c5803ca7d8..9444a792f2 100644 --- a/.github/workflows/compat-check-stable-latest.yml +++ b/.github/workflows/compat-check-stable-latest.yml @@ -2,18 +2,30 @@ name: Compat Check w/PL - stable/latest on: schedule: - - cron: "0 3 * * 1-5" # Run daily at 3am Mon-Fri + - cron: "0 2 * * 1-5" # Run daily at 3am Mon-Fri workflow_dispatch: jobs: tests_linux: - name: Lightning-Kokkos Compatibility test (tests_linux) - stable/latest + name: Lightning Compatibility test (tests_linux) - stable/latest uses: ./.github/workflows/tests_linux.yml with: lightning-version: stable pennylane-version: latest + tests_lkokkos_gpu: + name: Lightning Compatibility test (tests_lkokkos_gpu) - stable/latest + uses: ./.github/workflows/tests_gpu_kokkos.yml + with: + lightning-version: stable + pennylane-version: latest + tests_lgpu_gpu: + name: Lightning Compatibility test (tests_lgpu_gpu) - stable/latest + uses: ./.github/workflows/tests_gpu_cu11.yml + with: + lightning-version: stable + pennylane-version: latest tests_without_binary: - name: Lightning-Kokkos Compatibility test (tests_without_binary) - stable/latest + name: Lightning Compatibility test (tests_without_binary) - stable/latest uses: ./.github/workflows/tests_without_binary.yml with: lightning-version: stable diff --git a/.github/workflows/compat-check-stable-stable.yml b/.github/workflows/compat-check-stable-stable.yml index bc9842bd9b..049230d764 100644 --- a/.github/workflows/compat-check-stable-stable.yml +++ b/.github/workflows/compat-check-stable-stable.yml @@ -7,13 +7,25 @@ on: jobs: tests_linux: - name: Lightning-Kokkos Compatibility test (tests_linux) - stable/stable + name: Lightning Compatibility test (tests_linux) - stable/stable uses: ./.github/workflows/tests_linux.yml with: lightning-version: stable pennylane-version: stable + tests_lkokkos_gpu: + name: Lightning Compatibility test (tests_lkokkos_gpu) - stable/stable + uses: ./.github/workflows/tests_gpu_kokkos.yml + with: + lightning-version: stable + pennylane-version: stable + tests_lgpu_gpu: + name: Lightning Compatibility test (tests_lgpu_gpu) - stable/stable + uses: ./.github/workflows/tests_gpu_cu11.yml + with: + lightning-version: stable + pennylane-version: stable tests_without_binary: - name: Lightning-Kokkos Compatibility test (tests_without_binary) - stable/stable + name: Lightning Compatibility test (tests_without_binary) - stable/stable uses: ./.github/workflows/tests_without_binary.yml with: lightning-version: stable diff --git a/.github/workflows/tests_gpu_cu11.yml b/.github/workflows/tests_gpu_cu11.yml index 925491efe6..384d9ca019 100644 --- a/.github/workflows/tests_gpu_cu11.yml +++ b/.github/workflows/tests_gpu_cu11.yml @@ -1,9 +1,19 @@ name: Testing::Linux::x86_64::LGPU on: - pull_request: - push: - branches: - - master + workflow_run: + workflows: ["Testing::LKokkos::CUDA"] + types: + - completed + workflow_call: + inputs: + lightning-version: + type: string + required: true + description: The version of lightning to use. Valid values are either 'stable' (most recent git-tag) or 'latest' (most recent commit from master) + pennylane-version: + type: string + required: true + description: The version of PennyLane to use. Valid values are either 'stable' (most recent git-tag) or 'latest' (most recent commit from master) env: CI_CUDA_ARCH: 86 @@ -41,6 +51,7 @@ jobs: nvidia-smi cpptestswithLGPU_cu11: + if: ${{ github.event_name != 'workflow_call' }} needs: [builddeps] strategy: matrix: @@ -48,7 +59,10 @@ jobs: pl_backend: ["lightning_gpu"] name: C++ tests (Lightning-GPU) - runs-on: ${{ matrix.os }} + runs-on: + - ${{ matrix.os }} + - self-hosted + - gpu steps: - name: Validate GPU version and installed compiler @@ -104,10 +118,6 @@ jobs: - name: Install required packages run: | python -m pip install ninja cmake custatevec-cu11 - - - name: Install Latest PennyLane - if: inputs.pennylane-version == 'latest' - run: python -m pip install git+https://github.com/PennyLaneAI/pennylane.git@master - name: Build and run unit tests run: | @@ -143,7 +153,7 @@ jobs: if-no-files-found: error pythontestswithLGPU: - needs: [builddeps, cpptestswithLGPU_cu11] + needs: [builddeps] strategy: matrix: os: [ubuntu-22.04] @@ -151,7 +161,10 @@ jobs: default_backend: ["lightning_qubit"] name: Python tests with LGPU - runs-on: ${{ matrix.os }} + runs-on: + - ${{ matrix.os }} + - self-hosted + - gpu steps: - name: Validate GPU version and installed compiler @@ -167,8 +180,18 @@ jobs: - name: Checkout PennyLane-Lightning uses: actions/checkout@v3 with: + fetch-tags: true path: main + - name: Switch to stable build of Lightning + if: inputs.lightning-version == 'stable' + run: | + cd main + git fetch --tags --force + git checkout $(git tag | sort -V | tail -1) + git log -1 --format='%H' + git status + - uses: actions/setup-python@v4 name: Install Python with: @@ -204,15 +227,17 @@ 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: | - python -m pip install pip~=22.0 - python -m pip install ninja cmake custatevec-cu11 pytest pytest-mock flaky pytest-cov openfermionpyscf + cd main + python -m pip install -r requirements-dev.txt + python -m pip install cmake custatevec-cu11 openfermionpyscf + + - name: Install Stable PennyLane + if: inputs.pennylane-version == 'stable' + run: | + cd main + python -m pip uninstall -y pennylane && python -m pip install -U pennylane - name: Build and install package env: diff --git a/.github/workflows/tests_gpu_kokkos.yml b/.github/workflows/tests_gpu_kokkos.yml index e65aa0697d..2879be1c8b 100644 --- a/.github/workflows/tests_gpu_kokkos.yml +++ b/.github/workflows/tests_gpu_kokkos.yml @@ -1,5 +1,15 @@ name: Testing::LKokkos::GPU on: + workflow_call: + inputs: + lightning-version: + type: string + required: true + description: The version of lightning to use. Valid values are either 'stable' (most recent git-tag) or 'latest' (most recent commit from master) + pennylane-version: + type: string + required: true + description: The version of PennyLane to use. Valid values are either 'stable' (most recent git-tag) or 'latest' (most recent commit from master) pull_request: push: branches: @@ -14,7 +24,7 @@ env: TORCH_VERSION: 1.11.0+cpu concurrency: - group: tests_gpu-${{ github.ref }} + group: tests_gpu-${{ github.ref }}-${{ inputs.lightning-version }}-${{ inputs.pennylane-version }} cancel-in-progress: true jobs: @@ -73,7 +83,7 @@ jobs: cd - - name: Test Kokkos core library (Ubuntu) - env: + env: CMAKE_PREFIX_PATH: ${{ github.workspace }}/Kokkos_install/${{ matrix.exec_model }} run: | set -x @@ -103,11 +113,11 @@ jobs: kokkos_version: ["4.1.00"] name: C++ tests (Kokkos) - runs-on: + runs-on: - ${{ matrix.os }} - self-hosted - gpu - + steps: - name: Validate GPU version and installed compiler run: | @@ -190,11 +200,11 @@ jobs: kokkos_version: ["4.1.00"] name: Python tests with Kokkos - runs-on: + runs-on: - ${{ matrix.os }} - self-hosted - gpu - + steps: - name: Validate GPU version and installed compiler run: | @@ -224,6 +234,16 @@ jobs: uses: actions/checkout@v3 with: path: main + fetch-tags: true + + - name: Switch to stable build of Lightning + if: inputs.lightning-version == 'stable' + run: | + cd main + git fetch --tags --force + git checkout $(git tag | sort -V | tail -1) + git log -1 --format='%H' + git status - uses: actions/setup-python@v4 name: Install Python @@ -239,6 +259,12 @@ jobs: python -m pip install -r requirements-dev.txt python -m pip install openfermionpyscf + - name: Install Stable PennyLane + if: inputs.pennylane-version == 'stable' + run: | + cd main + python -m pip uninstall -y pennylane && python -m pip install -U pennylane + - name: Install ML libraries for interfaces run: | python -m pip install --upgrade torch==$TORCH_VERSION -f https://download.pytorch.org/whl/cpu/torch_stable.html @@ -256,7 +282,7 @@ jobs: - name: Run PennyLane-Lightning unit tests if: ${{ matrix.pl_backend != 'all'}} - env: + env: OMP_NUM_THREADS: 1 OMP_PROC_BIND: false run: | @@ -279,7 +305,7 @@ jobs: - name: Run PennyLane-Lightning unit tests for lightning.qubit with all devices installed if: ${{ matrix.pl_backend == 'all' }} - env: + env: OMP_NUM_THREADS: 1 OMP_PROC_BIND: false run: | diff --git a/.github/workflows/tests_linux.yml b/.github/workflows/tests_linux.yml index 672327341c..b5df17d2ea 100644 --- a/.github/workflows/tests_linux.yml +++ b/.github/workflows/tests_linux.yml @@ -28,7 +28,7 @@ concurrency: jobs: cpptests: - if: ${{ github.event_name != 'workflow_call' || (inputs.lightning-version == 'latest' && inputs.pennylane-version == 'latest') }} + if: ${{ github.event_name != 'workflow_call' }} strategy: matrix: os: [ubuntu-22.04] @@ -154,7 +154,7 @@ jobs: path: ./main/coverage-${{ github.job }}-${{ matrix.pl_backend }}.xml cpptestswithOpenBLAS: - if: ${{ github.event_name != 'workflow_call' || (inputs.lightning-version == 'latest' && inputs.pennylane-version == 'latest') }} + if: ${{ github.event_name != 'workflow_call' }} strategy: matrix: os: [ubuntu-22.04] @@ -287,7 +287,7 @@ jobs: os: ubuntu-22.04 cpptestswithKokkos: - if: ${{ github.event_name != 'workflow_call' || (inputs.lightning-version == 'latest' && inputs.pennylane-version == 'latest') }} + if: ${{ github.event_name != 'workflow_call' }} needs: [build_and_cache_Kokkos] strategy: matrix: @@ -318,6 +318,7 @@ jobs: - name: Copy cached libraries if: steps.kokkos-cache.outputs.cache-hit == 'true' run: | + rm -rf Kokkos mkdir Kokkos/ cp -rf ${{ github.workspace}}/Kokkos_install/${{ matrix.exec_model }}/* Kokkos/ @@ -403,6 +404,7 @@ jobs: - name: Copy cached libraries if: steps.kokkos-cache.outputs.cache-hit == 'true' run: | + rm -rf Kokkos mkdir Kokkos/ cp -rf ${{ github.workspace}}/Kokkos_install/${{ matrix.exec_model }}/* Kokkos/ pwd @@ -514,7 +516,7 @@ jobs: cpptestsWithMultipleBackends: # Device-specific tests are performed for both. Device-agnostic tests default to LightningQubit. - if: ${{ github.event_name != 'workflow_call' || (inputs.lightning-version == 'latest' && inputs.pennylane-version == 'latest') }} + if: ${{ github.event_name != 'workflow_call' }} needs: [build_and_cache_Kokkos] strategy: matrix: @@ -544,6 +546,7 @@ jobs: - name: Copy cached libraries if: steps.kokkos-cache.outputs.cache-hit == 'true' run: | + rm -rf Kokkos mkdir Kokkos/ cp -rf ${{ github.workspace}}/Kokkos_install/${{ matrix.exec_model }}/* Kokkos/ diff --git a/pennylane_lightning/core/_version.py b/pennylane_lightning/core/_version.py index d276e92d29..1b4aa2961a 100644 --- a/pennylane_lightning/core/_version.py +++ b/pennylane_lightning/core/_version.py @@ -16,4 +16,4 @@ Version number (major.minor.patch[-label]) """ -__version__ = "0.33.0-dev24" +__version__ = "0.33.0-dev25"