Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add v0.33 rc changes #538

Merged
merged 46 commits into from
Oct 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
cb0c4f7
Create v0.33.0 RC branch.
vincentmr Oct 25, 2023
624e77d
Update changelog [skip ci]
vincentmr Oct 25, 2023
ac87a2d
Update pennylane_requires [skip ci]
vincentmr Oct 25, 2023
c3beebe
Change master => v0.33.0-rc0 in wheels and fix gpu ci files (removing…
vincentmr Oct 25, 2023
633a182
Trigger multiple GPU CI
multiphaseCFD Oct 25, 2023
8bc5fcb
add sync in Hamiltonian obs
multiphaseCFD Oct 26, 2023
b613211
add sync to MPILinearAlg
multiphaseCFD Oct 26, 2023
2b19560
add sync for adjoint tests
multiphaseCFD Oct 26, 2023
e046c2d
sync for gate ops in MPI backend
multiphaseCFD Oct 26, 2023
6ad6ced
add more sync
multiphaseCFD Oct 26, 2023
e4c6afd
add more sync before upData
multiphaseCFD Oct 26, 2023
82851da
add more syncs
multiphaseCFD Oct 26, 2023
bde0102
update adj unit tests
multiphaseCFD Oct 26, 2023
0b3d0d7
Merge branch 'master' into v0.33.0_rc
multiphaseCFD Oct 26, 2023
9ca8941
Add LGPU docs (#525)
multiphaseCFD Oct 26, 2023
f1f57d6
Download wheels.
vincentmr Oct 27, 2023
71dc256
Add pytest-bench dep in requirements-dev.txt
vincentmr Oct 27, 2023
46510bd
Fix RST formatting in README
vincentmr Oct 27, 2023
ff9bc6f
Fix matrix in GPU wheels.
vincentmr Oct 27, 2023
ab4ef59
Build linux aarch ppc
vincentmr Oct 27, 2023
5ece477
Add sdist in noarch wheels.
vincentmr Oct 27, 2023
a1d5bfb
Fix backend name in wheel_linux_x86_64_cu11.yml
vincentmr Oct 27, 2023
28b9848
Do not upload sdist.
vincentmr Oct 27, 2023
e0eaac1
quick fix py unit tests for adj mpi
multiphaseCFD Oct 27, 2023
37d5c18
Uncomment mpi tests trigger
vincentmr Oct 27, 2023
cd31e76
Add block-list for auditwheel builds with L-GPU (#534)
mlxd Oct 27, 2023
42fdbad
Update .github/CHANGELOG.md [skip ci]
vincentmr Oct 27, 2023
91a689c
Update .github/CHANGELOG.md [skip ci]
vincentmr Oct 27, 2023
5eba3e3
Remove custatevec from req [skip ci]
vincentmr Oct 27, 2023
079ce2d
remove unneccessary barrier in cpp backend
multiphaseCFD Oct 27, 2023
5130937
turn on H2_Ham tests for LK&LQ
multiphaseCFD Oct 27, 2023
9cb0b4f
Fix changelog and link in README. [skip ci]
vincentmr Oct 27, 2023
fb2e2d5
Use long lightning titles. [skip ci]
vincentmr Oct 27, 2023
d9a2db5
Remove broken links [skip ci].
vincentmr Oct 27, 2023
4fa6724
Remove stray div end
mlxd Oct 27, 2023
cde2d19
Revert wheel files triggers.
vincentmr Oct 27, 2023
4d9a5d5
test (#535)
vincentmr Oct 30, 2023
93d5306
Merge branch 'master' into add_v0.33_rc_changes
multiphaseCFD Oct 30, 2023
1ba42f9
Merge branch 'master' into v0.33.0_rc
multiphaseCFD Oct 30, 2023
72c81d2
Merge branch 'v0.33.0_rc' into add_v0.33_rc_changes
multiphaseCFD Oct 30, 2023
bf7bf14
udpate changelog
multiphaseCFD Oct 30, 2023
1a3ad2e
Trigger MGPU CI
multiphaseCFD Oct 30, 2023
7353ed0
Merge branch 'master' into add_v0.33_rc_changes
multiphaseCFD Oct 30, 2023
4898a0a
Auto update version
github-actions[bot] Oct 30, 2023
3581d52
update typo
multiphaseCFD Oct 30, 2023
e306559
update changelog and mpi_gpu.yml
multiphaseCFD Oct 31, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ omit =
tests/*
mpitests/*

[coverage:run]
parallel = true

[report]
# Regexes for lines to exclude from consideration
exclude_lines =
Expand Down
38 changes: 24 additions & 14 deletions .github/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@

### Improvements

* 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)

Expand All @@ -16,18 +19,22 @@

### 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

---
Vincent Michaud-Rioux, Shuli Shu

# Release 0.33.0

### New features since last release

* Add documentation updates for the `lightning.gpu` backend.
[(#525)] (https://github.com/PennyLaneAI/pennylane-lightning/pull/525)

* Add `SparseHamiltonian` support for Lightning-Qubit and Lightning-GPU.
[(#526)] (https://github.com/PennyLaneAI/pennylane-lightning/pull/526)

Expand All @@ -40,7 +47,7 @@ Vincent Michaud-Rioux
* Integrate the distributed C++ backend of Lightning-GPU into the Lightning monorepo.
[(#514)] (https://github.com/PennyLaneAI/pennylane-lightning/pull/514)

* Integrate Lightning-GPU into the Lightning monorepo. The new backend is named `lightning_gpu` and includes all single-GPU features.
* Integrate Lightning-GPU into the Lightning monorepo. The new backend is named `lightning.gpu` and includes all single-GPU features.
[(#499)] (https://github.com/PennyLaneAI/pennylane-lightning/pull/499)

* Build Linux wheels for Lightning-GPU (CUDA-11).
Expand All @@ -54,10 +61,10 @@ Vincent Michaud-Rioux

### 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. L-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. Lightning-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.
Expand All @@ -70,7 +77,7 @@ Vincent Michaud-Rioux
* 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.
Expand All @@ -87,16 +94,16 @@ Vincent Michaud-Rioux
* 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)

* 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.
* 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.
[(#490)] (https://github.com/PennyLaneAI/pennylane-lightning/pull/490)

* 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.
* 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.
[(#489)] (https://github.com/PennyLaneAI/pennylane-lightning/pull/489)

* Add tests to increase LKokkos coverage.
* Add tests to increase Lightning-Kokkos coverage.
[(#485)](https://github.com/PennyLaneAI/pennylane-lightning/pull/485)

* Add memory locality tag reporting and adjoint diff dispatch for `lightning.qubit` statevector classes.
Expand All @@ -112,13 +119,16 @@ Vincent Michaud-Rioux

### Bug fixes

* Fix CI issues running python-cov with MPI.
[(#535)](https://github.com/PennyLaneAI/pennylane-lightning/pull/535)

* Re-add support for `pip install pennylane-lightning[gpu]`.
[(#515)](https://github.com/PennyLaneAI/pennylane-lightning/pull/515)

* 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.
* 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.
[(#511)](https://github.com/PennyLaneAI/pennylane-lightning/pull/511)

* Fix RTD builds by removing unsupported `sytem_packages` configuration option.
* Fix RTD builds by removing unsupported `system_packages` configuration option.
[(#491)](https://github.com/PennyLaneAI/pennylane-lightning/pull/491)

### Contributors
Expand All @@ -133,7 +143,7 @@ Ali Asadi, Amintor Dusko, Vincent Michaud-Rioux, Lee J. O'Riordan, Shuli Shu

### New features since last release

* The `lightning_kokkos` backend supports Nvidia GPU execution (with Kokkos v4 and CUDA v12).
* The `lightning.kokkos` backend supports Nvidia GPU execution (with Kokkos v4 and CUDA v12).
[(#477)](https://github.com/PennyLaneAI/pennylane-lightning/pull/477)

* Complete overhaul of repository structure to facilitates integration of multiple backends. Refactoring efforts we directed to improve development performance, code reuse and decrease overall overhead to propagate changes through backends. New C++ modular build strategy allows for faster test builds restricted to a module. Update CI/CD actions concurrency strategy. Change minimal Python version to 3.9.
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/tests_gpu_cu11.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ jobs:
uses: actions/checkout@v3
with:
path: main
fetch-depth: 2

- uses: actions/setup-python@v4
name: Install Python
Expand Down
25 changes: 11 additions & 14 deletions .github/workflows/tests_linux_x86_mpi_gpu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,13 +91,15 @@ jobs:

- name: Install required packages
run: |
python -m pip install ninja cmake custatevec-cu11
python -m pip install -r requirements-dev.txt
python -m pip install cmake custatevec-cu11

- name: Validate GPU version and installed compiler
run: |
source /etc/profile.d/modules.sh && module use /opt/modules && module load cuda/11.8
which -a nvcc
nvcc --version

- name: Validate Multi-GPU packages
run: |
source /etc/profile.d/modules.sh && module use /opt/modules/ && module load ${{ matrix.mpilib }}
Expand All @@ -107,9 +109,6 @@ jobs:
which -a mpicxx
mpicxx --version
module unload ${{ matrix.mpilib }}
- 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: |
Expand Down Expand Up @@ -222,16 +221,11 @@ 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 custatevec-cu11 mpi4py openfermionpyscf
SKIP_COMPILATION=True PL_BACKEND=lightning_qubit python -m pip install -e . -vv

- name: Build and install package
Expand All @@ -242,12 +236,15 @@ jobs:
CMAKE_ARGS="-DCMAKE_C_COMPILER=mpicc -DCMAKE_CXX_COMPILER=mpicxx -DENABLE_MPI=ON -DCMAKE_CUDA_COMPILER=/usr/local/cuda/bin/nvcc -DCMAKE_CUDA_ARCHITECTURES=${{ env.CI_CUDA_ARCH }} -DPython_EXECUTABLE=${{ steps.python_path.outputs.python }}" \
PL_BACKEND=lightning_gpu python -m pip install -e . --verbose

# There are issues running py-cov with MPI. A solution is to use coverage as reported
# [here](https://github.com/pytest-dev/pytest-cov/issues/237#issuecomment-544824228)
- name: Run unit tests for MPI-enabled lightning.gpu device
run: |
source /etc/profile.d/modules.sh && module use /opt/modules/ && module load ${{ matrix.mpilib }}
PL_DEVICE=lightning.gpu /opt/mpi/${{ matrix.mpilib }}/bin/mpirun -np 2 python -m pytest ./mpitests $COVERAGE_FLAGS
mv coverage.xml 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
PL_DEVICE=lightning.gpu /opt/mpi/${{ matrix.mpilib }}/bin/mpirun -np 2 \
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

- name: Upload code coverage results
uses: actions/upload-artifact@v3
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/wheel_linux_x86_64_cu11.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ jobs:
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda/lib64:$CUQUANTUM_SDK \
PL_BACKEND="${{ matrix.pl_backend }}"

CIBW_REPAIR_WHEEL_COMMAND_LINUX: "auditwheel repair -w {dest_dir} {wheel}"
CIBW_REPAIR_WHEEL_COMMAND_LINUX: "./bin/auditwheel repair -w {dest_dir} {wheel}"

CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014

Expand All @@ -114,6 +114,10 @@ jobs:

upload-pypi:
needs: linux-wheels-x86-64
strategy:
matrix:
arch: [x86_64]
pl_backend: ["lightning_gpu"]
runs-on: ubuntu-latest
if: ${{ github.event_name == 'release' || github.ref == 'refs/heads/master'}}
steps:
Expand Down
37 changes: 31 additions & 6 deletions .github/workflows/wheel_noarch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
pl_backend: ["lightning_kokkos", "lightning_qubit"]
pl_backend: ["lightning_gpu", "lightning_kokkos", "lightning_qubit"]
timeout-minutes: 30
name: ${{ matrix.os }} - Pure Python wheels - ${{ matrix.pl_backend }} (Python 3.9)
runs-on: ${{ matrix.os }}
Expand All @@ -46,41 +46,66 @@ jobs:
python -m pip install --upgrade cmake ninja

- name: Build wheels
if: ${{ matrix.pl_backend == 'lightning_qubit'}}
run: |
python -m pip install --upgrade pip wheel
cd main
python setup.py bdist_wheel
PL_BACKEND="${{ matrix.pl_backend }}" python setup.py bdist_wheel
env:
SKIP_COMPILATION: True

- name: Validate wheels
if: ${{ matrix.pl_backend == 'lightning_qubit'}}
run: |
python -m pip install twine
python -m twine check main/dist/*.whl

- uses: actions/upload-artifact@v3
if: ${{ github.event_name == 'release' || github.ref == 'refs/heads/master' }}
if: ${{ matrix.pl_backend == 'lightning_qubit' && (github.event_name == 'release' || github.ref == 'refs/heads/master') }}
with:
name: pure-python-wheels-${{ matrix.pl_backend }}.zip
path: main/dist/*.whl

- name: Build source dist
if: ${{ matrix.pl_backend != 'lightning_qubit'}}
run: |
python -m pip install --upgrade pip wheel
cd main
PL_BACKEND="${{ matrix.pl_backend }}" python setup.py sdist
env:
SKIP_COMPILATION: True

- uses: actions/upload-artifact@v3
if: ${{ matrix.pl_backend != 'lightning_qubit' && (github.event_name == 'release' || github.ref == 'refs/heads/master') }}
with:
name: pure-source-dist-${{ matrix.pl_backend }}.tar.gz
path: main/dist/*.tar.gz

upload-pypi:
needs: build-pure-python-wheel
strategy:
matrix:
pl_backend: ["lightning_qubit"]
pl_backend: ["lightning_gpu", "lightning_kokkos", "lightning_qubit"]
runs-on: ubuntu-latest

if: ${{ github.event_name == 'release' }}
steps:
- uses: actions/download-artifact@v3
if: ${{ matrix.pl_backend == 'lightning_qubit' && github.event_name == 'release' }}
with:
name: pure-python-wheels-${{ matrix.pl_backend }}.zip
path: dist

- name: Upload wheels to PyPI
if: ${{ matrix.pl_backend == 'lightning_qubit' && github.event_name == 'release' }}
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository-url: https://test.pypi.org/legacy/
repository-url: https://test.pypi.org/legacy/

- uses: actions/download-artifact@v3
if: ${{ matrix.pl_backend != 'lightning_qubit' && github.event_name == 'release' }}
with:
name: pure-source-dist-${{ matrix.pl_backend }}.tar.gz
path: dist

5 changes: 4 additions & 1 deletion .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,11 @@ build:
- libopenblas-base
- libopenblas-dev
- graphviz
- nvidia-cuda-toolkit
jobs:
pre_install:
- echo "setuptools~=66.0\npip~=22.0" >> ci_build_requirements.txt
post_install:
- PL_BACKEND="lightning_kokkos" pip install -e . -vv
- rm -rf ./build && PL_BACKEND="lightning_kokkos" python setup.py bdist_wheel
- rm -rf ./build && PL_BACKEND="lightning_gpu" python setup.py build_ext --define="PL_DISABLE_CUDA_SAFETY=1" && PL_BACKEND="lightning_gpu" python setup.py bdist_wheel
- python -m pip install ./dist/*.whl
Loading