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/lightning tests #850

Merged
merged 34 commits into from
Aug 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
9884e7d
update version
AmintorDusko Aug 13, 2024
e3c4686
update tests_lgpy_python [skip ci]
AmintorDusko Aug 13, 2024
e3fd55e
switch to stable branch for tests
AmintorDusko Aug 13, 2024
2104b6f
updates to lgpu python
AmintorDusko Aug 13, 2024
384c200
update lgpumpi
AmintorDusko Aug 13, 2024
29a772f
cleana nd update lqcpu workflow
AmintorDusko Aug 13, 2024
7211899
some more fixes to lqcpu
AmintorDusko Aug 13, 2024
b3b0440
more updates [skip ci]
AmintorDusko Aug 13, 2024
8cb6fd3
more updates [skip ci]
AmintorDusko Aug 13, 2024
bdf1b09
Auto update version from '0.38.0-dev32' to '0.38.0-dev33'
ringo-but-quantum Aug 13, 2024
8f65fb9
more updates [skip ci]
AmintorDusko Aug 13, 2024
c76a31f
Merge branch 'Fix/Lightning_Tests' of https://github.com/PennyLaneAI/…
AmintorDusko Aug 13, 2024
9729a81
more updates [skip ci]
AmintorDusko Aug 13, 2024
23b34c4
more updates [skip ci]
AmintorDusko Aug 13, 2024
724067d
add main path [skip ci]
AmintorDusko Aug 14, 2024
7807712
Merge branch 'master' into Fix/Lightning_Tests
AmintorDusko Aug 14, 2024
5542956
more fixes [skip ci]
AmintorDusko Aug 14, 2024
90ea0fc
Auto update version from '0.38.0-dev34' to '0.38.0-dev33'
ringo-but-quantum Aug 14, 2024
47d524c
add end line
AmintorDusko Aug 14, 2024
e517879
fix paths[skip ci]
AmintorDusko Aug 14, 2024
7f99e71
revert all lgpumpi changes
AmintorDusko Aug 14, 2024
0407688
Vincent's maneuver:smile:[skip ci]
AmintorDusko Aug 14, 2024
bbaf255
simplify some workflows
AmintorDusko Aug 14, 2024
9dfcf9a
update changelog
AmintorDusko Aug 14, 2024
4c761bf
fix bash condition
AmintorDusko Aug 14, 2024
27e90c4
change set variable
AmintorDusko Aug 14, 2024
84693fb
fix bash condition
AmintorDusko Aug 14, 2024
be8d490
fix typo
AmintorDusko Aug 14, 2024
0785f97
trigger CIs
AmintorDusko Aug 14, 2024
ad213cd
Update .github/workflows/tests_lgpumpi_python.yml
AmintorDusko Aug 14, 2024
146c35e
Update .github/workflows/tests_lqcpu_python.yml
AmintorDusko Aug 14, 2024
76670d3
Update .github/workflows/tests_without_binary.yml
AmintorDusko Aug 14, 2024
27f88b5
Update .github/workflows/tests_lgpumpi_python.yml
AmintorDusko Aug 14, 2024
bb560c0
Update .github/workflows/tests_lgpu_python.yml
AmintorDusko Aug 14, 2024
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
5 changes: 4 additions & 1 deletion .github/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

### Breaking changes

