From 5f70b06e286447afb6703ce98df05d379108e83f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luis=20Alfredo=20Nu=C3=B1ez=20Meneses?= Date: Mon, 28 Oct 2024 11:02:21 -0600 Subject: [PATCH] Fix PTM stable latest related to the default.qubit.legacy (#966) ### Before submitting Please complete the following checklist when submitting a PR: - [ ] All new features must include a unit test. If you've fixed a bug or added code that should be tested, add a test to the [`tests`](../tests) directory! - [ ] All new functions and code must be clearly commented and documented. If you do make documentation changes, make sure that the docs build and render correctly by running `make docs`. - [ ] Ensure that the test suite passes, by running `make test`. - [X] Add a new entry to the `.github/CHANGELOG.md` file, summarizing the change, and including a link back to the PR. - [ ] Ensure that code is properly formatted by running `make format`. When all the above are checked, delete everything above the dashed line and fill in the pull request template. ------------------------------------------------------------------------------------------------------------ **Context:** The CIs on the PTM fail due to incompatibilities between deprecated devices. **Description of the Change:** The PTM has an unexpected behaviour for Stable Lightnin - Latest PennyLane because on CIs still using the device default.qubit.legacy. The solution is patching tests following deprecation which will be removed after v0.39. **Benefits:** No more errors in the PTM stable-latest regarding the `default.qubit.legacy` **Possible Drawbacks:** **Related GitHub Issues:** [sc-76902] --------- Co-authored-by: ringo-but-quantum --- .github/CHANGELOG.md | 3 +++ .github/workflows/tests_lgpumpi_python.yml | 7 +++++++ .github/workflows/tests_lkcpu_python.yml | 6 ++++++ .github/workflows/tests_lkcuda_python.yml | 8 ++++++++ pennylane_lightning/core/_version.py | 2 +- 5 files changed, 25 insertions(+), 1 deletion(-) diff --git a/.github/CHANGELOG.md b/.github/CHANGELOG.md index 60bb1c67e2..b863e65705 100644 --- a/.github/CHANGELOG.md +++ b/.github/CHANGELOG.md @@ -131,6 +131,9 @@ ### Bug fixes +* Fix PTM stable latest related to `default.qubit.legacy`. + [(#966)](https://github.com/PennyLaneAI/pennylane-lightning/pull/966) + * Fix build failure for Lightning-Kokkos editable installation on MacOS due to `liblightning_kokkos_catalyst.so` copy. [(#947)](https://github.com/PennyLaneAI/pennylane-lightning/pull/947) diff --git a/.github/workflows/tests_lgpumpi_python.yml b/.github/workflows/tests_lgpumpi_python.yml index fa195d397e..a91daad10f 100644 --- a/.github/workflows/tests_lgpumpi_python.yml +++ b/.github/workflows/tests_lgpumpi_python.yml @@ -142,6 +142,13 @@ jobs: 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: Patching tests following deprecation FIXME(remove after v0.39) + if: inputs.lightning-version == 'stable' && inputs.pennylane-version == 'latest' + run: | + pushd mpitests + grep -rl "default.qubit.legacy" . | xargs sed -i "s|default.qubit.legacy|default.qubit|g"; + popd + - name: Build and install package env: CUQUANTUM_SDK: $(python -c "import site; print( f'{site.getsitepackages()[0]}/cuquantum')") diff --git a/.github/workflows/tests_lkcpu_python.yml b/.github/workflows/tests_lkcpu_python.yml index b211ac527d..6b55a9e734 100644 --- a/.github/workflows/tests_lkcpu_python.yml +++ b/.github/workflows/tests_lkcpu_python.yml @@ -191,6 +191,12 @@ jobs: git log -1 --format='%H' git status + - name: Patching tests following deprecation FIXME(remove after v0.39) + if: inputs.lightning-version == 'stable' && inputs.pennylane-version == 'latest' + run: | + pushd tests + grep -rl "default.qubit.legacy" . | xargs sed -i "s|default.qubit.legacy|default.qubit|g"; + popd - uses: actions/download-artifact@v4 with: diff --git a/.github/workflows/tests_lkcuda_python.yml b/.github/workflows/tests_lkcuda_python.yml index a018cc1453..f9cbdcd12a 100644 --- a/.github/workflows/tests_lkcuda_python.yml +++ b/.github/workflows/tests_lkcuda_python.yml @@ -260,6 +260,14 @@ jobs: PL_BACKEND=${{ matrix.pl_backend }} CMAKE_ARGS="-DCMAKE_PREFIX_PATH=${{ github.workspace }}/Kokkos" \ python -m pip install . -vv + - name: Patching tests following deprecation FIXME(remove after v0.39) + if: inputs.lightning-version == 'stable' && inputs.pennylane-version == 'latest' + run: | + cd main/ + pushd tests + grep -rl "default.qubit.legacy" . | xargs sed -i "s|default.qubit.legacy|default.qubit|g"; + popd + - name: Run PennyLane-Lightning unit tests if: ${{ matrix.pl_backend != 'all'}} env: diff --git a/pennylane_lightning/core/_version.py b/pennylane_lightning/core/_version.py index a9b42bc9f7..e1f82227d5 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.39.0-dev50" +__version__ = "0.39.0-dev51"