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

Fix/stable latest #1046

Merged
merged 26 commits into from
Jan 23, 2025
Merged
Show file tree
Hide file tree
Changes from 19 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
925270b
update version
AmintorDusko Jan 22, 2025
2342d3a
add temporary fix for LGPU PennyLane-Lightning tests
AmintorDusko Jan 22, 2025
0e761e4
add temporary fix for LKokkos(CPU) PennyLane-Lightning tests
AmintorDusko Jan 22, 2025
5063005
add temporary fix for LKokkos(CUDA) PennyLane-Lightning tests
AmintorDusko Jan 22, 2025
e9a411b
add temporary fix for LQUBIT PennyLane-Lightning tests
AmintorDusko Jan 22, 2025
cf197d2
update test shots in Makefile
AmintorDusko Jan 22, 2025
ee489ee
undo test skips, and proceed with patching the tests
AmintorDusko Jan 22, 2025
9de9aff
update changelog
AmintorDusko Jan 22, 2025
643ab67
remove skip left
AmintorDusko Jan 22, 2025
52d0cb8
Update .github/workflows/tests_gpu_python.yml
AmintorDusko Jan 22, 2025
d378604
Update .github/CHANGELOG.md
AmintorDusko Jan 22, 2025
ae1de87
Update .github/workflows/tests_gpu_python.yml
AmintorDusko Jan 22, 2025
737b433
Update .github/workflows/tests_gpu_python.yml
AmintorDusko Jan 22, 2025
de9a1cc
Update .github/workflows/tests_lkcpu_python.yml
AmintorDusko Jan 22, 2025
6188b2a
Update .github/workflows/tests_lkcpu_python.yml
AmintorDusko Jan 22, 2025
7583576
Update .github/workflows/tests_lkcuda_python.yml
AmintorDusko Jan 22, 2025
bd68dee
Update .github/workflows/tests_lkcuda_python.yml
AmintorDusko Jan 22, 2025
12156aa
Update .github/workflows/tests_lqcpu_python.yml
AmintorDusko Jan 22, 2025
ca1deed
Update .github/workflows/tests_lqcpu_python.yml
AmintorDusko Jan 22, 2025
faa9093
Update .github/workflows/tests_lkcuda_python.yml
AmintorDusko Jan 22, 2025
1cea7bd
add main directory to pushd
AmintorDusko Jan 23, 2025
3c5da4c
update changelog
AmintorDusko Jan 23, 2025
cdc86ec
Update .github/workflows/tests_lkcpu_python.yml
AmintorDusko Jan 23, 2025
c7f8a9d
Update .github/workflows/tests_lkcuda_python.yml
AmintorDusko Jan 23, 2025
8cbf08d
Update .github/CHANGELOG.md
AmintorDusko Jan 23, 2025
29c5218
Update .github/workflows/tests_lkcuda_python.yml
AmintorDusko Jan 23, 2025
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
6 changes: 4 additions & 2 deletions .github/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,17 @@
### Documentation

### Bug fixes

