diff --git a/.github/CHANGELOG.md b/.github/CHANGELOG.md index 2778ea71ba..301e530efd 100644 --- a/.github/CHANGELOG.md +++ b/.github/CHANGELOG.md @@ -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) diff --git a/.github/workflows/wheel_linux_aarch64.yml b/.github/workflows/wheel_linux_aarch64.yml index 84b59f0539..99859e7903 100644 --- a/.github/workflows/wheel_linux_aarch64.yml +++ b/.github/workflows/wheel_linux_aarch64.yml @@ -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/ \ No newline at end of file diff --git a/.github/workflows/wheel_linux_ppc64le.yml b/.github/workflows/wheel_linux_ppc64le.yml index 20d1a44de2..33c704867e 100644 --- a/.github/workflows/wheel_linux_ppc64le.yml +++ b/.github/workflows/wheel_linux_ppc64le.yml @@ -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/ \ No newline at end of file diff --git a/.github/workflows/wheel_linux_x86_64.yml b/.github/workflows/wheel_linux_x86_64.yml index 221ecf0806..0b42cdf085 100644 --- a/.github/workflows/wheel_linux_x86_64.yml +++ b/.github/workflows/wheel_linux_x86_64.yml @@ -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/ \ No newline at end of file diff --git a/.github/workflows/wheel_linux_x86_64_cuda.yml b/.github/workflows/wheel_linux_x86_64_cuda.yml index 98e14db4d3..422507891b 100644 --- a/.github/workflows/wheel_linux_x86_64_cuda.yml +++ b/.github/workflows/wheel_linux_x86_64_cuda.yml @@ -143,4 +143,3 @@ jobs: user: __token__ password: ${{ secrets.TEST_PYPI_LGPU_TOKEN }} repository_url: https://test.pypi.org/legacy/ - diff --git a/.github/workflows/wheel_macos_arm64.yml b/.github/workflows/wheel_macos_arm64.yml index 3314f64ddf..57f8683cb3 100644 --- a/.github/workflows/wheel_macos_arm64.yml +++ b/.github/workflows/wheel_macos_arm64.yml @@ -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/ \ No newline at end of file diff --git a/.github/workflows/wheel_macos_x86_64.yml b/.github/workflows/wheel_macos_x86_64.yml index bb097f9f30..ac8d493f55 100644 --- a/.github/workflows/wheel_macos_x86_64.yml +++ b/.github/workflows/wheel_macos_x86_64.yml @@ -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/ \ No newline at end of file diff --git a/.github/workflows/wheel_noarch.yml b/.github/workflows/wheel_noarch.yml index 871a4710f9..3d189a3931 100644 --- a/.github/workflows/wheel_noarch.yml +++ b/.github/workflows/wheel_noarch.yml @@ -117,4 +117,3 @@ jobs: with: name: pure-source-dist-${{ matrix.pl_backend }}.tar.gz path: dist - diff --git a/.github/workflows/wheel_win_x86_64.yml b/.github/workflows/wheel_win_x86_64.yml index eb4a0c1bf8..3f1e178e38 100644 --- a/.github/workflows/wheel_win_x86_64.yml +++ b/.github/workflows/wheel_win_x86_64.yml @@ -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 }}) @@ -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: | @@ -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 ` @@ -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] }}) @@ -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 @@ -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 @@ -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 diff --git a/pennylane_lightning/core/_version.py b/pennylane_lightning/core/_version.py index 2cb26ae207..3e9cf3b0e4 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.36.0-dev36" +__version__ = "0.36.0-dev37"