Skip to content

Commit

Permalink
Fix Windows wheels (#693)
Browse files Browse the repository at this point in the history
* move tests after patching wheels

* Auto update version from '0.36.0-dev33' to '0.36.0-dev34'

* Trigger CIs

* Auto update version from '0.36.0-dev34' to '0.36.0-dev35'

* fix Kokkos caching and job dependencies

* fix backend wheel

* Set proper git version

* change pip 22 delivery

* ensure pip and setuptools

* fix pip call

* test updated pip

* remove building lightning_kokkos wheels

* remove build LKokkos wheels for Win. This time right.

* Fix LK tests

* Revert wheel_win trigger

* Auto update version from '0.36.0-dev35' to '0.36.0-dev36'

* Fix SKIP_COMPILATION=True

* Fix parantheses.

* Install LQ with python

* Revert to Amintor's minus merge from master.

* update changelog

* Auto update version from '0.36.0-dev35' to '0.36.0-dev36'

* Apply suggestions from code review

* trigger CIs

* fix crazy merge

* Auto update version from '0.36.0-dev36' to '0.36.0-dev37'
  • Loading branch information
AmintorDusko authored Apr 24, 2024
1 parent 6efe874 commit 43f7a91
Show file tree
Hide file tree
Showing 10 changed files with 49 additions and 26 deletions.
6 changes: 6 additions & 0 deletions .github/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,14 @@
* Introduce `ci:build_wheels` label, which controls wheel building on `pull_request` and other triggers.
[(#648)](https://github.com/PennyLaneAI/pennylane-lightning/pull/648)

* Remove building wheels for Lightning Kokkos on Windows.
[(#693)](https://github.com/PennyLaneAI/pennylane-lightning/pull/693)

### Improvements

* Add tests for Windows Wheels, fix ill-defined caching, and set the proper backend for LKokkos wheels.
[(#693)](https://github.com/PennyLaneAI/pennylane-lightning/pull/693)

* Replace string comparisons by `isinstance` checks where possible.
[(#691)](https://github.com/PennyLaneAI/pennylane-lightning/pull/691)

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/wheel_linux_aarch64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -192,4 +192,4 @@ jobs:
with:
user: __token__
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository-url: https://test.pypi.org/legacy/
repository-url: https://test.pypi.org/legacy/
2 changes: 1 addition & 1 deletion .github/workflows/wheel_linux_ppc64le.yml
Original file line number Diff line number Diff line change
Expand Up @@ -184,4 +184,4 @@ jobs:
with:
user: __token__
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository-url: https://test.pypi.org/legacy/
repository-url: https://test.pypi.org/legacy/
2 changes: 1 addition & 1 deletion .github/workflows/wheel_linux_x86_64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -211,4 +211,4 @@ jobs:
with:
user: __token__
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository-url: https://test.pypi.org/legacy/
repository-url: https://test.pypi.org/legacy/
1 change: 0 additions & 1 deletion .github/workflows/wheel_linux_x86_64_cuda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -143,4 +143,3 @@ jobs:
user: __token__
password: ${{ secrets.TEST_PYPI_LGPU_TOKEN }}
repository_url: https://test.pypi.org/legacy/

2 changes: 1 addition & 1 deletion .github/workflows/wheel_macos_arm64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -145,4 +145,4 @@ jobs:
with:
user: __token__
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository-url: https://test.pypi.org/legacy/
repository-url: https://test.pypi.org/legacy/
2 changes: 1 addition & 1 deletion .github/workflows/wheel_macos_x86_64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -200,4 +200,4 @@ jobs:
with:
user: __token__
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository-url: https://test.pypi.org/legacy/
repository-url: https://test.pypi.org/legacy/
1 change: 0 additions & 1 deletion .github/workflows/wheel_noarch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -117,4 +117,3 @@ jobs:
with:
name: pure-source-dist-${{ matrix.pl_backend }}.tar.gz
path: dist

55 changes: 37 additions & 18 deletions .github/workflows/wheel_win_x86_64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
fail-fast: false
matrix:
os: [windows-2022]
exec_model: [\"SERIAL\"]
exec_model: ["SERIAL"]
kokkos_version: ${{ fromJson(needs.set_wheel_build_matrix.outputs.kokkos_version) }}
timeout-minutes: 30
name: Kokkos core (${{ matrix.exec_model }})
Expand All @@ -59,12 +59,6 @@ jobs:
cd D:\a
git clone --branch ${{ matrix.kokkos_version }} https://github.com/kokkos/kokkos.git
- name: Create installation directory
if: steps.kokkos-cache.outputs.cache-hit != 'true'
run: |
Remove-Item -Path D:\a\install_dir\${{ matrix.exec_model }} -Recurse -Force -ErrorAction Ignore
mkdir -p D:\a\install_dir\${{ matrix.exec_model }}
- name: Install dependencies
if: steps.kokkos-cache.outputs.cache-hit != 'true'
run: |
Expand All @@ -73,6 +67,7 @@ jobs:
- name: Build Kokkos core library
if: steps.kokkos-cache.outputs.cache-hit != 'true'
run: |
mkdir -p D:\a\install_dir\${{ matrix.exec_model }}
cd D:\a\kokkos
cmake -BBuild . -DCMAKE_INSTALL_PREFIX=D:\a\install_dir\${{ matrix.exec_model }} `
-DKokkos_ENABLE_COMPLEX_ALIGN=OFF `
Expand All @@ -87,15 +82,15 @@ jobs:
cmake --install ./Build --config RelWithDebInfo --verbose
win-wheels:
needs: [set_wheel_build_matrix]
needs: [set_wheel_build_matrix, build_dependencies]
strategy:
fail-fast: false
matrix:
os: [windows-2022]
arch: [AMD64]
pl_backend: ["lightning_kokkos", "lightning_qubit"]
pl_backend: ["lightning_qubit"]
cibw_build: ${{ fromJson(needs.set_wheel_build_matrix.outputs.python_version) }}
exec_model: [\"SERIAL\"]
exec_model: ["SERIAL"]
kokkos_version: ${{ fromJson(needs.set_wheel_build_matrix.outputs.kokkos_version) }}
timeout-minutes: 30
name: ${{ matrix.os }} - ${{ matrix.pl_backend }} (Python ${{ fromJson('{ "cp39-*":"3.9","cp310-*":"3.10","cp311-*":"3.11","cp312-*":"3.12" }')[matrix.cibw_build] }})
Expand All @@ -112,11 +107,11 @@ jobs:
- name: Checkout PennyLane-Lightning
uses: actions/checkout@v4

- name: Copy cached libraries #Update when merging to pennylane-lightning
- name: Copy cached libraries
if: steps.kokkos-cache.outputs.cache-hit == 'true'
run: |
Copy-Item -Path "D:\a\install_dir\${{ matrix.exec_model }}\" `
-Destination "D:\a\Lightning-Unification\Lightning-Unification\Kokkos" -Recurse -Force
-Destination "D:\a\pennylane-lightning\pennylane-lightning\Kokkos" -Recurse -Force
- name: Install cibuildwheel
run: python -m pip install cibuildwheel~=2.16.0 wheel
Expand All @@ -131,12 +126,8 @@ jobs:
CIBW_BEFORE_BUILD: |
python -m pip install pybind11 cmake~=3.24.0 build
#Temporarily commenting while solving problems to find binaries in CIBW tests.
# CIBW_BEFORE_TEST: |
# python -m pip install -r requirements-tests.txt

# CIBW_TEST_COMMAND: |
# pl-device-test --device=lightning.qubit --skip-ops -x --tb=short --no-flaky-report
CIBW_ENVIRONMENT: |
PL_BACKEND="${{ matrix.pl_backend }}"
CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014

Expand Down Expand Up @@ -164,6 +155,34 @@ jobs:
}
cd ..
- name: Determine Python version
id: pyvs
shell: bash
run: |
echo "version=$(echo ${{ matrix.cibw_build }} | tr -cd '[:digit:].' | sed 's/./&./1')" >> $GITHUB_OUTPUT
- uses: actions/setup-python@v5
name: Install Python
with:
python-version: ${{ steps.pyvs.outputs.version }}

- name: Test wheels
run: |
python -m ensurepip --upgrade
python -m pip install setuptools
python -m pip install -r requirements-tests.txt
if (${{ matrix.pl_backend == 'lightning_kokkos'}}) {
SKIP_COMPILATION=True PL_BACKEND="lightning_qubit" python -m pip install -e . -vv
}
pushd wheelhouse
$wheels = Get-ChildItem "./" -Filter *.whl
foreach ($i in $wheels){
python -m pip install $i.Name
}
popd
$DEVICENAME=(echo ${{ matrix.pl_backend }} | %{$_ -replace "_","."})
pl-device-test --device=$DEVICENAME --skip-ops -x --tb=short --no-flaky-report
- name: Validate wheels
run: |
python -m pip install twine
Expand Down
2 changes: 1 addition & 1 deletion pennylane_lightning/core/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@
Version number (major.minor.patch[-label])
"""

__version__ = "0.36.0-dev36"
__version__ = "0.36.0-dev37"

0 comments on commit 43f7a91

Please sign in to comment.