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

Update Lightning packaging to follow the PEP 517/518/621/660 standards #832

Merged
merged 82 commits into from
Aug 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
82 commits
Select commit Hold shift + click to select a range
cfb7cdb
ignore wheelhouse
AmintorDusko Aug 1, 2024
b436b28
create a toml file and integrate with setup.py
AmintorDusko Aug 1, 2024
37956ed
update CMake build system to extract version from pyproject.toml
AmintorDusko Aug 1, 2024
dc3981f
update backends to get version from toml file; update copyright
AmintorDusko Aug 1, 2024
4762c11
update MANIFEST file
AmintorDusko Aug 1, 2024
e1d6fdb
Auto update version from '0.38.0-dev20' to '0.38.0-dev22'
ringo-but-quantum Aug 1, 2024
d985845
Merge branch 'master' into update/Lightning_packaging
AmintorDusko Aug 1, 2024
a48d1cf
remove pip version pin
AmintorDusko Aug 1, 2024
e1e4575
update tests without binary workflow
AmintorDusko Aug 1, 2024
92aa3de
update version
AmintorDusko Aug 1, 2024
20c358b
remove pip installation
AmintorDusko Aug 1, 2024
4e9cbed
move backend support logic to its own script
AmintorDusko Aug 7, 2024
257d76b
format script
AmintorDusko Aug 7, 2024
cfa9e8c
add script to configure dynamic variables
AmintorDusko Aug 7, 2024
27eb849
add src files to Manifest.in
AmintorDusko Aug 7, 2024
e1e83e7
Update Makefile; Include make wheel option; Expand format option scope;
AmintorDusko Aug 7, 2024
b9b00db
configure pyproject.toml for Lightning Qubit package
AmintorDusko Aug 7, 2024
2f5f2f9
reduce setup.py's scope
AmintorDusko Aug 7, 2024
654f745
test wheels for Linux x86_64
AmintorDusko Aug 8, 2024
cc57d3a
Auto update version from '0.38.0-dev22' to '0.38.0-dev27'
ringo-but-quantum Aug 8, 2024
cd8c928
Merge branch 'master' into update/Lightning_packaging
AmintorDusko Aug 8, 2024
c2deae0
update Python call
AmintorDusko Aug 8, 2024
521c246
add requirement
AmintorDusko Aug 8, 2024
a2b1490
update env var
AmintorDusko Aug 8, 2024
5652ba3
recover old version storage method
AmintorDusko Aug 8, 2024
16ed3df
make version dynamic
AmintorDusko Aug 8, 2024
094f637
update configuration scrupt for dynamic version
AmintorDusko Aug 8, 2024
251e472
update setup.py for dynamic version
AmintorDusko Aug 8, 2024
f1b16ca
fix wrong delete
AmintorDusko Aug 8, 2024
573ea37
update wheels workflows
AmintorDusko Aug 8, 2024
998b919
update wheels dependencies
AmintorDusko Aug 8, 2024
021d1a7
fix wheel noarch
AmintorDusko Aug 9, 2024
ef12b63
update scripts
AmintorDusko Aug 9, 2024
0f6706a
add pyproject.toml file encoding
AmintorDusko Aug 9, 2024
d861fa4
update checkout action
AmintorDusko Aug 9, 2024
011b185
update cache action
AmintorDusko Aug 9, 2024
7e4c2a2
update no arch wheels
AmintorDusko Aug 9, 2024
6b68d0f
remove main
AmintorDusko Aug 9, 2024
c0765f5
update wheel no arch workflow
AmintorDusko Aug 9, 2024
da9830a
update lightning tensor tests
AmintorDusko Aug 9, 2024
39333f6
update more workflows
AmintorDusko Aug 9, 2024
3c2cf9d
update lkcpu python tests
AmintorDusko Aug 9, 2024
2d78d25
update requirements-dev
AmintorDusko Aug 9, 2024
3b5b845
add one more configure for completeness
AmintorDusko Aug 9, 2024
bc2599b
update gcc version query
AmintorDusko Aug 9, 2024
fa78c26
update test workflow files
AmintorDusko Aug 9, 2024
ccdcea5
update test workflow files
AmintorDusko Aug 9, 2024
673d9cb
fix typo
AmintorDusko Aug 9, 2024
56f34d3
set permissions
AmintorDusko Aug 9, 2024
0a27f01
add missing python
AmintorDusko Aug 9, 2024
1a8960f
fix package name
AmintorDusko Aug 9, 2024
1b4a388
add version file to MANIFEST
AmintorDusko Aug 9, 2024
16c8e44
remove some flags
AmintorDusko Aug 9, 2024
452be87
update readthedocs
AmintorDusko Aug 9, 2024
77fad64
update README file
AmintorDusko Aug 9, 2024
6eae02c
update Dockerfile
AmintorDusko Aug 9, 2024
38b2a0c
update changelog
AmintorDusko Aug 9, 2024
aba1f11
Merge branch 'master' into update/Lightning_packaging
AmintorDusko Aug 12, 2024
6f2703d
update version
AmintorDusko Aug 12, 2024
87f9892
ignore pyproject.toml
AmintorDusko Aug 12, 2024
eb98303
untrack pyproject.toml
AmintorDusko Aug 12, 2024
72d625f
undo untracking
AmintorDusko Aug 12, 2024
e7deb82
configure pyproject for LQ
AmintorDusko Aug 12, 2024
814ff16
Update README.rst
AmintorDusko Aug 12, 2024
d4daa3f
Update .github/workflows/format.yml
AmintorDusko Aug 12, 2024
5acd540
Update pyproject.toml
AmintorDusko Aug 12, 2024
8bc57ac
update doc
AmintorDusko Aug 12, 2024
fa8fcdd
Merge branch 'update/Lightning_packaging' of https://github.com/Penny…
AmintorDusko Aug 12, 2024
e4df823
Update scripts/configure_pyproject_toml.py
AmintorDusko Aug 12, 2024
e326be4
Update scripts/configure_pyproject_toml.py
AmintorDusko Aug 12, 2024
0841cb1
format
AmintorDusko Aug 12, 2024
2451517
selectively update build requirements list
AmintorDusko Aug 12, 2024
61e2195
update README file
AmintorDusko Aug 12, 2024
f9497f2
trigger CIs
AmintorDusko Aug 12, 2024
d9da93f
Merge branch 'master' into update/Lightning_packaging
AmintorDusko Aug 12, 2024
31a46e8
Auto update version from '0.38.0-dev29' to '0.38.0-dev30'
ringo-but-quantum Aug 12, 2024
38ba608
trigger CIs
AmintorDusko Aug 12, 2024
7c7543e
Merge branch 'update/Lightning_packaging' of https://github.com/Penny…
AmintorDusko Aug 12, 2024
533ba85
remove dependence installation for no arch wheels
AmintorDusko Aug 12, 2024
20a89d7
update dependencies again
AmintorDusko Aug 12, 2024
f58e354
trigger CIs
AmintorDusko Aug 12, 2024
337ed82
trigger CIs
AmintorDusko Aug 12, 2024
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
5 changes: 4 additions & 1 deletion .github/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
### New features since last release

