diff --git a/.github/CHANGELOG.md b/.github/CHANGELOG.md index a54b643089..28bef2a7b7 100644 --- a/.github/CHANGELOG.md +++ b/.github/CHANGELOG.md @@ -1,7 +1,40 @@ -# Release 0.33.1 +# Release 0.34.0-dev ### New features since last release +### Breaking changes + +### Improvements + +* Add the MPI test CI workflows of Lightning-GPU in compatibility cron jobs. + [(#536)] (https://github.com/PennyLaneAI/pennylane-lightning/pull/536) + +* Add MPI synchronization in places to safely handle communicated data. + [(#538)](https://github.com/PennyLaneAI/pennylane-lightning/pull/538) + +* Add release option in compatibility cron jobs to test the release candidates of PennyLane and the Lightning plugins against one another. + [(#531)] (https://github.com/PennyLaneAI/pennylane-lightning/pull/531) + +* Add GPU workflows in compatibility cron jobs to test Lightning-GPU and Lightning-Kokkos with the Kokkos CUDA backend. + [(#528)] (https://github.com/PennyLaneAI/pennylane-lightning/pull/528) + +### Documentation + +### Bug fixes + +* Fix MPI Python unit tests for the adjoint method. + [(#538)](https://github.com/PennyLaneAI/pennylane-lightning/pull/538) + +### Contributors + +This release contains contributions from (in alphabetical order): + +Vincent Michaud-Rioux, Shuli Shu + +-- + +# Release 0.33.1 + * pip-installed CUDA runtime libraries can now be accessed from a virtualenv. [(#543)](https://github.com/PennyLaneAI/pennylane-lightning/pull/543) @@ -25,6 +58,9 @@ Lee J. O'Riordan * Add documentation updates for the `lightning_gpu` backend. [(#525)] (https://github.com/PennyLaneAI/pennylane-lightning/pull/525) + +### New features since last release + * Add `SparseHamiltonian` support for Lightning-Qubit and Lightning-GPU. [(#526)] (https://github.com/PennyLaneAI/pennylane-lightning/pull/526) @@ -51,10 +87,10 @@ Lee J. O'Riordan ### Breaking changes -* Add `tests_gpu.yml` workflow to test the Lightning-Kokkos backend with CUDA-12. +* Add `tests_gpu.yml` workflow to test the Lightning-Kokkos backend with CUDA-12. [(#494)](https://github.com/PennyLaneAI/pennylane-lightning/pull/494) -* Implement `LM::GeneratorDoubleExcitation`, `LM::GeneratorDoubleExcitationMinus`, `LM::GeneratorDoubleExcitationPlus` kernels. Lightning-Qubit default kernels are now strictly from the `LM` implementation, which requires less memory and is faster for large state vectors. +* Implement `LM::GeneratorDoubleExcitation`, `LM::GeneratorDoubleExcitationMinus`, `LM::GeneratorDoubleExcitationPlus` kernels. L-Qubit default kernels are now strictly from the `LM` implementation, which requires less memory and is faster for large state vectors. [(#512)](https://github.com/PennyLaneAI/pennylane-lightning/pull/512) * Add workflows validating compatibility between PennyLane and Lightning's most recent stable releases and development (latest) versions. @@ -67,7 +103,7 @@ Lee J. O'Riordan * Cast integral-valued arrays to the device's complex type on entry in `_preprocess_state_vector` to ensure the state is correctly represented with floating-point numbers. [(#501)](https://github.com/PennyLaneAI/pennylane-lightning/pull/501) -* Update `DefaultQubit` to `DefaultQubitLegacy` on Lightning fallback. +* Update DefaultQubit to DefaultQubitLegacy on Lightning fallback. [(#500)](https://github.com/PennyLaneAI/pennylane-lightning/pull/500) * Enums defined in `GateOperation.hpp` start at `1` (previously `0`). `::BEGIN` is introduced in a few places where it was assumed `0` accordingly. @@ -84,16 +120,16 @@ Lee J. O'Riordan * Add support for `pip install pennylane-lightning[kokkos]` for the OpenMP backend. [(#515)](https://github.com/PennyLaneAI/pennylane-lightning/pull/515) -* Update `setup.py` to allow for multi-package co-existence. The `PennyLane_Lightning` package now is the responsible for the core functionality, and will be depended upon by all other extensions. +* Update setup.py to allow for multi-package co-existence. The PennyLane_Lightning package now is the responsible for the core functionality, and will be depended upon by all other extensions. [(#504)] (https://github.com/PennyLaneAI/pennylane-lightning/pull/504) -* Redesign Lightning-Kokkos `StateVectorKokkos` class to use Kokkos `RangePolicy` together with special functors in `applyMultiQubitOp` to apply 1- to 4-wire generic unitary gates. For more than 4 wires, the general implementation using Kokkos `TeamPolicy` is employed to yield the best all-around performance. +* Refactor LKokkos `StateVectorKokkos` class to use Kokkos `RangePolicy` together with special functors in `applyMultiQubitOp` to apply 1- to 4-wire generic unitary gates. For more than 4 wires, the general implementation using Kokkos `TeamPolicy` is employed to yield the best all-around performance. [(#490)] (https://github.com/PennyLaneAI/pennylane-lightning/pull/490) -* Redesign Lightning-Kokkos `Measurements` class to use Kokkos `RangePolicy` together with special functors to obtain the expectation value of 1- to 4-wire generic unitary gates. For more than 4 wires, the general implementation using Kokkos `TeamPolicy` is employed to yield the best all-around performance. +* Refactor LKokkos `Measurements` class to use Kokkos `RangePolicy` together with special functors to obtain the expectation value of 1- to 4-wire generic unitary gates. For more than 4 wires, the general implementation using Kokkos `TeamPolicy` is employed to yield the best all-around performance. [(#489)] (https://github.com/PennyLaneAI/pennylane-lightning/pull/489) -* Add tests to increase Lightning-Kokkos coverage. +* Add tests to increase LKokkos coverage. [(#485)](https://github.com/PennyLaneAI/pennylane-lightning/pull/485) * Add memory locality tag reporting and adjoint diff dispatch for `lightning.qubit` statevector classes. @@ -112,10 +148,10 @@ Lee J. O'Riordan * Re-add support for `pip install pennylane-lightning[gpu]`. [(#515)](https://github.com/PennyLaneAI/pennylane-lightning/pull/515) -* Switch most Lightning-Qubit default kernels to `LM`. Add `LM::multiQubitOp` tests, failing when targeting out-of-order wires clustered close to `num_qubits-1`. Fix the `LM::multiQubitOp` kernel implementation by introducing a generic `revWireParity` routine and replacing the `bitswap`-based implementation. Mimic the changes fixing the corresponding `multiQubitOp` and `expval` functors in Lightning-Kokkos. +* Switch most L-Qubit default kernels to `LM`. Add `LM::multiQubitOp` tests, failing when targeting out-of-order wires clustered close to `num_qubits-1`. Fix the `LM::multiQubitOp` kernel implementation by introducing a generic `revWireParity` routine and replacing the `bitswap`-based implementation. Mimic the changes fixing the corresponding `multiQubitOp` and `expval` functors in L-Kokkos. [(#511)](https://github.com/PennyLaneAI/pennylane-lightning/pull/511) -* Fix RTD builds by removing unsupported `system_packages` configuration option. +* Fix RTD builds by removing unsupported `sytem_packages` configuration option. [(#491)](https://github.com/PennyLaneAI/pennylane-lightning/pull/491) ### Contributors 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 new file mode 100644 index 0000000000..9c179708e9 --- /dev/null +++ b/.github/workflows/compat-check-release-release.yml @@ -0,0 +1,38 @@ +name: Compat Check w/PL - release/release + +on: + schedule: + - cron: "0 4 * * 1-5" # Run daily at 0am Mon-Fri + workflow_dispatch: + +jobs: + tests_linux: + name: Lightning Compatibility test (tests_linux) - release/release + uses: ./.github/workflows/tests_linux.yml + with: + lightning-version: release + pennylane-version: release + tests_lkokkos_gpu: + name: Lightning Compatibility test (tests_lkokkos_gpu) - release/release + uses: ./.github/workflows/tests_gpu_kokkos.yml + with: + lightning-version: release + pennylane-version: release + tests_lgpu_gpu: + name: Lightning Compatibility test (tests_lgpu_gpu) - release/release + uses: ./.github/workflows/tests_gpu_cu11.yml + 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 + with: + lightning-version: release + pennylane-version: release 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/tests_gpu_cu11.yml b/.github/workflows/tests_gpu_cu11.yml index ad7f9bae06..d85a2d37c6 100644 --- a/.github/workflows/tests_gpu_cu11.yml +++ b/.github/workflows/tests_gpu_cu11.yml @@ -9,11 +9,11 @@ on: 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) + description: The version of Lightning to use. Valid values are either 'release' (most recent release candidate), '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) + 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) env: CI_CUDA_ARCH: 86 @@ -51,7 +51,7 @@ jobs: nvidia-smi cpptestswithLGPU_cu11: - if: ${{ github.event_name != 'workflow_call' }} + if: ${{ !contains(fromJSON('["workflow_call"]'), github.event_name) }} needs: [builddeps] strategy: matrix: @@ -182,14 +182,19 @@ jobs: fetch-tags: true path: main + - name: Switch to release build of Lightning + if: inputs.lightning-version == 'release' + run: | + cd main + 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: | 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 @@ -232,6 +237,21 @@ jobs: python -m pip install -r requirements-dev.txt python -m pip install cmake custatevec-cu11 openfermionpyscf + - 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: Install Stable PennyLane if: inputs.pennylane-version == 'stable' run: | diff --git a/.github/workflows/tests_gpu_kokkos.yml b/.github/workflows/tests_gpu_kokkos.yml index 2879be1c8b..7648dc4333 100644 --- a/.github/workflows/tests_gpu_kokkos.yml +++ b/.github/workflows/tests_gpu_kokkos.yml @@ -5,11 +5,11 @@ on: 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) + description: The version of Lightning to use. Valid values are either 'release' (most recent release candidate), '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) + 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: push: branches: @@ -236,6 +236,13 @@ jobs: path: main fetch-tags: true + - name: Switch to release build of Lightning + if: inputs.lightning-version == 'release' + run: | + cd main + 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: | @@ -259,6 +266,21 @@ jobs: python -m pip install -r requirements-dev.txt python -m pip install openfermionpyscf + - 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: Install Stable PennyLane if: inputs.pennylane-version == 'stable' run: | diff --git a/.github/workflows/tests_linux.yml b/.github/workflows/tests_linux.yml index b5df17d2ea..aea4ecd144 100644 --- a/.github/workflows/tests_linux.yml +++ b/.github/workflows/tests_linux.yml @@ -5,11 +5,11 @@ on: 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) + description: The version of Lightning to use. Valid values are either 'release' (most recent release candidate), '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) + 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: push: branches: @@ -28,7 +28,7 @@ concurrency: jobs: cpptests: - if: ${{ github.event_name != 'workflow_call' }} + if: ${{ !contains(fromJSON('["workflow_call"]'), github.event_name) }} strategy: matrix: os: [ubuntu-22.04] @@ -97,6 +97,13 @@ jobs: fetch-tags: true path: main + - name: Switch to release build of Lightning + if: inputs.lightning-version == 'release' + run: | + cd main + 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: | @@ -120,6 +127,21 @@ jobs: python -m pip install -r requirements-dev.txt python -m pip install openfermionpyscf + - 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: Install Stable PennyLane if: inputs.pennylane-version == 'stable' run: | @@ -154,7 +176,7 @@ jobs: path: ./main/coverage-${{ github.job }}-${{ matrix.pl_backend }}.xml cpptestswithOpenBLAS: - if: ${{ github.event_name != 'workflow_call' }} + if: ${{ !contains(fromJSON('["workflow_call"]'), github.event_name) }} strategy: matrix: os: [ubuntu-22.04] @@ -224,6 +246,13 @@ jobs: fetch-tags: true path: main + - name: Switch to release build of Lightning + if: inputs.lightning-version == 'release' + run: | + cd main + 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: | @@ -247,6 +276,21 @@ jobs: python -m pip install -r requirements-dev.txt python -m pip install openfermionpyscf + - 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: Install Stable PennyLane if: inputs.pennylane-version == 'stable' run: | @@ -280,14 +324,14 @@ jobs: name: ubuntu-codecov-results-python path: ./main/coverage-${{ github.job }}-${{ matrix.pl_backend }}.xml - build_and_cache_Kokkos: + build_and_cache_Kokkos: name: "Build and cache Kokkos" uses: ./.github/workflows/build_and_cache_Kokkos_linux.yml with: os: ubuntu-22.04 cpptestswithKokkos: - if: ${{ github.event_name != 'workflow_call' }} + if: ${{ !contains(fromJSON('["workflow_call"]'), github.event_name) }} needs: [build_and_cache_Kokkos] strategy: matrix: @@ -380,6 +424,13 @@ jobs: fetch-tags: true path: main + - name: Switch to release build of Lightning + if: inputs.lightning-version == 'release' + run: | + cd main + 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: | @@ -418,6 +469,21 @@ jobs: python -m pip install -r requirements-dev.txt python -m pip install openfermionpyscf + - 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: Install Stable PennyLane if: inputs.pennylane-version == 'stable' run: | @@ -516,7 +582,7 @@ jobs: cpptestsWithMultipleBackends: # Device-specific tests are performed for both. Device-agnostic tests default to LightningQubit. - if: ${{ github.event_name != 'workflow_call' }} + if: ${{ !contains(fromJSON('["workflow_call"]'), github.event_name) }} needs: [build_and_cache_Kokkos] strategy: matrix: diff --git a/.github/workflows/tests_linux_x86_mpi_gpu.yml b/.github/workflows/tests_linux_x86_mpi_gpu.yml index 03a01f24c0..1842dc3005 100644 --- a/.github/workflows/tests_linux_x86_mpi_gpu.yml +++ b/.github/workflows/tests_linux_x86_mpi_gpu.yml @@ -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('["workflow_call"]'), github.event_name) }} runs-on: - self-hosted - linux @@ -158,7 +158,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') || contains(fromJSON('["workflow_call"]'), github.event_name) }} runs-on: - self-hosted - linux @@ -177,12 +177,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 @@ -225,9 +232,24 @@ jobs: run: | source /etc/profile.d/modules.sh && module use /opt/modules/ && module load ${{ matrix.mpilib }} python -m pip install -r requirements-dev.txt - python -m pip install cmake custatevec-cu11 mpi4py openfermionpyscf + python -m pip install 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')") @@ -245,7 +267,6 @@ jobs: coverage run --rcfile=.coveragerc --source=pennylane_lightning -p -m mpi4py -m pytest ./mpitests --tb=native coverage combine coverage xml -o coverage-${{ github.job }}-lightning_gpu_${{ matrix.mpilib }}-main.xml - # PL_DEVICE=lightning.gpu /opt/mpi/${{ matrix.mpilib }}/bin/mpirun --oversubscribe -n 4 pytest -s -x mpitests/test_device.py -k test_create_device $COVERAGE_FLAGS - name: Upload code coverage results uses: actions/upload-artifact@v3 diff --git a/.github/workflows/tests_without_binary.yml b/.github/workflows/tests_without_binary.yml index bb21da4cfb..680b2b75c3 100644 --- a/.github/workflows/tests_without_binary.yml +++ b/.github/workflows/tests_without_binary.yml @@ -5,11 +5,11 @@ on: 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) + description: The version of Lightning to use. Valid values are either 'release' (most recent release candidate), '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) + 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: push: branches: @@ -40,6 +40,13 @@ jobs: fetch-tags: true path: main + - name: Switch to release build of Lightning + if: inputs.lightning-version == 'release' + run: | + cd main + 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: | @@ -56,9 +63,25 @@ jobs: - name: Get required Python packages run: | + rm -fr $(python -m pip cache dir)/selfcheck/ cd main python -m pip install -r requirements-dev.txt + - 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: Install Stable PennyLane if: inputs.pennylane-version == 'stable' run: | diff --git a/.github/workflows/wheel_linux_aarch64.yml b/.github/workflows/wheel_linux_aarch64.yml index bd9159b571..949d9140f5 100644 --- a/.github/workflows/wheel_linux_aarch64.yml +++ b/.github/workflows/wheel_linux_aarch64.yml @@ -142,7 +142,7 @@ jobs: CIBW_TEST_REQUIRES: pytest pytest-cov pytest-mock flaky CIBW_BEFORE_TEST: | - python -m pip install git+https://github.com/PennyLaneAI/pennylane.git@v0.33.0 + python -m pip install pytest-benchmark git+https://github.com/PennyLaneAI/pennylane.git@master if ${{ matrix.pl_backend == 'lightning_kokkos'}}; then SKIP_COMPILATION=True PL_BACKEND="lightning_qubit" pip install -e . -vv; fi CIBW_TEST_COMMAND: | @@ -188,4 +188,4 @@ jobs: with: user: __token__ password: ${{ secrets.TEST_PYPI_API_TOKEN }} - repository-url: https://test.pypi.org/legacy/ \ No newline at end of file + repository-url: https://test.pypi.org/legacy/ diff --git a/.github/workflows/wheel_linux_x86_64.yml b/.github/workflows/wheel_linux_x86_64.yml index cd3b37f87d..4fcba6ab8d 100644 --- a/.github/workflows/wheel_linux_x86_64.yml +++ b/.github/workflows/wheel_linux_x86_64.yml @@ -153,7 +153,7 @@ jobs: CIBW_TEST_REQUIRES: pytest pytest-cov pytest-mock flaky CIBW_BEFORE_TEST: | - python -m pip install git+https://github.com/PennyLaneAI/pennylane.git@v0.33.0 + python -m pip install pytest-benchmark git+https://github.com/PennyLaneAI/pennylane.git@master if ${{ matrix.pl_backend == 'lightning_kokkos'}}; then SKIP_COMPILATION=True PL_BACKEND="lightning_qubit" pip install -e . -vv; fi CIBW_TEST_COMMAND: | @@ -203,4 +203,4 @@ jobs: with: user: __token__ password: ${{ secrets.TEST_PYPI_API_TOKEN }} - repository-url: https://test.pypi.org/legacy/ \ No newline at end of file + repository-url: https://test.pypi.org/legacy/ diff --git a/.github/workflows/wheel_macos_arm64.yml b/.github/workflows/wheel_macos_arm64.yml index bc768ac9d2..4cd24b6ce6 100644 --- a/.github/workflows/wheel_macos_arm64.yml +++ b/.github/workflows/wheel_macos_arm64.yml @@ -93,7 +93,7 @@ jobs: CIBW_TEST_REQUIRES: pytest pytest-cov pytest-mock flaky CIBW_BEFORE_TEST: | - python -m pip install git+https://github.com/PennyLaneAI/pennylane.git@v0.33.0 + python -m pip install pytest-benchmark git+https://github.com/PennyLaneAI/pennylane.git@master if ${{ matrix.pl_backend == 'lightning_kokkos'}}; then SKIP_COMPILATION=True PL_BACKEND="lightning_qubit" pip install -e . -vv; fi CIBW_TEST_COMMAND: | @@ -138,4 +138,4 @@ jobs: with: user: __token__ password: ${{ secrets.TEST_PYPI_API_TOKEN }} - repository-url: https://test.pypi.org/legacy/ \ No newline at end of file + repository-url: https://test.pypi.org/legacy/ diff --git a/.github/workflows/wheel_macos_x86_64.yml b/.github/workflows/wheel_macos_x86_64.yml index d58a022c16..d68d321211 100644 --- a/.github/workflows/wheel_macos_x86_64.yml +++ b/.github/workflows/wheel_macos_x86_64.yml @@ -141,7 +141,7 @@ jobs: CIBW_TEST_REQUIRES: pytest pytest-cov pytest-mock flaky CIBW_BEFORE_TEST: | - python -m pip install git+https://github.com/PennyLaneAI/pennylane.git@v0.33.0 + python -m pip install pytest-benchmark git+https://github.com/PennyLaneAI/pennylane.git@master if ${{ matrix.pl_backend == 'lightning_kokkos'}}; then SKIP_COMPILATION=True PL_BACKEND="lightning_qubit" pip install -e . -vv; fi CIBW_TEST_COMMAND: | @@ -192,4 +192,4 @@ jobs: with: user: __token__ password: ${{ secrets.TEST_PYPI_API_TOKEN }} - repository-url: https://test.pypi.org/legacy/ \ No newline at end of file + repository-url: https://test.pypi.org/legacy/ diff --git a/.github/workflows/wheel_win_x86_64.yml b/.github/workflows/wheel_win_x86_64.yml index 28d0dbdc31..3369a1f07a 100644 --- a/.github/workflows/wheel_win_x86_64.yml +++ b/.github/workflows/wheel_win_x86_64.yml @@ -130,7 +130,7 @@ jobs: CIBW_TEST_REQUIRES: pytest pytest-cov pytest-mock flaky CIBW_BEFORE_TEST: | - python -m pip install git+https://github.com/PennyLaneAI/pennylane.git@v0.33.0 + python -m pip install pytest-benchmark git+https://github.com/PennyLaneAI/pennylane.git@master CIBW_TEST_COMMAND: | pl-device-test --device=lightning.qubit --skip-ops -x --tb=short --no-flaky-report @@ -198,4 +198,4 @@ jobs: with: user: __token__ password: ${{ secrets.TEST_PYPI_API_TOKEN }} - repository-url: https://test.pypi.org/legacy/ \ No newline at end of file + repository-url: https://test.pypi.org/legacy/ diff --git a/doc/lightning_gpu/device.rst b/doc/lightning_gpu/device.rst index 49ad3acf37..02eb1dcd4e 100644 --- a/doc/lightning_gpu/device.rst +++ b/doc/lightning_gpu/device.rst @@ -1,5 +1,5 @@ Lightning GPU device -====================== +==================== The ``lightning.gpu`` device is an extension of PennyLane's built-in ``lightning.qubit`` device. It extends the CPU-focused Lightning simulator to run using the NVIDIA cuQuantum SDK, enabling GPU-accelerated simulation of quantum state-vector evolution. @@ -281,4 +281,4 @@ To enable the memory-optimized adjoint method with MPI support, ``batch_obs`` sh dev = qml.device('lightning.gpu', wires= n_wires, mpi=True, batch_obs=True) -For the adjoint method, each MPI process will provide the overall simulation results. \ No newline at end of file +For the adjoint method, each MPI process will provide the overall simulation results. diff --git a/doc/lightning_gpu/package.rst b/doc/lightning_gpu/package.rst index 6630d64cd8..713efc6daf 100644 --- a/doc/lightning_gpu/package.rst +++ b/doc/lightning_gpu/package.rst @@ -1,19 +1,19 @@ -lightning_gpu -================ - -.. automodapi:: pennylane_lightning.lightning_gpu - :no-heading: - :include-all-objects: - -.. raw:: html - -
- - -Directly importing the device class: -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -.. code-block:: python3 - - from pennylane_lightning.lightning_gpu import LightningGPU - +lightning_gpu +============= + +.. automodapi:: pennylane_lightning.lightning_gpu + :no-heading: + :include-all-objects: + +.. raw:: html + + + + +Directly importing the device class: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +.. code-block:: python3 + + from pennylane_lightning.lightning_gpu import LightningGPU + diff --git a/pennylane_lightning/core/_version.py b/pennylane_lightning/core/_version.py index 4d9d88ae81..34b114ce22 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.1" +__version__ = "0.34.0-dev3" diff --git a/requirements-dev.txt b/requirements-dev.txt index f9ca2c9b20..7582deeebb 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,5 +1,5 @@ pip==23.0 -git+https://github.com/PennyLaneAI/pennylane.git@v0.33.0 +git+https://github.com/PennyLaneAI/pennylane.git@master ninja flaky pybind11 @@ -10,5 +10,6 @@ pytest-mock pre-commit>=2.19.0 black==23.7.0 clang-format==14 +cmake custatevec-cu11 pylint diff --git a/tests/test_adjoint_jacobian.py b/tests/test_adjoint_jacobian.py index 51e41d61db..d754bd4743 100644 --- a/tests/test_adjoint_jacobian.py +++ b/tests/test_adjoint_jacobian.py @@ -186,7 +186,7 @@ def test_pauli_rotation_gradient(self, stateprep, G, theta, dev): ) tape = qml.tape.QuantumScript( - [G(theta, 0)], [qml.expval(qml.PauliZ(0))], [stateprep(random_state, 0)] + [stateprep(random_state, 0), G(theta, 0)], [qml.expval(qml.PauliZ(0))] ) tape.trainable_params = {1}