* Patch `MultiControlledX` tests to fix stable/latest failures after the v0.40.0 release.
[(#1046)](https://github.com/PennyLaneAI/pennylane-lightning/pull/1046)

* Update Github CI to use Ubuntu 24 and remove `libopenblas-base` package.
[(#1041)](https://github.com/PennyLaneAI/pennylane-lightning/pull/1041)

### Contributors

This release contains contributions from (in alphabetical order):

Yushao Chen, Joseph Lee, Shuli Shu
Yushao Chen, Amintor Dusko, Joseph Lee, Shuli Shu

---

Expand Down
14 changes: 12 additions & 2 deletions .github/workflows/tests_gpu_python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -197,9 +197,18 @@ jobs:
if: matrix.pl_backend == 'lightning_gpu'
run: |
DEVICENAME=`echo ${{ matrix.pl_backend }} | sed "s/_/./g"`
pl-device-test --device ${DEVICENAME} --skip-ops --shots=20000 $COVERAGE_FLAGS --cov-append
pl-device-test --device ${DEVICENAME} --skip-ops --shots=10000 $COVERAGE_FLAGS --cov-append
pl-device-test --device ${DEVICENAME} --shots=None --skip-ops $COVERAGE_FLAGS --cov-append

#TODO: remove after v0.41.0 release (update the next step if condition too)
- name: Patch (stable/latest) - Remove after release
if: inputs.lightning-version == 'stable' && inputs.pennylane-version == 'latest'
run: |
pushd tests
find . -type f -exec sed -i 's/control_values=[wires[0], wires[1]]/control_values=[0, 1]/g' {} +
find . -type f -exec sed -i 's/"control_values": "01"/"control_values": [0, 1]/g' {} +
popd

- name: Run PennyLane Lightning unit tests
env:
OMP_NUM_THREADS: 1
Expand All @@ -208,8 +217,9 @@ jobs:
DEVICENAME=`echo ${{ matrix.pl_backend }} | sed "s/_/./g"`
PL_DEVICE=${DEVICENAME} python -m pytest tests/ $COVERAGE_FLAGS


- name: Test wheels for Lightning-GPU
if : matrix.pl_backend == 'lightning_gpu'
if : ${{ matrix.pl_backend == 'lightning_gpu' }}
run: |
python -m pip install -r requirements-dev.txt
PL_BACKEND=lightning_qubit python scripts/configure_pyproject_toml.py
Expand Down
26 changes: 23 additions & 3 deletions .github/workflows/tests_lkcpu_python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -237,16 +237,32 @@ jobs:
python -m pip install --upgrade torch==$TORCH_VERSION -f https://download.pytorch.org/whl/cpu/torch_stable.html
python -m pip install --upgrade tensorflow~=$TF_VERSION keras~=$TF_VERSION

- name: Run PennyLane-Lightning integration tests
env:
OMP_NUM_THREADS: 1
OMP_PROC_BIND: false
if: matrix.pl_backend == 'lightning_gpu'
run: |
DEVICENAME=`echo ${{ matrix.pl_backend }} | sed "s/_/./g"`
pl-device-test --device ${DEVICENAME} --skip-ops --shots=10000 $COVERAGE_FLAGS --cov-append
pl-device-test --device ${DEVICENAME} --shots=None --skip-ops $COVERAGE_FLAGS --cov-append

#TODO: remove after v0.41.0 release (update the next step if condition too)
- name: Patch (stable/latest) - Remove after release
if: inputs.lightning-version == 'stable' && inputs.pennylane-version == 'latest'
run: |
pushd tests
find . -type f -exec sed -i 's/control_values=[wires[0], wires[1]]/control_values=[0, 1]/g' {} +
find . -type f -exec sed -i 's/"control_values": "01"/"control_values": [0, 1]/g' {} +
popd

- name: Run PennyLane-Lightning unit tests
run: |
DEVICENAME=`echo ${{ matrix.pl_backend }} | sed "s/_/./g"`
# Remove `python -m` to avoid running tests with relative modules
PL_DEVICE=${DEVICENAME} pytest tests/ $COVERAGE_FLAGS --splits 7 --group ${{ matrix.group }} \
--store-durations --durations-path='.github/workflows/python_lightning_kokkos_test_durations.json' --splitting-algorithm=least_duration
mv .github/workflows/python_lightning_kokkos_test_durations.json ${{ github.workspace }}/.test_durations-${{ matrix.exec_model }}-${{ matrix.group }}
pl-device-test --device ${DEVICENAME} --skip-ops --shots=20000 $COVERAGE_FLAGS --cov-append
pl-device-test --device ${DEVICENAME} --shots=None --skip-ops $COVERAGE_FLAGS --cov-append
mv .coverage ${{ github.workspace }}/.coverage-${{ github.job }}-${{ matrix.pl_backend }}-${{ matrix.group }}

- name: Test editable install
run: |
Expand All @@ -267,6 +283,10 @@ jobs:
include-hidden-files: true
path: ${{ github.workspace }}/.test_durations-${{ matrix.exec_model }}-${{ matrix.group }}

- name: Move coverage file
run: |
mv .coverage ${{ github.workspace }}/.coverage-${{ github.job }}-${{ matrix.pl_backend }}-${{ matrix.group }}

- name: Upload code coverage results
uses: actions/upload-artifact@v4
with:
Expand Down
30 changes: 23 additions & 7 deletions .github/workflows/tests_lkcuda_python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -262,18 +262,31 @@ jobs:
PL_BACKEND=${{ matrix.pl_backend }} CMAKE_ARGS="-DCMAKE_PREFIX_PATH=${{ github.workspace }}/Kokkos" \
python -m pip install . -vv

- name: Run PennyLane-Lightning unit tests
if: ${{ matrix.pl_backend != 'all'}}
- name: Run PennyLane-Lightning integration tests
env:
OMP_NUM_THREADS: 1
OMP_PROC_BIND: false
if: matrix.pl_backend == 'lightning_gpu'
run: |
DEVICENAME=`echo ${{ matrix.pl_backend }} | sed "s/_/./g"`
pl-device-test --device ${DEVICENAME} --skip-ops --shots=10000 $COVERAGE_FLAGS --cov-append
pl-device-test --device ${DEVICENAME} --shots=None --skip-ops $COVERAGE_FLAGS --cov-append

#TODO: remove after v0.41.0 release (update the next step if condition too)
- name: Patch (stable/latest) - Remove after release
if: inputs.lightning-version == 'stable' && inputs.pennylane-version == 'latest'
run: |
pushd tests
find . -type f -exec sed -i 's/control_values=[wires[0], wires[1]]/control_values=[0, 1]/g' {} +
find . -type f -exec sed -i 's/"control_values": "01"/"control_values": [0, 1]/g' {} +
popd

- name: Run PennyLane-Lightning 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/ -k "not test_native_mcm" $COVERAGE_FLAGS
pl-device-test --device ${DEVICENAME} --skip-ops --shots=20000 $COVERAGE_FLAGS --cov-append
pl-device-test --device ${DEVICENAME} --shots=None --skip-ops $COVERAGE_FLAGS --cov-append
mv coverage.xml coverage-${{ github.job }}-${{ matrix.pl_backend }}.xml

- name: Install all backend devices
if: ${{ matrix.pl_backend == 'all' }}
Expand All @@ -286,17 +299,20 @@ jobs:
PL_BACKEND="lightning_kokkos" python scripts/configure_pyproject_toml.py || true
PL_BACKEND="lightning_kokkos" CMAKE_ARGS="-DCMAKE_PREFIX_PATH=${{ github.workspace }}/Kokkos" python -m pip install . -vv

- name: Run PennyLane-Lightning unit tests for lightning.qubit with all devices installed
- name: Run PennyLane unit tests for lightning.qubit with all devices installed
if: ${{ matrix.pl_backend == 'all' }}
env:
OMP_NUM_THREADS: 1
OMP_PROC_BIND: false
run: |
cd main/
for device in lightning.qubit lightning.kokkos; do
pl-device-test --device ${device} --skip-ops --shots=20000 $COVERAGE_FLAGS --cov-append
pl-device-test --device ${device} --skip-ops --shots=10000 $COVERAGE_FLAGS --cov-append
pl-device-test --device ${device} --shots=None --skip-ops $COVERAGE_FLAGS --cov-append
done

- name: Move coverage file
run: |
mv coverage.xml coverage-${{ github.job }}-${{ matrix.pl_backend }}.xml

- name: Upload code coverage results
Expand Down
26 changes: 22 additions & 4 deletions .github/workflows/tests_lqcpu_python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -197,17 +197,31 @@ jobs:
git log -1 --format='%H'
git status

- name: Run PennyLane-Lightning integration tests
run: |
DEVICENAME=`echo ${{ matrix.pl_backend }} | sed "s/_/./g"`
pl-device-test --device ${DEVICENAME} --skip-ops --shots=10000 $COVERAGE_FLAGS --cov-append
pl-device-test --device ${DEVICENAME} --shots=None --skip-ops $COVERAGE_FLAGS --cov-append

#TODO: remove after v0.41.0 release (update the next step if condition too)
- name: Patch (stable/latest) - Remove after release
if: inputs.lightning-version == 'stable' && inputs.pennylane-version == 'latest'
run: |
pushd tests
find . -type f -exec sed -i 's/control_values=[wires[0], wires[1]]/control_values=[0, 1]/g' {} +
find . -type f -exec sed -i 's/"control_values": "01"/"control_values": [0, 1]/g' {} +
popd

- name: Run PennyLane-Lightning unit tests
env:
OMP_NUM_THREADS: 1
run: |
DEVICENAME=`echo ${{ matrix.pl_backend }} | sed "s/_/./g"`
# Remove `python -m` to avoid running tests with relative modules
OMP_NUM_THREADS=1 PL_DEVICE=${DEVICENAME} pytest -n auto tests/ -k "not unitary_correct" \
PL_DEVICE=${DEVICENAME} pytest -n auto tests/ -k "not unitary_correct" \
$COVERAGE_FLAGS --store-durations --splits 4 --group ${{ matrix.group }} \
--durations-path='.github/workflows/python_lightning_qubit_test_durations.json' --splitting-algorithm=least_duration
PL_DEVICE=${DEVICENAME} pytest tests/ -k "unitary_correct" $COVERAGE_FLAGS --cov-append
pl-device-test --device ${DEVICENAME} --skip-ops --shots=20000 $COVERAGE_FLAGS --cov-append
pl-device-test --device ${DEVICENAME} --shots=None --skip-ops $COVERAGE_FLAGS --cov-append
mv .coverage ${{ github.workspace }}/.coverage-${{ github.job }}-${{ matrix.pl_backend }}-${{ matrix.blas }}-${{ matrix.group }}

- name: Upload test durations
uses: actions/upload-artifact@v4
Expand All @@ -216,6 +230,10 @@ jobs:
retention-days: 1
path: ${{ github.workspace }}/.test_durations-${{ matrix.exec_model }}-${{ matrix.group }}

- name: Move coverage file
run: |
mv .coverage ${{ github.workspace }}/.coverage-${{ github.job }}-${{ matrix.pl_backend }}-${{ matrix.blas }}-${{ matrix.group }}

- name: Upload code coverage results
uses: actions/upload-artifact@v4
with:
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ wheel:
coverage:
@echo "Generating coverage report for $(if $(device:-=),$(device),lightning.qubit) device:"
$(PYTHON) $(TESTRUNNER) $(COVERAGE)
pl-device-test --device $(if $(device:-=),$(device),lightning.qubit) --skip-ops --shots=20000 $(COVERAGE) --cov-append
pl-device-test --device $(if $(device:-=),$(device),lightning.qubit) --skip-ops --shots=10000 $(COVERAGE) --cov-append
pl-device-test --device $(if $(device:-=),$(device),lightning.qubit) --shots=None --skip-ops $(COVERAGE) --cov-append

coverage-cpp:
Expand All @@ -108,7 +108,7 @@ test-builtin:
PL_DEVICE=$(if $(device:-=),$(device),lightning.qubit) $(PYTHON) -I $(TESTRUNNER)

test-suite:
pl-device-test --device $(if $(device:-=),$(device),lightning.qubit) --skip-ops --shots=20000
pl-device-test --device $(if $(device:-=),$(device),lightning.qubit) --skip-ops --shots=10000
pl-device-test --device $(if $(device:-=),$(device),lightning.qubit) --shots=None --skip-ops

test-cpp:
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.41.0-dev5"
__version__ = "0.41.0-dev6"
Loading