Skip to content

Commit 43f7a91

Browse files
authored
Fix Windows wheels (#693)
* 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'
1 parent 6efe874 commit 43f7a91

10 files changed

+49
-26
lines changed

.github/CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,14 @@
5050
* Introduce `ci:build_wheels` label, which controls wheel building on `pull_request` and other triggers.
5151
[(#648)](https://github.com/PennyLaneAI/pennylane-lightning/pull/648)
5252

53+
* Remove building wheels for Lightning Kokkos on Windows.
54+
[(#693)](https://github.com/PennyLaneAI/pennylane-lightning/pull/693)
55+
5356
### Improvements
5457

58+
* Add tests for Windows Wheels, fix ill-defined caching, and set the proper backend for LKokkos wheels.
59+
[(#693)](https://github.com/PennyLaneAI/pennylane-lightning/pull/693)
60+
5561
* Replace string comparisons by `isinstance` checks where possible.
5662
[(#691)](https://github.com/PennyLaneAI/pennylane-lightning/pull/691)
5763

.github/workflows/wheel_linux_aarch64.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -192,4 +192,4 @@ jobs:
192192
with:
193193
user: __token__
194194
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
195-
repository-url: https://test.pypi.org/legacy/
195+
repository-url: https://test.pypi.org/legacy/

.github/workflows/wheel_linux_ppc64le.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -184,4 +184,4 @@ jobs:
184184
with:
185185
user: __token__
186186
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
187-
repository-url: https://test.pypi.org/legacy/
187+
repository-url: https://test.pypi.org/legacy/

.github/workflows/wheel_linux_x86_64.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -211,4 +211,4 @@ jobs:
211211
with:
212212
user: __token__
213213
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
214-
repository-url: https://test.pypi.org/legacy/
214+
repository-url: https://test.pypi.org/legacy/

.github/workflows/wheel_linux_x86_64_cuda.yml

-1
Original file line numberDiff line numberDiff line change
@@ -143,4 +143,3 @@ jobs:
143143
user: __token__
144144
password: ${{ secrets.TEST_PYPI_LGPU_TOKEN }}
145145
repository_url: https://test.pypi.org/legacy/
146-

.github/workflows/wheel_macos_arm64.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -145,4 +145,4 @@ jobs:
145145
with:
146146
user: __token__
147147
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
148-
repository-url: https://test.pypi.org/legacy/
148+
repository-url: https://test.pypi.org/legacy/

.github/workflows/wheel_macos_x86_64.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -200,4 +200,4 @@ jobs:
200200
with:
201201
user: __token__
202202
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
203-
repository-url: https://test.pypi.org/legacy/
203+
repository-url: https://test.pypi.org/legacy/

.github/workflows/wheel_noarch.yml

-1
Original file line numberDiff line numberDiff line change
@@ -117,4 +117,3 @@ jobs:
117117
with:
118118
name: pure-source-dist-${{ matrix.pl_backend }}.tar.gz
119119
path: dist
120-

.github/workflows/wheel_win_x86_64.yml

+37-18
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939
fail-fast: false
4040
matrix:
4141
os: [windows-2022]
42-
exec_model: [\"SERIAL\"]
42+
exec_model: ["SERIAL"]
4343
kokkos_version: ${{ fromJson(needs.set_wheel_build_matrix.outputs.kokkos_version) }}
4444
timeout-minutes: 30
4545
name: Kokkos core (${{ matrix.exec_model }})
@@ -59,12 +59,6 @@ jobs:
5959
cd D:\a
6060
git clone --branch ${{ matrix.kokkos_version }} https://github.com/kokkos/kokkos.git
6161
62-
- name: Create installation directory
63-
if: steps.kokkos-cache.outputs.cache-hit != 'true'
64-
run: |
65-
Remove-Item -Path D:\a\install_dir\${{ matrix.exec_model }} -Recurse -Force -ErrorAction Ignore
66-
mkdir -p D:\a\install_dir\${{ matrix.exec_model }}
67-
6862
- name: Install dependencies
6963
if: steps.kokkos-cache.outputs.cache-hit != 'true'
7064
run: |
@@ -73,6 +67,7 @@ jobs:
7367
- name: Build Kokkos core library
7468
if: steps.kokkos-cache.outputs.cache-hit != 'true'
7569
run: |
70+
mkdir -p D:\a\install_dir\${{ matrix.exec_model }}
7671
cd D:\a\kokkos
7772
cmake -BBuild . -DCMAKE_INSTALL_PREFIX=D:\a\install_dir\${{ matrix.exec_model }} `
7873
-DKokkos_ENABLE_COMPLEX_ALIGN=OFF `
@@ -87,15 +82,15 @@ jobs:
8782
cmake --install ./Build --config RelWithDebInfo --verbose
8883
8984
win-wheels:
90-
needs: [set_wheel_build_matrix]
85+
needs: [set_wheel_build_matrix, build_dependencies]
9186
strategy:
9287
fail-fast: false
9388
matrix:
9489
os: [windows-2022]
9590
arch: [AMD64]
96-
pl_backend: ["lightning_kokkos", "lightning_qubit"]
91+
pl_backend: ["lightning_qubit"]
9792
cibw_build: ${{ fromJson(needs.set_wheel_build_matrix.outputs.python_version) }}
98-
exec_model: [\"SERIAL\"]
93+
exec_model: ["SERIAL"]
9994
kokkos_version: ${{ fromJson(needs.set_wheel_build_matrix.outputs.kokkos_version) }}
10095
timeout-minutes: 30
10196
name: ${{ matrix.os }} - ${{ matrix.pl_backend }} (Python ${{ fromJson('{ "cp39-*":"3.9","cp310-*":"3.10","cp311-*":"3.11","cp312-*":"3.12" }')[matrix.cibw_build] }})
@@ -112,11 +107,11 @@ jobs:
112107
- name: Checkout PennyLane-Lightning
113108
uses: actions/checkout@v4
114109

115-
- name: Copy cached libraries #Update when merging to pennylane-lightning
110+
- name: Copy cached libraries
116111
if: steps.kokkos-cache.outputs.cache-hit == 'true'
117112
run: |
118113
Copy-Item -Path "D:\a\install_dir\${{ matrix.exec_model }}\" `
119-
-Destination "D:\a\Lightning-Unification\Lightning-Unification\Kokkos" -Recurse -Force
114+
-Destination "D:\a\pennylane-lightning\pennylane-lightning\Kokkos" -Recurse -Force
120115
121116
- name: Install cibuildwheel
122117
run: python -m pip install cibuildwheel~=2.16.0 wheel
@@ -131,12 +126,8 @@ jobs:
131126
CIBW_BEFORE_BUILD: |
132127
python -m pip install pybind11 cmake~=3.24.0 build
133128
134-
#Temporarily commenting while solving problems to find binaries in CIBW tests.
135-
# CIBW_BEFORE_TEST: |
136-
# python -m pip install -r requirements-tests.txt
137-
138-
# CIBW_TEST_COMMAND: |
139-
# pl-device-test --device=lightning.qubit --skip-ops -x --tb=short --no-flaky-report
129+
CIBW_ENVIRONMENT: |
130+
PL_BACKEND="${{ matrix.pl_backend }}"
140131
141132
CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014
142133

@@ -164,6 +155,34 @@ jobs:
164155
}
165156
cd ..
166157
158+
- name: Determine Python version
159+
id: pyvs
160+
shell: bash
161+
run: |
162+
echo "version=$(echo ${{ matrix.cibw_build }} | tr -cd '[:digit:].' | sed 's/./&./1')" >> $GITHUB_OUTPUT
163+
164+
- uses: actions/setup-python@v5
165+
name: Install Python
166+
with:
167+
python-version: ${{ steps.pyvs.outputs.version }}
168+
169+
- name: Test wheels
170+
run: |
171+
python -m ensurepip --upgrade
172+
python -m pip install setuptools
173+
python -m pip install -r requirements-tests.txt
174+
if (${{ matrix.pl_backend == 'lightning_kokkos'}}) {
175+
SKIP_COMPILATION=True PL_BACKEND="lightning_qubit" python -m pip install -e . -vv
176+
}
177+
pushd wheelhouse
178+
$wheels = Get-ChildItem "./" -Filter *.whl
179+
foreach ($i in $wheels){
180+
python -m pip install $i.Name
181+
}
182+
popd
183+
$DEVICENAME=(echo ${{ matrix.pl_backend }} | %{$_ -replace "_","."})
184+
pl-device-test --device=$DEVICENAME --skip-ops -x --tb=short --no-flaky-report
185+
167186
- name: Validate wheels
168187
run: |
169188
python -m pip install twine

pennylane_lightning/core/_version.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@
1616
Version number (major.minor.patch[-label])
1717
"""
1818

19-
__version__ = "0.36.0-dev36"
19+
__version__ = "0.36.0-dev37"

0 commit comments

Comments
 (0)