diff --git a/.github/CHANGELOG.md b/.github/CHANGELOG.md index fc02db7d1..c7db86ccc 100644 --- a/.github/CHANGELOG.md +++ b/.github/CHANGELOG.md @@ -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. @@ -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) diff --git a/.github/workflows/tests_lgpu_python.yml b/.github/workflows/tests_lgpu_python.yml index 12b61392a..2746f3de2 100644 --- a/.github/workflows/tests_lgpu_python.yml +++ b/.github/workflows/tests_lgpu_python.yml @@ -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 @@ -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' }} diff --git a/.github/workflows/tests_lgpumpi_python.yml b/.github/workflows/tests_lgpumpi_python.yml index ab2eda478..d4595c303 100644 --- a/.github/workflows/tests_lgpumpi_python.yml +++ b/.github/workflows/tests_lgpumpi_python.yml @@ -105,12 +105,14 @@ jobs: echo "pip=$pip_path" >> $GITHUB_OUTPUT - name: Install required packages + env: + PL_BACKEND: lightning_qubit 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 @@ -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 diff --git a/.github/workflows/tests_lkcpu_python.yml b/.github/workflows/tests_lkcpu_python.yml index b7d674311..e063744b8 100644 --- a/.github/workflows/tests_lkcpu_python.yml +++ b/.github/workflows/tests_lkcpu_python.yml @@ -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' @@ -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) + 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 @@ -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) @@ -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' @@ -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 @@ -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 @@ -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 }} \ @@ -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: @@ -280,7 +279,6 @@ jobs: uses: actions/checkout@v4 with: fetch-tags: true - path: main - name: Download coverage reports uses: actions/download-artifact@v3 diff --git a/.github/workflows/tests_lkcuda_python.yml b/.github/workflows/tests_lkcuda_python.yml index ac0646898..b7a3eb8ef 100644 --- a/.github/workflows/tests_lkcuda_python.yml +++ b/.github/workflows/tests_lkcuda_python.yml @@ -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 @@ -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' }} diff --git a/.github/workflows/tests_lqcpu_python.yml b/.github/workflows/tests_lqcpu_python.yml index 84307cbaa..dbe5488c3 100644 --- a/.github/workflows/tests_lqcpu_python.yml +++ b/.github/workflows/tests_lqcpu_python.yml @@ -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' @@ -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) + 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 @@ -132,7 +138,6 @@ jobs: uses: actions/checkout@v4 with: fetch-tags: true - path: main - uses: actions/download-artifact@v4 with: @@ -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 @@ -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 @@ -184,7 +187,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' @@ -192,7 +194,6 @@ jobs: - 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 }} \ @@ -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: @@ -219,7 +220,6 @@ jobs: uses: actions/checkout@v4 with: fetch-tags: true - path: main - name: Download coverage reports uses: actions/download-artifact@v3 diff --git a/.github/workflows/tests_without_binary.yml b/.github/workflows/tests_without_binary.yml index 7fb1e75bb..e607b95de 100644 --- a/.github/workflows/tests_without_binary.yml +++ b/.github/workflows/tests_without_binary.yml @@ -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 @@ -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: | diff --git a/pennylane_lightning/core/_version.py b/pennylane_lightning/core/_version.py index 1e786a92c..281ac4807 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.38.0-dev32" +__version__ = "0.38.0-dev33"