* Add `var` support to `lightning.tensor`. Note that `var` support is added via `obs**2` and this implementation scales `O(num_obs**2)`.
[(#804)](https://github.com/PennyLaneAI/pennylane-lightning/pull/804)
[(#804)](https://github.com/PennyLaneAI/pennylane-lightning/pull/804)

### Breaking changes

Expand All @@ -16,6 +16,9 @@
* Do not run GPU tests and Docker workflows on release.
[(#788)](https://github.com/PennyLaneAI/pennylane-lightning/pull/788)

* Update python packaging to follow PEP 517/518/621/660 standards.
[(#832)](https://github.com/PennyLaneAI/pennylane-lightning/pull/832)

### Improvements

* `ENABLE_LAPACK` is off by default for all Lightning backends.
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
uses: actions/checkout@v4

- name: Install dependencies
run: sudo apt update && sudo apt -y install python3 python3-pip && python -m pip install pip~=22.0 && python3 -m pip install -r requirements-dev.txt
run: sudo apt update && sudo apt -y install python3 python3-pip python-is-python3 && python -m pip install -r requirements-dev.txt

- name: Run formatter
run: PATH=$PATH:/home/ubuntu/.local/bin/:$(dirname $(which python3))/ ./bin/format --check ./pennylane_lightning/core/src
11 changes: 5 additions & 6 deletions .github/workflows/tests_lgpu_python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ jobs:
strategy:
matrix:
pl_backend: ["lightning_gpu"]
default_backend: ["lightning_qubit"]
cuda_version: ["12"]

name: Python Tests (${{ matrix.pl_backend }}, cuda-${{ matrix.cuda_version }})
Expand Down Expand Up @@ -129,8 +128,7 @@ jobs:
echo "venv_name=${{ env.VENV_NAME }}" >> $GITHUB_OUTPUT
echo "Python_ROOT_DIR=${{ env.VENV_NAME }}" >> $GITHUB_ENV
echo "Python3_ROOT_DIR=${{ env.VENV_NAME }}" >> $GITHUB_ENV



# Adding venv site-packages to output for subsequent step to referecen if needed
echo "site_packages_dir=$(${{ env.VENV_NAME }}/bin/python -c 'import sysconfig; print(sysconfig.get_path("platlib"))')" >> $GITHUB_OUTPUT

Expand Down Expand Up @@ -179,12 +177,13 @@ jobs:
run: |
cd main
rm -rf build
CMAKE_ARGS="-DPL_BACKEND=${{ matrix.default_backend }} -DENABLE_PYTHON=ON -DCMAKE_CXX_COMPILER=$(which g++-$GCC_VERSION)" \
PL_BACKEND=lightning_qubit python scripts/configure_pyproject_toml.py
CMAKE_ARGS="-DENABLE_PYTHON=ON -DCMAKE_CXX_COMPILER=$(which g++-$GCC_VERSION)" \
python -m pip install . -vv
rm -rf build

rm -rf build
CMAKE_ARGS="-DPL_BACKEND=${{ matrix.pl_backend }} -DENABLE_PYTHON=ON -DCMAKE_CXX_COMPILER=$(which g++-$GCC_VERSION) -DPython_EXECUTABLE=${{ steps.python_path.outputs.python }}" \
PL_BACKEND=${{ matrix.pl_backend }} python scripts/configure_pyproject_toml.py
CMAKE_ARGS="-DENABLE_PYTHON=ON -DCMAKE_CXX_COMPILER=$(which g++-$GCC_VERSION) -DPython_EXECUTABLE=${{ steps.python_path.outputs.python }}" \
python -m pip install . -vv

- name: Run PennyLane-Lightning-GPU unit tests
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/tests_lgpumpi_python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,8 @@ jobs:
python -m pip install -r requirements-dev.txt

python -m pip install custatevec-cu${{ matrix.cuda_version_maj }} mpi4py openfermionpyscf
PL_BACKEND=lightning_qubit python -m pip install . -vv
PL_BACKEND=lightning_qubit python scripts/configure_pyproject_toml.py
python -m pip install . -vv

- name: Checkout PennyLane for release build
if: inputs.pennylane-version == 'release'
Expand All @@ -132,8 +133,9 @@ jobs:
CUQUANTUM_SDK: $(python -c "import site; print( f'{site.getsitepackages()[0]}/cuquantum')")
run: |
source /etc/profile.d/modules.sh && module use /opt/modules/ && module load ${{ matrix.mpilib }}/cuda-${{ matrix.cuda_version_maj }}.${{ matrix.cuda_version_min }}
PL_BACKEND=lightning_gpu python scripts/configure_pyproject_toml.py
CMAKE_ARGS="-DCMAKE_C_COMPILER=mpicc -DCMAKE_CXX_COMPILER=mpicxx -DENABLE_MPI=ON -DCMAKE_CUDA_COMPILER=$(which nvcc) -DCMAKE_CUDA_ARCHITECTURES=${{ env.CI_CUDA_ARCH }} -DPython_EXECUTABLE=${{ steps.python_path.outputs.python }}" \
PL_BACKEND=lightning_gpu python -m pip install . --verbose
python -m pip install . -vv

# 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)
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/tests_lkcpu_python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -117,13 +117,14 @@ jobs:
cd main
python -m pip install -r requirements-dev.txt

- name: Create device wheel
- name: Configure and build device wheel
env:
PL_BACKEND: ${{ matrix.pl_backend }}
run: |
cd main
python setup.py build_ext -i --define="PL_BACKEND=${{ matrix.pl_backend }};CMAKE_PREFIX_PATH=${{ github.workspace }}/Kokkos;ENABLE_PYTHON=ON;CMAKE_CXX_COMPILER=$(which g++-$GCC_VERSION)"
python setup.py bdist_wheel
python scripts/configure_pyproject_toml.py
CMAKE_ARGS="-DCMAKE_PREFIX_PATH=${{ github.workspace }}/Kokkos -DENABLE_PYTHON=ON -DCMAKE_CXX_COMPILER=$(which g++-$GCC_VERSION)" \
python -m build
cd dist
WHEEL_NAME=$(ls *.whl)
cp $WHEEL_NAME ${{ github.workspace }}/wheel_${{ matrix.pl_backend }}-${{ matrix.exec_model }}.whl
Expand Down Expand Up @@ -211,6 +212,7 @@ jobs:
python -m pip install -r requirements-dev.txt
python -m pip install openfermionpyscf
if [ '${{ inputs.lightning-version }}' != 'stable' ]; then
python scripts/configure_pyproject_toml.py
SKIP_COMPILATION=True python -m pip install . -vv
fi
python -m pip install ${{ github.workspace }}/$WHEEL_NAME --no-deps
Expand Down
17 changes: 12 additions & 5 deletions .github/workflows/tests_lkcuda_python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -241,8 +241,12 @@ jobs:
run: |
ls -l ${{ github.workspace }}/Kokkos
cd main
SKIP_COMPILATION=True PL_BACKEND="lightning_qubit" python -m pip install . -vv
CMAKE_ARGS="-DPL_BACKEND=${{ matrix.pl_backend }} -DCMAKE_PREFIX_PATH=${{ github.workspace }}/Kokkos -DENABLE_PYTHON=ON -DCMAKE_CXX_COMPILER=$(which g++-$GCC_VERSION)" \

PL_BACKEND=lightning_qubit python scripts/configure_pyproject_toml.py
SKIP_COMPILATION=True python -m pip install . -vv

PL_BACKEND=${{ matrix.pl_backend }} python scripts/configure_pyproject_toml.py
CMAKE_ARGS="-DCMAKE_PREFIX_PATH=${{ github.workspace }}/Kokkos -DENABLE_PYTHON=ON -DCMAKE_CXX_COMPILER=$(which g++-$GCC_VERSION)" \
python -m pip install . -vv

- name: Run PennyLane-Lightning unit tests
Expand All @@ -262,10 +266,13 @@ jobs:
if: ${{ matrix.pl_backend == 'all' }}
run: |
cd main
CMAKE_ARGS="-DPL_BACKEND="lightning_qubit" -DCMAKE_PREFIX_PATH=${{ github.workspace }}/Kokkos -DENABLE_PYTHON=ON -DCMAKE_CXX_COMPILER=$(which g++-$GCC_VERSION)" \

PL_BACKEND=lightning_qubit python scripts/configure_pyproject_toml.py
CMAKE_ARGS="-DENABLE_PYTHON=ON -DCMAKE_CXX_COMPILER=$(which g++-$GCC_VERSION)" \
python -m pip install . -vv
rm -rf build
CMAKE_ARGS="-DPL_BACKEND="lightning_kokkos" -DCMAKE_PREFIX_PATH=${{ github.workspace }}/Kokkos -DENABLE_PYTHON=ON -DCMAKE_CXX_COMPILER=$(which g++-$GCC_VERSION)" \

PL_BACKEND="lightning_kokkos" python scripts/configure_pyproject_toml.py
CMAKE_ARGS="-DCMAKE_PREFIX_PATH=${{ github.workspace }}/Kokkos -DENABLE_PYTHON=ON -DCMAKE_CXX_COMPILER=$(which g++-$GCC_VERSION)" \
python -m pip install . -vv

- name: Run PennyLane-Lightning unit tests for lightning.qubit with all devices installed
Expand Down
38 changes: 15 additions & 23 deletions .github/workflows/tests_lmps_tncuda_python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,20 +60,19 @@ jobs:
echo "LD_LIBRARY_PATH=${LD_LIBRARY_PATH}" >> $GITHUB_ENV
nvcc --version
nvidia-smi

pythontestswithMPSTNCuda:
if: ${{ !contains(fromJSON('["schedule", "workflow_dispatch"]'), github.event_name) }}
needs: [builddeps]
strategy:
matrix:
os: [ubuntu-22.04]
pl_backend: ["lightning_tensor"]
default_backend: ["lightning_qubit"]
pl_tensor_method: ["mps"]
pl_tensor_backend: ["cutensornet"]
cuda_version: ["12"]

name: Python Tests (${{ matrix.pl_backend }}, method-${{ matrix.pl_tensor_method }}, backend-${{ matrix.pl_tensor_backend }}, cuda-${{ matrix.cuda_version }})
name: Python Tests (${{ matrix.pl_backend }}, method-${{ matrix.pl_tensor_method }}, backend-${{ matrix.pl_tensor_backend }}, cuda-${{ matrix.cuda_version }})
runs-on:
- ${{ matrix.os }}
- self-hosted
Expand All @@ -92,14 +91,12 @@ jobs:

- name: Checkout PennyLane-Lightning-Tensor-MPS-TNCuda
uses: actions/checkout@v4
with:
path: main

- uses: actions/setup-python@v5
name: Install Python
with:
python-version: '3.9'

# Since the self-hosted runner can be re-used. It is best to set up all package
# installations in a virtual environment that gets cleaned at the end of each workflow run
- name: Setup Python virtual environment
Expand All @@ -116,13 +113,13 @@ jobs:

# Add the venv to PATH for subsequent steps
echo ${{ env.VENV_NAME }}/bin >> $GITHUB_PATH

# Adding venv name as an output for subsequent steps to reference if needed
source ${{ env.VENV_NAME }}/bin/activate
echo "venv_name=${{ env.VENV_NAME }}" >> $GITHUB_OUTPUT
echo "Python_ROOT_DIR=${{ env.VENV_NAME }}" >> $GITHUB_ENV
echo "Python3_ROOT_DIR=${{ env.VENV_NAME }}" >> $GITHUB_ENV

# Adding venv site-packages to output for subsequent step to referecen if needed
echo "site_packages_dir=$(${{ env.VENV_NAME }}/bin/python -c 'import sysconfig; print(sysconfig.get_path("platlib"))')" >> $GITHUB_OUTPUT

Expand All @@ -139,7 +136,6 @@ jobs:

- name: Install required packages
run: |
cd main
python -m pip install -r requirements-dev.txt
python -m pip install ninja cmake scipy custatevec-cu${{ matrix.cuda_version }} cutensornet-cu${{ matrix.cuda_version }} openfermionpyscf

Expand All @@ -157,29 +153,25 @@ jobs:
git fetch --all
git checkout $(git branch -a --list "origin/v0.*rc*" | sort | 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: |
cd main
python -m pip uninstall -y pennylane && python -m pip install -U pennylane
- name: Build and install package

- name: Configure and install required backends
run: |
cd main
rm -rf build
CMAKE_ARGS="-DPL_BACKEND=${{ matrix.default_backend }} -DCMAKE_CXX_COMPILER=$(which g++-$GCC_VERSION)" \
python -m pip install . -vv
rm -rf build

PL_BACKEND=lightning_qubit python scripts/configure_pyproject_toml.py
CMAKE_ARGS="-DCMAKE_CXX_COMPILER=$(which g++-$GCC_VERSION)" python -m pip install . -vv

rm -rf build
CMAKE_ARGS="-DPL_BACKEND=${{ matrix.pl_backend }} -DCMAKE_CXX_COMPILER=$(which g++-$GCC_VERSION)" \
python -m pip install . -vv
PL_BACKEND="${{ matrix.pl_backend }}" python scripts/configure_pyproject_toml.py
CMAKE_ARGS="-DCMAKE_CXX_COMPILER=$(which g++-$GCC_VERSION)" python -m pip install . -vv

- name: Run PennyLane-Lightning-Tensor unit tests
if: ${{ matrix.pl_backend != 'all'}}
run: |
cd main/
DEVICENAME=`echo ${{ matrix.pl_backend }} | sed "s/_/./g"`
PL_DEVICE=${DEVICENAME} python -m pytest tests $COVERAGE_FLAGS
mv coverage.xml coverage-${{ github.job }}-${{ matrix.pl_backend }}.xml
Expand All @@ -188,7 +180,7 @@ jobs:
uses: actions/upload-artifact@v3
with:
name: ubuntu-codecov-results-python
path: ./main/coverage-${{ github.job }}-${{ matrix.pl_backend }}.xml
path: coverage-${{ github.job }}-${{ matrix.pl_backend }}.xml
if-no-files-found: error


Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/tests_lqcpu_python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,9 @@ jobs:
id: create_lq_wheel
run: |
cd main
python setup.py build_ext -i --define="PL_BACKEND=${{ matrix.pl_backend }};ENABLE_BLAS=${{ matrix.blas }};LQ_ENABLE_KERNEL_OMP=ON;ENABLE_PYTHON=ON;CMAKE_CXX_COMPILER=$(which g++-$GCC_VERSION)"
PL_BACKEND=${{ matrix.pl_backend }} python setup.py bdist_wheel
PL_BACKEND=${{ matrix.pl_backend }} python scripts/configure_pyproject_toml.py
CMAKE_ARGS="-DENABLE_BLAS=${{ matrix.blas }} -DLQ_ENABLE_KERNEL_OMP=ON -DENABLE_PYTHON=ON -DCMAKE_CXX_COMPILER=$(which g++-$GCC_VERSION)" \
python -m build
cd dist
WHEEL_NAME=$(ls *.whl)
cp $WHEEL_NAME ${{ github.workspace }}/wheel_${{ matrix.pl_backend }}-${{ matrix.blas }}.whl
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests_windows_cpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ jobs:
python-version: '3.9'

- name: Checkout PennyLane-Lightning
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Install dependencies
run: |
Expand Down
29 changes: 10 additions & 19 deletions .github/workflows/tests_without_binary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,19 +46,16 @@ jobs:
uses: actions/checkout@v4
with:
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/v0.*rc*" | sort | tail -1)

- name: Switch to stable build of Lightning
if: inputs.lightning-version == 'stable'
run: |
cd main
git fetch --tags --force
git checkout latest_release
git log -1 --format='%H'
Expand All @@ -72,7 +69,6 @@ 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
Expand All @@ -93,39 +89,34 @@ jobs:
- 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 the pennylane_lightning package
if: ${{ contains(fromJson('["lightning_kokkos", "lightning_gpu", "lightning_tensor"]'), matrix.pl_backend) }}
- name: Install the pennylane_lightning core package (lightning_qubit)
env:
SKIP_COMPILATION: True
PL_BACKEND: "lightning_qubit"
run: |
cd main
SKIP_COMPILATION=True PL_BACKEND="lightning_qubit" python -m pip install . -vv
python scripts/configure_pyproject_toml.py
python -m pip install . -vv

- name: Install backend device
# FIXME: Remove this condition with v0.37.0 release
if: matrix.pl_backend != 'lightning_tensor' || inputs.lightning-version != 'stable'
- name: Install extra backend device
if: matrix.pl_backend != 'lightning_qubit'
env:
SKIP_COMPILATION: True
PL_BACKEND: ${{ matrix.pl_backend }}
run: |
cd main
python scripts/configure_pyproject_toml.py
python -m pip install . -vv

- name: Run PennyLane-Lightning unit tests for all backends
# FIXME: Remove this condition with v0.37.0 release
if: matrix.pl_backend != 'lightning_tensor' || inputs.lightning-version != 'stable'
run: |
cd main/
DEVICENAME=`echo ${{ matrix.pl_backend }} | sed "s/_/./g"`
PL_DEVICE=${DEVICENAME} python -m pytest tests/ $COVERAGE_FLAGS

- name: Upload coverage to Codecov
# FIXME: Remove this condition with v0.37.0 release
if: matrix.pl_backend != 'lightning_tensor' || inputs.lightning-version != 'stable'
uses: codecov/codecov-action@v4
with:
files: ./main/coverage.xml
files: coverage.xml
fail_ci_if_error: true
verbose: true
token: ${{ secrets.CODECOV_TOKEN }}
15 changes: 11 additions & 4 deletions .github/workflows/wheel_linux_aarch64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,11 @@ jobs:
mkdir Kokkos
cp -rf ${{ github.workspace }}/Kokkos_install/${{ matrix.exec_model }}/* Kokkos/

- name: Install cibuildwheel
run: python -m pip install cibuildwheel~=2.16.0
- name: Install dependencies
run: python -m pip install cibuildwheel~=2.16.0 toml

- name: Configure pyproject.toml file
run: PL_BACKEND="${{ matrix.pl_backend }}" python scripts/configure_pyproject_toml.py

- uses: docker/setup-qemu-action@v2
name: Set up QEMU
Expand All @@ -138,15 +141,19 @@ jobs:
cat /etc/yum.conf | sed "s/\[main\]/\[main\]\ntimeout=5/g" > /etc/yum.conf
python -m pip install ninja cmake~=3.24.0

CIBW_ENVIRONMENT: PL_BACKEND="${{ matrix.pl_backend }}" CMAKE_ARGS="-DENABLE_LAPACK=OFF"
CIBW_ENVIRONMENT: CMAKE_ARGS="-DENABLE_LAPACK=OFF"

CIBW_MANYLINUX_AARCH64_IMAGE: manylinux_2_28

CIBW_BUILD_VERBOSITY: 3

CIBW_BEFORE_TEST: |
python -m pip install -r requirements-tests.txt
if ${{ matrix.pl_backend == 'lightning_kokkos'}}; then SKIP_COMPILATION=True PL_BACKEND="lightning_qubit" python -m pip install . -vv; fi
if ${{ matrix.pl_backend == 'lightning_kokkos'}}
then
PL_BACKEND="lightning_qubit" python scripts/configure_pyproject_toml.py
SKIP_COMPILATION=True python -m pip install . -vv
fi

CIBW_TEST_COMMAND: |
DEVICENAME=`echo ${{ matrix.pl_backend }} | sed "s/_/./g"`
Expand Down
Loading
Loading