Skip to content

Commit

Permalink
Merge branch 'master' into feature/generic_gate_functor
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentmr authored May 7, 2024
2 parents 521d2ad + e0a4dbe commit 2551412
Show file tree
Hide file tree
Showing 12 changed files with 123 additions and 108 deletions.
20 changes: 18 additions & 2 deletions .github/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@
* Lightning-Kokkos' functors are rewritten as functions wrapping around generic gate and generator functors templated over a coefficient interaction function. This reduces boilerplate while clarifying how the various kernels differ from one another.
[(#640)](https://github.com/PennyLaneAI/pennylane-lightning/pull/640)

* The various OpenMP configurations of Lightning-Qubit are tested in parallel on different Github Actions runners.
[(#712)](https://github.com/PennyLaneAI/pennylane-lightning/pull/712)

* Update Linux wheels to use manylinux_2_28 images.
[(#667)](https://github.com/PennyLaneAI/pennylane-lightning/pull/667)

### Documentation

### Bug fixes
Expand All @@ -17,6 +23,8 @@

This release contains contributions from (in alphabetical order):

Amintor Dusko, Vincent Michaud-Rioux

---

# Release 0.36.0
Expand Down Expand Up @@ -67,7 +75,6 @@ This release contains contributions from (in alphabetical order):

* Split Lightning-Qubit and Lightning-Kokkos CPU Python tests with `pytest-split`. Remove `SERIAL` from Kokkos' `exec_model` matrix. Remove `all` from Lightning-Kokkos' `pl_backend` matrix. Move `clang-tidy` checks to `tidy.yml`. Avoid editable `pip` installations.
[(#696)](https://github.com/PennyLaneAI/pennylane-lightning/pull/696)

* Update `lightning.gpu` and `lightning.kokkos` to raise an error instead of falling back to `default.qubit`.
[(#689)](https://github.com/PennyLaneAI/pennylane-lightning/pull/689)

Expand Down Expand Up @@ -165,11 +172,20 @@ This release contains contributions from (in alphabetical order):
* Update the version of `codecov-action` to v4 and fix the CodeCov issue with the PL-Lightning check-compatibility actions.
[(#682)](https://github.com/PennyLaneAI/pennylane-lightning/pull/682)

* Refactor of dev prerelease auto-update-version workflow.
[(#685)](https://github.com/PennyLaneAI/pennylane-lightning/pull/685)

* Remove gates unsupported by catalyst from toml file.
[(#698)](https://github.com/PennyLaneAI/pennylane-lightning/pull/698)

* Increase tolerance for a flaky test.
[(#703)](https://github.com/PennyLaneAI/pennylane-lightning/pull/703)

### Contributors

This release contains contributions from (in alphabetical order):

Ali Asadi, Amintor Dusko, Christina Lee, Vincent Michaud-Rioux, Lee James O'Riordan, Mudit Pandey, Shuli Shu
Ali Asadi, Amintor Dusko, Thomas Germain, Christina Lee, Erick Ochoa Lopez, Vincent Michaud-Rioux, Rashid N H M, Lee James O'Riordan, Mudit Pandey, Shuli Shu

---

Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/tests_lgpu_python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ on:
release:
pull_request:
paths-ignore:
- .github
- '!.github/workflows/tests_lgpu_python.yml'
- pennylane_lightning/core/src/simulators/lightning_kokkos/**
- pennylane_lightning/core/src/simulators/lightning_qubit/**
- pennylane_lightning/lightning_kokkos/**
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/tests_lgpumpi_python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ on:
- main
pull_request:
paths-ignore:
- .github
- '!.github/workflows/tests_lgpumpi_python.yml'
- pennylane_lightning/core/src/simulators/lightning_kokkos/**
- pennylane_lightning/core/src/simulators/lightning_qubit/**
- pennylane_lightning/lightning_kokkos/**
Expand Down
69 changes: 23 additions & 46 deletions .github/workflows/tests_linux_cpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@ jobs:
strategy:
matrix:
pl_backend: ["lightning_qubit"]
enable_kernel_omp: ["OFF", "ON"]
enable_kernel_avx_stream: ["OFF", "ON"]
exclude:
- enable_kernel_omp: OFF
enable_kernel_avx_stream: ON
timeout-minutes: 60
name: C++ tests
runs-on: ${{ needs.determine_runner.outputs.runner_group }}
Expand All @@ -66,65 +71,39 @@ jobs:
- name: Build and run unit tests
run: |
cmake . -BBuild -G Ninja \
-DCMAKE_BUILD_TYPE=Debug \
-DBUILD_TESTS=ON \
-DENABLE_PYTHON=OFF \
-DPL_BACKEND=${{ matrix.pl_backend }} \
-DCMAKE_CXX_COMPILER=$(which g++-$GCC_VERSION) \
-DENABLE_COVERAGE=ON
cmake . -BBuildKernelOMP -G Ninja \
-DCMAKE_BUILD_TYPE=Debug \
-DBUILD_TESTS=ON \
-DENABLE_PYTHON=OFF \
-DPL_BACKEND=${{ matrix.pl_backend }} \
-DCMAKE_CXX_COMPILER=$(which g++-$GCC_VERSION) \
-DENABLE_COVERAGE=ON \
-DLQ_ENABLE_KERNEL_OMP=ON
cmake . -BBuildKernelAVXStream -G Ninja \
-DCMAKE_BUILD_TYPE=Debug \
-DBUILD_TESTS=ON \
-DENABLE_PYTHON=OFF \
-DPL_BACKEND=${{ matrix.pl_backend }} \
-DCMAKE_CXX_COMPILER=$(which g++-$GCC_VERSION) \
-DENABLE_COVERAGE=ON \
-DLQ_ENABLE_KERNEL_AVX_STREAM=ON \
-DLQ_ENABLE_KERNEL_OMP=ON
-DLQ_ENABLE_KERNEL_AVX_STREAM=${{ matrix.enable_kernel_avx_stream }} \
-DLQ_ENABLE_KERNEL_OMP=${{ matrix.enable_kernel_omp }}
cmake --build ./Build
cmake --build ./BuildKernelOMP
cmake --build ./BuildKernelAVXStream

for d in Build BuildKernelOMP BuildKernelAVXStream; do
cd ./$d
mkdir -p ./tests/results
for file in *runner ; do ./$file --order lex --reporter junit --out ./tests/results/report_$file.xml; done;
lcov --directory . -b ../pennylane_lightning/core/src --capture --output-file coverage.info
lcov --remove coverage.info '/usr/*' --output-file coverage.info
cd ..
done
lcov --add-tracefile ./Build/coverage.info -a ./BuildKernelOMP/coverage.info \
--add-tracefile ./BuildKernelAVXStream/coverage.info -o coverage.info
mv coverage.info coverage-${{ github.job }}-${{ matrix.pl_backend }}.info
cd ./Build
mkdir -p ./tests/results
for file in *runner ; do ./$file --order lex --reporter junit --out ./tests/results/report_$file.xml; done;
lcov --directory . -b ../pennylane_lightning/core/src --capture --output-file coverage.info
lcov --remove coverage.info '/usr/*' --output-file coverage.info
mv coverage.info coverage-${{ github.job }}-${{ matrix.pl_backend }}-${{ matrix.enable_kernel_avx_stream }}-${{ matrix.enable_kernel_omp }}.info
- name: Upload test results
uses: actions/upload-artifact@v3
if: always()
with:
name: ubuntu-tests-reports-${{ github.job }}-${{ matrix.pl_backend }}
name: ubuntu-tests-reports-${{ github.job }}-${{ matrix.pl_backend }}-${{ matrix.enable_kernel_avx_stream }}-${{ matrix.enable_kernel_omp }}
path: |
./Build/tests/results/
./BuildKernelOMP/tests/results/
./BuildKernelAVXStream/tests/results/
if-no-files-found: error

- name: Upload code coverage results
uses: actions/upload-artifact@v3
with:
name: ubuntu-codecov-results-cpp
path: ./coverage-${{ github.job }}-${{ matrix.pl_backend }}.info
name: ubuntu-codecov-results-${{ matrix.pl_backend }}-${{ matrix.enable_kernel_avx_stream }}-${{ matrix.enable_kernel_omp }}
path: ./Build/coverage-${{ github.job }}-${{ matrix.pl_backend }}-${{ matrix.enable_kernel_avx_stream }}-${{ matrix.enable_kernel_omp }}.info
if-no-files-found: error

cpptestswithOpenBLAS:
Expand Down Expand Up @@ -173,14 +152,14 @@ jobs:
uses: actions/upload-artifact@v3
if: always()
with:
name: ubuntu-tests-reports-${{ github.job }}-${{ matrix.pl_backend }}
name: ubuntu-tests-reports-blas-${{ github.job }}-${{ matrix.pl_backend }}
path: ./Build/tests/results/
if-no-files-found: error

- name: Upload code coverage results
uses: actions/upload-artifact@v3
with:
name: ubuntu-codecov-results-cpp
name: ubuntu-codecov-results-blas-${{ matrix.pl_backend }}
path: ./Build/coverage-${{ github.job }}-${{ matrix.pl_backend }}.info
if-no-files-found: error

Expand Down Expand Up @@ -245,8 +224,8 @@ jobs:
-DENABLE_COVERAGE=ON
cmake --build ./Build
cd ./Build
mkdir -p ./tests/results_${{ github.job }}_${{ matrix.pl_backend }}
for file in *runner ; do ./$file --order lex --reporter junit --out ./tests/results_${{ github.job }}_${{ matrix.pl_backend }}/report_$file.xml; done;
mkdir -p ./tests/results-${{ github.job }}-${{ matrix.pl_backend }}
for file in *runner ; do ./$file --order lex --reporter junit --out ./tests/results-${{ github.job }}-${{ matrix.pl_backend }}/report_$file.xml; done;
lcov --directory . -b ../pennylane_lightning/core/src --capture --output-file coverage.info
lcov --remove coverage.info '/usr/*' --output-file coverage.info
mv coverage.info coverage-${{ github.job }}-${{ matrix.pl_backend }}.info
Expand All @@ -255,8 +234,8 @@ jobs:
uses: actions/upload-artifact@v3
if: always()
with:
name: ubuntu-tests-reports-${{ github.job }}_${{ matrix.pl_backend }}
path: ./Build/tests/results_${{ github.job }}_${{ matrix.pl_backend }}
name: ubuntu-tests-reports-${{ github.job }}-${{ matrix.pl_backend }}
path: ./Build/tests/results-${{ github.job }}-${{ matrix.pl_backend }}
if-no-files-found: error

- name: Upload code coverage results
Expand Down Expand Up @@ -329,7 +308,6 @@ jobs:
- name: Build and run unit tests
run: |
set -x
cmake . -BBuild -G Ninja \
-DCMAKE_BUILD_TYPE=Debug \
-DBUILD_TESTS=ON \
Expand All @@ -341,7 +319,6 @@ jobs:
cd ./Build
mkdir -p ./tests/results_multiple_backends
for file in *runner ; do ./$file --order lex --reporter junit --out ./tests/results_multiple_backends/report_$file.xml; done;
set +x
- name: Upload test results
uses: actions/upload-artifact@v3
Expand Down
20 changes: 14 additions & 6 deletions .github/workflows/tests_lkcpu_python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ on:
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:
paths-ignore:
- .github
- '!.github/workflows/tests_lkcpu_python.yml'
- pennylane_lightning/core/src/simulators/lightning_gpu/**
- pennylane_lightning/lightning_gpu/**
- pennylane_lightning/core/src/simulators/lightning_qubit/**
Expand All @@ -34,14 +36,20 @@ concurrency:

jobs:

determine_runner:
name: Determine runner type to use
uses: ./.github/workflows/determine-workflow-runner.yml
with:
default_runner: ubuntu-22.04

build_and_cache_Kokkos:
name: "Build and cache Kokkos"
uses: ./.github/workflows/build_and_cache_Kokkos_linux.yml
with:
os: ubuntu-22.04

build_lightning_kokkos_wheels:
needs: [build_and_cache_Kokkos]
needs: [determine_runner, build_and_cache_Kokkos]
strategy:
matrix:
os: [ubuntu-22.04]
Expand All @@ -50,7 +58,7 @@ jobs:
kokkos_version: ${{ fromJson(needs.build_and_cache_Kokkos.outputs.kokkos_version) }}
timeout-minutes: 60
name: Python tests with Kokkos
runs-on: ${{ matrix.os }}
runs-on: ${{ needs.determine_runner.outputs.runner_group }}

steps:
- name: Checkout PennyLane-Lightning
Expand Down Expand Up @@ -135,7 +143,7 @@ jobs:
${{ github.workspace }}/wheel_${{ matrix.pl_backend }}-${{ matrix.exec_model }}.whl
test_lightning_kokkos_wheels:
needs: [build_and_cache_Kokkos, build_lightning_kokkos_wheels]
needs: [determine_runner, build_and_cache_Kokkos, build_lightning_kokkos_wheels]
strategy:
matrix:
os: [ubuntu-22.04]
Expand All @@ -145,7 +153,7 @@ jobs:
kokkos_version: ${{ fromJson(needs.build_and_cache_Kokkos.outputs.kokkos_version) }}
timeout-minutes: 60
name: Python tests with Kokkos
runs-on: ${{ matrix.os }}
runs-on: ${{ needs.determine_runner.outputs.runner_group }}

steps:
- uses: actions/setup-python@v5
Expand Down Expand Up @@ -235,9 +243,9 @@ jobs:
if-no-files-found: error

upload-to-codecov-linux-python:
needs: [test_lightning_kokkos_wheels]
needs: [determine_runner, test_lightning_kokkos_wheels]
name: Upload python coverage data to codecov
runs-on: ubuntu-latest
runs-on: ${{ needs.determine_runner.outputs.runner_group }}
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/tests_lkcuda_python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ on:
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:
paths-ignore:
- .github
- '!.github/workflows/tests_lkcuda_python.yml'
- pennylane_lightning/core/src/simulators/lightning_gpu/**
- pennylane_lightning/core/src/simulators/lightning_qubit/**
- pennylane_lightning/lightning_gpu/**
Expand Down
21 changes: 14 additions & 7 deletions .github/workflows/tests_lqcpu_python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ on:
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:
paths-ignore:
- .github
- '!.github/workflows/tests_lqcpu_python.yml'
- pennylane_lightning/core/src/simulators/lightning_gpu/**
- pennylane_lightning/lightning_gpu/**
- pennylane_lightning/core/src/simulators/lightning_kokkos/**
Expand All @@ -33,15 +35,21 @@ concurrency:
cancel-in-progress: true

jobs:
determine_runner:
name: Determine runner type to use
uses: ./.github/workflows/determine-workflow-runner.yml
with:
default_runner: ubuntu-22.04

build_lightning_qubit_wheels:
needs: [determine_runner]
strategy:
matrix:
os: [ubuntu-22.04]
pl_backend: ["lightning_qubit"]
blas: ["OFF", "ON"]
timeout-minutes: 60
name: Python tests
runs-on: ${{ matrix.os }}
runs-on: ${{ needs.determine_runner.outputs.runner_group }}

steps:
- uses: actions/setup-python@v5
Expand Down Expand Up @@ -110,16 +118,15 @@ jobs:
${{ github.workspace }}/wheel_${{ matrix.pl_backend }}-${{ matrix.blas }}.whl
test_lightning_qubit_wheels:
needs: ["build_lightning_qubit_wheels"]
needs: [determine_runner, build_lightning_qubit_wheels]
strategy:
matrix:
os: [ubuntu-22.04]
pl_backend: ["lightning_qubit"]
blas: ["OFF", "ON"]
group: [1, 2, 3, 4]
timeout-minutes: 60
name: Python tests
runs-on: ${{ matrix.os }}
runs-on: ${{ needs.determine_runner.outputs.runner_group }}

steps:
- uses: actions/setup-python@v5
Expand Down Expand Up @@ -202,9 +209,9 @@ jobs:
if-no-files-found: error

upload-to-codecov-linux-python:
needs: [test_lightning_qubit_wheels]
needs: [determine_runner, test_lightning_qubit_wheels]
name: Upload python coverage data to codecov
runs-on: ubuntu-latest
runs-on: ${{ needs.determine_runner.outputs.runner_group }}
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/tidy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,10 @@ jobs:
tidy-cpp:
strategy:
matrix:
os: [ubuntu-22.04]
pl_backend: ["lightning_qubit"]

name: Tidy (C++)
runs-on: ${{ matrix.os }}
runs-on: ubuntu-22.04

steps:
- name: Checkout PennyLane-Lightning
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/wheel_linux_aarch64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
arch: [aarch64]
exec_model: ${{ fromJson(needs.set_wheel_build_matrix.outputs.exec_model) }}
kokkos_version: ${{ fromJson(needs.set_wheel_build_matrix.outputs.kokkos_version) }}
container_img: ["quay.io/pypa/manylinux2014_aarch64"]
container_img: ["quay.io/pypa/manylinux_2_28_aarch64"]
timeout-minutes: 45
name: Kokkos core (${{ matrix.exec_model }}::${{ matrix.arch }})
runs-on: ${{ matrix.os }}
Expand Down Expand Up @@ -91,7 +91,7 @@ jobs:
cibw_build: ${{ fromJson(needs.set_wheel_build_matrix.outputs.python_version) }}
exec_model: ${{ fromJson(needs.set_wheel_build_matrix.outputs.exec_model) }}
kokkos_version: ${{ fromJson(needs.set_wheel_build_matrix.outputs.kokkos_version) }}
container_img: ["quay.io/pypa/manylinux2014_aarch64"]
container_img: ["quay.io/pypa/manylinux_2_28_aarch64"]
timeout-minutes: 45
name: ${{ matrix.os }}::${{ matrix.arch }} - ${{ matrix.pl_backend }} (Python ${{ fromJson('{ "cp39-*":"3.9","cp310-*":"3.10","cp311-*":"3.11", "cp312-*":"3.12" }')[matrix.cibw_build] }})
runs-on: ${{ matrix.os }}
Expand Down Expand Up @@ -135,7 +135,7 @@ jobs:
CIBW_ENVIRONMENT: PL_BACKEND="${{ matrix.pl_backend }}" CMAKE_ARGS="-DENABLE_LAPACK=OFF"

CIBW_MANYLINUX_AARCH64_IMAGE: manylinux2014
CIBW_MANYLINUX_AARCH64_IMAGE: manylinux_2_28

CIBW_BUILD_VERBOSITY: 3

Expand Down
Loading

0 comments on commit 2551412

Please sign in to comment.