* Add `getData()` in `lightning.tensor` C++ backend. Users should be responsible for ensuring sufficient host memory is allocated for the full state vector.
* Add `getData()` in `lightning.tensor` C++ backend. Users should be responsible for ensuring sufficient host memory is allocated for the full state vector.
[(#827)](https://github.com/PennyLaneAI/pennylane-lightning/pull/827)

* Remove `NDpermuter.hpp` which is no longer required.
Expand Down Expand Up @@ -92,6 +92,9 @@

### Bug fixes

* Fix plugin-test-matrix CI/CD workflows.
[(#850)](https://github.com/PennyLaneAI/pennylane-lightning/pull/850)

* Set the `immutable` parameter value as `false` for the `cutensornetStateApplyTensorOperator` to allow the following `cutensornetStateUpdateTensorOperator` call.
[(#845)](https://github.com/PennyLaneAI/pennylane-lightning/pull/845)

Expand Down
17 changes: 8 additions & 9 deletions .github/workflows/tests_lgpu_python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -177,13 +177,12 @@ jobs:
run: |
cd main
rm -rf build
PL_BACKEND=lightning_qubit python scripts/configure_pyproject_toml.py
CMAKE_ARGS="-DENABLE_PYTHON=ON -DCMAKE_CXX_COMPILER=$(which g++-$GCC_VERSION)" \
python -m pip install . -vv
PL_BACKEND=lightning_qubit python scripts/configure_pyproject_toml.py || true
PL_BACKEND=lightning_qubit SKIP_COMPILATION=True python -m pip install . -vv

rm -rf build
PL_BACKEND=${{ matrix.pl_backend }} python scripts/configure_pyproject_toml.py
CMAKE_ARGS="-DENABLE_PYTHON=ON -DCMAKE_CXX_COMPILER=$(which g++-$GCC_VERSION) -DPython_EXECUTABLE=${{ steps.python_path.outputs.python }}" \
PL_BACKEND=${{ matrix.pl_backend }} python scripts/configure_pyproject_toml.py || true
PL_BACKEND=${{ matrix.pl_backend }} CMAKE_ARGS="-DPython_EXECUTABLE=${{ steps.python_path.outputs.python }}" \
python -m pip install . -vv

- name: Run PennyLane-Lightning-GPU unit tests
Expand All @@ -206,12 +205,12 @@ jobs:
run: |
cd main
rm -rf build
CMAKE_ARGS="-DPL_BACKEND=${{matrix.default_backend}} -DENABLE_PYTHON=ON -DCMAKE_CXX_COMPILER=$(which g++-$GCC_VERSION)" \
python -m pip install . -vv
PL_BACKEND=lightning_qubit python scripts/configure_pyproject_toml.py || true
PL_BACKEND=lightning_qubit python -m pip install . -vv
rm -rf build

CMAKE_ARGS="-DPL_BACKEND=${{ matrix.pl_backend }} -DENABLE_PYTHON=ON -DCMAKE_CXX_COMPILER=$(which g++-$GCC_VERSION)" \
python -m pip install . -vv
PL_BACKEND=${{ matrix.pl_backend }} python scripts/configure_pyproject_toml.py || true
PL_BACKEND=${{ matrix.pl_backend }} python -m pip install . -vv

- name: Run PennyLane-Lightning unit tests for lightning.qubit with all devices installed
if: ${{ matrix.pl_backend == 'all' }}
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/tests_lgpumpi_python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,12 +105,14 @@ jobs:
echo "pip=$pip_path" >> $GITHUB_OUTPUT

- name: Install required packages
env:
PL_BACKEND: lightning_qubit
maliasadi marked this conversation as resolved.
Show resolved Hide resolved
run: |
source /etc/profile.d/modules.sh && module use /opt/modules/ && module load ${{ matrix.mpilib }}/cuda-${{ matrix.cuda_version_maj }}.${{ matrix.cuda_version_min }}
python -m pip install -r requirements-dev.txt

python -m pip install custatevec-cu${{ matrix.cuda_version_maj }} mpi4py openfermionpyscf
PL_BACKEND=lightning_qubit python scripts/configure_pyproject_toml.py
python scripts/configure_pyproject_toml.py || true
python -m pip install . -vv

- name: Checkout PennyLane for release build
Expand All @@ -131,9 +133,10 @@ jobs:
- name: Build and install package
env:
CUQUANTUM_SDK: $(python -c "import site; print( f'{site.getsitepackages()[0]}/cuquantum')")
PL_BACKEND: lightning_gpu
run: |
source /etc/profile.d/modules.sh && module use /opt/modules/ && module load ${{ matrix.mpilib }}/cuda-${{ matrix.cuda_version_maj }}.${{ matrix.cuda_version_min }}
PL_BACKEND=lightning_gpu python scripts/configure_pyproject_toml.py
python scripts/configure_pyproject_toml.py || true
CMAKE_ARGS="-DCMAKE_C_COMPILER=mpicc -DCMAKE_CXX_COMPILER=mpicxx -DENABLE_MPI=ON -DCMAKE_CUDA_COMPILER=$(which nvcc) -DCMAKE_CUDA_ARCHITECTURES=${{ env.CI_CUDA_ARCH }} -DPython_EXECUTABLE=${{ steps.python_path.outputs.python }}" \
python -m pip install . -vv

Expand Down
36 changes: 17 additions & 19 deletions .github/workflows/tests_lkcpu_python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,19 +69,16 @@ jobs:
uses: actions/checkout@v4
with:
fetch-tags: true
path: main

- name: Switch to release build of Lightning
if: inputs.lightning-version == 'release'
run: |
cd main
git fetch --all
git checkout $(git branch -a --list "origin/v0.*rc*" | sort | tail -1)

- name: Switch to stable build of Lightning
if: inputs.lightning-version == 'stable'
run: |
cd main
git fetch --tags --force
git checkout latest_release
git log -1 --format='%H'
Expand Down Expand Up @@ -114,17 +111,25 @@ jobs:

- name: Get required Python packages
run: |
cd main
python -m pip install -r requirements-dev.txt

- name: Configure and build device wheel
env:
PL_BACKEND: ${{ matrix.pl_backend }}
# TODO: Update after Release 0.37
- name: Create device wheel ${{ inputs.lightning-version }}
if: inputs.lightning-version == 'stable'
run: |
PL_BACKEND=${{ matrix.pl_backend }} CMAKE_ARGS="-DCMAKE_PREFIX_PATH=${{ github.workspace }}/Kokkos" \
python setup.py bdist_wheel
cd dist
WHEEL_NAME=$(ls *.whl)
maliasadi marked this conversation as resolved.
Show resolved Hide resolved
cp $WHEEL_NAME ${{ github.workspace }}/wheel_${{ matrix.pl_backend }}-${{ matrix.exec_model }}.whl
echo $WHEEL_NAME > ${{ github.workspace }}/${{ matrix.pl_backend }}-${{ matrix.exec_model }}_name.txt

# TODO: Remove after Release 0.37
- name: Create device wheel ${{ inputs.lightning-version }}
if: inputs.lightning-version != 'stable'
run: |
cd main
python scripts/configure_pyproject_toml.py
CMAKE_ARGS="-DCMAKE_PREFIX_PATH=${{ github.workspace }}/Kokkos -DENABLE_PYTHON=ON -DCMAKE_CXX_COMPILER=$(which g++-$GCC_VERSION)" \
python -m build
PL_BACKEND=${{ matrix.pl_backend }} python scripts/configure_pyproject_toml.py
CMAKE_ARGS="-DCMAKE_PREFIX_PATH=${{ github.workspace }}/Kokkos" python -m build
cd dist
WHEEL_NAME=$(ls *.whl)
cp $WHEEL_NAME ${{ github.workspace }}/wheel_${{ matrix.pl_backend }}-${{ matrix.exec_model }}.whl
Expand Down Expand Up @@ -170,12 +175,10 @@ jobs:
uses: actions/checkout@v4
with:
fetch-tags: true
path: main

- name: Switch to release tag of Lightning
if: inputs.lightning-version == 'release'
run: |
cd main
git fetch --all
git checkout $(git branch -a --list "origin/v0.*rc*" | sort | tail -1)

Expand All @@ -187,7 +190,6 @@ jobs:
- name: Switch to stable tag of Lightning
if: inputs.lightning-version == 'stable'
run: |
cd main
git fetch --tags --force
git checkout latest_release
git log -1 --format='%H'
Expand All @@ -208,7 +210,6 @@ jobs:
run: |
WHEEL_NAME=$(cat ${{ github.workspace }}/${{ matrix.pl_backend }}-${{ matrix.exec_model }}_name.txt)
mv ${{ github.workspace }}/wheel_${{ matrix.pl_backend }}-${{ matrix.exec_model }}.whl ${{ github.workspace }}/$WHEEL_NAME
cd main
python -m pip install -r requirements-dev.txt
python -m pip install openfermionpyscf
if [ '${{ inputs.lightning-version }}' != 'stable' ]; then
Expand All @@ -235,7 +236,6 @@ jobs:
- name: Install Stable PennyLane
if: inputs.pennylane-version == 'stable'
run: |
cd main
python -m pip uninstall -y pennylane && python -m pip install -U pennylane

- name: Install ML libraries for interfaces
Expand All @@ -246,7 +246,6 @@ jobs:

- name: Run PennyLane-Lightning unit tests
run: |
cd main/
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 }} \
Expand All @@ -268,7 +267,7 @@ jobs:
uses: actions/upload-artifact@v3
with:
name: ubuntu-codecov-results-python
path: ./main/.coverage-${{ github.job }}-${{ matrix.pl_backend }}-${{ matrix.group }}
path: ./.coverage-${{ github.job }}-${{ matrix.pl_backend }}-${{ matrix.group }}
if-no-files-found: error

upload-to-codecov-linux-python:
Expand All @@ -280,7 +279,6 @@ jobs:
uses: actions/checkout@v4
with:
fetch-tags: true
path: main

- name: Download coverage reports
uses: actions/download-artifact@v3
Expand Down
18 changes: 8 additions & 10 deletions .github/workflows/tests_lkcuda_python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -242,11 +242,11 @@ jobs:
ls -l ${{ github.workspace }}/Kokkos
cd main

PL_BACKEND=lightning_qubit python scripts/configure_pyproject_toml.py
SKIP_COMPILATION=True python -m pip install . -vv
PL_BACKEND=lightning_qubit python scripts/configure_pyproject_toml.py || true
PL_BACKEND=lightning_qubit SKIP_COMPILATION=True python -m pip install . -vv

PL_BACKEND=${{ matrix.pl_backend }} python scripts/configure_pyproject_toml.py
CMAKE_ARGS="-DCMAKE_PREFIX_PATH=${{ github.workspace }}/Kokkos -DENABLE_PYTHON=ON -DCMAKE_CXX_COMPILER=$(which g++-$GCC_VERSION)" \
PL_BACKEND=${{ matrix.pl_backend }} python scripts/configure_pyproject_toml.py || true
PL_BACKEND=${{ matrix.pl_backend }} CMAKE_ARGS="-DCMAKE_PREFIX_PATH=${{ github.workspace }}/Kokkos" \
python -m pip install . -vv

- name: Run PennyLane-Lightning unit tests
Expand All @@ -267,13 +267,11 @@ jobs:
run: |
cd main

PL_BACKEND=lightning_qubit python scripts/configure_pyproject_toml.py
CMAKE_ARGS="-DENABLE_PYTHON=ON -DCMAKE_CXX_COMPILER=$(which g++-$GCC_VERSION)" \
python -m pip install . -vv
PL_BACKEND=lightning_qubit python scripts/configure_pyproject_toml.py || true
PL_BACKEND=lightning_qubit python -m pip install . -vv

PL_BACKEND="lightning_kokkos" python scripts/configure_pyproject_toml.py
CMAKE_ARGS="-DCMAKE_PREFIX_PATH=${{ github.workspace }}/Kokkos -DENABLE_PYTHON=ON -DCMAKE_CXX_COMPILER=$(which g++-$GCC_VERSION)" \
python -m pip install . -vv
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
if: ${{ matrix.pl_backend == 'all' }}
Expand Down
32 changes: 16 additions & 16 deletions .github/workflows/tests_lqcpu_python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,19 +54,16 @@ jobs:
uses: actions/checkout@v4
with:
fetch-tags: true
path: main

- name: Switch to release build of Lightning
if: inputs.lightning-version == 'release'
run: |
cd main
git fetch --all
git checkout $(git branch -a --list "origin/v0.*rc*" | sort | tail -1)

- name: Switch to stable build of Lightning
if: inputs.lightning-version == 'stable'
run: |
cd main
git fetch --tags --force
git checkout latest_release
git log -1 --format='%H'
Expand All @@ -79,16 +76,25 @@ jobs:

- name: Get required Python packages
run: |
cd main
python -m pip install -r requirements-dev.txt

- name: Create device wheel
id: create_lq_wheel
# TODO: Update after Release 0.37
- name: Create device wheel ${{ inputs.lightning-version }}
if: inputs.lightning-version != 'stable'
run: |
cd main
PL_BACKEND=${{ matrix.pl_backend }} python scripts/configure_pyproject_toml.py
CMAKE_ARGS="-DENABLE_BLAS=${{ matrix.blas }} -DLQ_ENABLE_KERNEL_OMP=ON -DENABLE_PYTHON=ON -DCMAKE_CXX_COMPILER=$(which g++-$GCC_VERSION)" \
python -m build
CMAKE_ARGS="-DENABLE_BLAS=${{ matrix.blas }} -DLQ_ENABLE_KERNEL_OMP=ON -DENABLE_PYTHON=ON" python -m build
cd dist
WHEEL_NAME=$(ls *.whl)
maliasadi marked this conversation as resolved.
Show resolved Hide resolved
cp $WHEEL_NAME ${{ github.workspace }}/wheel_${{ matrix.pl_backend }}-${{ matrix.blas }}.whl
echo $WHEEL_NAME > ${{ github.workspace }}/${{ matrix.pl_backend }}-${{ matrix.blas }}_name.txt

# TODO: Remove after Release 0.37
- name: Create device wheel (stable)
if: inputs.lightning-version == 'stable'
run: |
PL_BACKEND=${{ matrix.pl_backend }} CMAKE_ARGS="-DENABLE_BLAS=${{ matrix.blas }} -DLQ_ENABLE_KERNEL_OMP=ON -DENABLE_PYTHON=ON" \
python -m setup.py bdist_wheel
cd dist
WHEEL_NAME=$(ls *.whl)
cp $WHEEL_NAME ${{ github.workspace }}/wheel_${{ matrix.pl_backend }}-${{ matrix.blas }}.whl
Expand Down Expand Up @@ -132,7 +138,6 @@ jobs:
uses: actions/checkout@v4
with:
fetch-tags: true
path: main

- uses: actions/download-artifact@v4
with:
Expand All @@ -147,7 +152,6 @@ jobs:
- name: Get required Python packages
run: |
WHEEL_NAME=$(cat ${{ github.workspace }}/${{ matrix.pl_backend }}-${{ matrix.blas }}_name.txt)
cd main
mv ${{ github.workspace }}/wheel_${{ matrix.pl_backend }}-${{ matrix.blas }}.whl ${{ github.workspace }}/$WHEEL_NAME
python -m pip install -r requirements-dev.txt
python -m pip install openfermionpyscf
Expand All @@ -172,7 +176,6 @@ jobs:
- name: Install Stable PennyLane
if: inputs.pennylane-version == 'stable'
run: |
cd main
python -m pip uninstall -y pennylane && python -m pip install -U pennylane --no-deps

- name: Install ML libraries for interfaces
Expand All @@ -184,15 +187,13 @@ jobs:
- name: Switch to stable tag of Lightning
if: inputs.lightning-version == 'stable'
run: |
cd main
git fetch --tags --force
git checkout latest_release
git log -1 --format='%H'
git status

- name: Run PennyLane-Lightning unit tests
run: |
cd main/
DEVICENAME=`echo ${{ matrix.pl_backend }} | sed "s/_/./g"`
OMP_NUM_THREADS=1 PL_DEVICE=${DEVICENAME} python -m pytest -n auto tests/ -k "not unitary_correct" \
$COVERAGE_FLAGS --splits 4 --group ${{ matrix.group }} \
Expand All @@ -207,7 +208,7 @@ jobs:
with:
name: ubuntu-codecov-results-python
path: |
./main/.coverage-${{ github.job }}-${{ matrix.pl_backend }}-${{ matrix.group }}
./.coverage-${{ github.job }}-${{ matrix.pl_backend }}-${{ matrix.group }}
if-no-files-found: error

upload-to-codecov-linux-python:
Expand All @@ -219,7 +220,6 @@ jobs:
uses: actions/checkout@v4
with:
fetch-tags: true
path: main

- name: Download coverage reports
uses: actions/download-artifact@v3
Expand Down
12 changes: 5 additions & 7 deletions .github/workflows/tests_without_binary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
- name: Make disk space
run: |
for DIR in /usr/share/dotnet /usr/local/share/powershell /usr/share/swift; do
sudo du -sh $DIR || echo $DIR not found
sudo du -sh $DIR || echo $DIR not found
sudo rm -rf $DIR
done

Expand Down Expand Up @@ -101,19 +101,17 @@ jobs:
- name: Install the pennylane_lightning core package (lightning_qubit)
env:
SKIP_COMPILATION: True
PL_BACKEND: "lightning_qubit"
run: |
python scripts/configure_pyproject_toml.py
python -m pip install . -vv
PL_BACKEND="lightning_qubit" python scripts/configure_pyproject_toml.py || true
PL_BACKEND="lightning_qubit" python -m pip install . -vv

- name: Install extra backend device
if: matrix.pl_backend != 'lightning_qubit'
env:
SKIP_COMPILATION: True
PL_BACKEND: ${{ matrix.pl_backend }}
run: |
python scripts/configure_pyproject_toml.py
python -m pip install . -vv
PL_BACKEND=${{ matrix.pl_backend }} python scripts/configure_pyproject_toml.py || true
PL_BACKEND=${{ matrix.pl_backend }} python -m pip install . -vv

- name: Run PennyLane-Lightning unit tests for all backends
run: |
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.38.0-dev32"
__version__ = "0.38.0-dev33"
Loading