From 522f3abd4a3e94eb542e961aae56cb81a93b40e1 Mon Sep 17 00:00:00 2001 From: Shuli Shu <31480676+multiphaseCFD@users.noreply.github.com> Date: Tue, 30 Jul 2024 08:20:27 -0400 Subject: [PATCH] Default `ENABLE_LAPACK` as `OFF` (#825) ### 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. - [x] 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:** [SC-70045] **Description of the Change:** **Benefits:** **Possible Drawbacks:** **Related GitHub Issues:** --------- Co-authored-by: ringo-but-quantum Co-authored-by: Vincent Michaud-Rioux Co-authored-by: Ali Asadi <10773383+maliasadi@users.noreply.github.com> --- .github/CHANGELOG.md | 3 +++ .github/workflows/tests_lgpu_cpp.yml | 4 +++- .github/workflows/tests_linux_cpp.yml | 4 +++- .github/workflows/tests_lkcuda_cpp.yml | 4 +++- .github/workflows/tests_windows_cpp.yml | 1 - CMakeLists.txt | 2 +- 6 files changed, 13 insertions(+), 5 deletions(-) diff --git a/.github/CHANGELOG.md b/.github/CHANGELOG.md index a12de582ce..5410ed3590 100644 --- a/.github/CHANGELOG.md +++ b/.github/CHANGELOG.md @@ -15,6 +15,9 @@ ### Improvements +* `ENABLE_LAPACK` is off by default for all Lightning backends. + [(#825)](https://github.com/PennyLaneAI/pennylane-lightning/pull/825) + * Update `LightingQubit.preprocess` to work with changes to preprocessing for mid-circuit measurements. [(#812)](https://github.com/PennyLaneAI/pennylane-lightning/pull/812) diff --git a/.github/workflows/tests_lgpu_cpp.yml b/.github/workflows/tests_lgpu_cpp.yml index 1c8a6cebde..b3061bb4b5 100644 --- a/.github/workflows/tests_lgpu_cpp.yml +++ b/.github/workflows/tests_lgpu_cpp.yml @@ -61,9 +61,10 @@ jobs: strategy: matrix: pl_backend: ["lightning_gpu"] + enable_lapack: ["OFF", "ON"] cuda_version: ["12"] - name: C++ Tests (${{ matrix.pl_backend }}, cuda-${{ matrix.cuda_version }}) + name: C++ Tests (${{ matrix.pl_backend }}, cuda-${{ matrix.cuda_version }}, enable_lapack=${{ matrix.enable_lapack }}) runs-on: - ubuntu-22.04 - self-hosted @@ -136,6 +137,7 @@ jobs: -DCUQUANTUM_SDK=$(python -c "import site; print( f'{site.getsitepackages()[0]}/cuquantum')")\ -DBUILD_TESTS=ON \ -DENABLE_PYTHON=OFF \ + -DENABLE_LAPACK=${{ matrix.enable_lapack }} \ -DPL_BACKEND=${{ matrix.pl_backend }} \ -DCMAKE_CXX_COMPILER=$(which g++-$GCC_VERSION) \ -DENABLE_COVERAGE=ON \ diff --git a/.github/workflows/tests_linux_cpp.yml b/.github/workflows/tests_linux_cpp.yml index 34d1184d10..2023a7a511 100644 --- a/.github/workflows/tests_linux_cpp.yml +++ b/.github/workflows/tests_linux_cpp.yml @@ -48,11 +48,12 @@ jobs: pl_backend: ["lightning_qubit"] enable_kernel_omp: ["OFF", "ON"] enable_kernel_avx_streaming: ["OFF", "ON"] + enable_lapack: ["OFF", "ON"] exclude: - enable_kernel_omp: OFF enable_kernel_avx_streaming: ON timeout-minutes: 60 - name: C++ Tests (${{ matrix.pl_backend }}, ENABLE_KERNEL_OMP=${{ matrix.enable_kernel_omp }}, ENABLE_KERNEL_AVX_STREAMING=${{ matrix.enable_kernel_avx_streaming }}) + name: C++ Tests (${{ matrix.pl_backend }}, ENABLE_KERNEL_OMP=${{ matrix.enable_kernel_omp }}, ENABLE_KERNEL_AVX_STREAMING=${{ matrix.enable_kernel_avx_streaming }}), ENABLE_LAPACK=${{ matrix.enable_lapack }}) runs-on: ${{ needs.determine_runner.outputs.runner_group }} steps: @@ -75,6 +76,7 @@ jobs: -DCMAKE_BUILD_TYPE=Debug \ -DBUILD_TESTS=ON \ -DENABLE_PYTHON=OFF \ + -DENABLE_LAPACK=${{ matrix.enable_lapack }} \ -DPL_BACKEND=${{ matrix.pl_backend }} \ -DCMAKE_CXX_COMPILER=$(which g++-$GCC_VERSION) \ -DENABLE_COVERAGE=ON \ diff --git a/.github/workflows/tests_lkcuda_cpp.yml b/.github/workflows/tests_lkcuda_cpp.yml index 230ed51f85..96ef4e1bd0 100644 --- a/.github/workflows/tests_lkcuda_cpp.yml +++ b/.github/workflows/tests_lkcuda_cpp.yml @@ -111,8 +111,9 @@ jobs: pl_backend: ["lightning_kokkos"] exec_model: ["CUDA"] kokkos_version: ["4.3.01"] + enable_lapack: ["OFF", "ON"] - name: C++ Tests (${{ matrix.pl_backend }}, kokkos-${{ matrix.kokkos_version }}, model-${{ matrix.exec_model }}) + name: C++ Tests (${{ matrix.pl_backend }}, kokkos-${{ matrix.kokkos_version }}, model-${{ matrix.exec_model }}), enable_lapack-${{ matrix.enable_lapack }} runs-on: - ${{ matrix.os }} - self-hosted @@ -190,6 +191,7 @@ jobs: -DCMAKE_BUILD_TYPE=Debug \ -DBUILD_TESTS=ON \ -DENABLE_PYTHON=OFF \ + -DENABLE_LAPACK=${{ matrix.enable_lapack }} \ -DCMAKE_PREFIX_PATH=${{ github.workspace }}/Kokkos \ -DPL_BACKEND=${{ matrix.pl_backend }} \ -DCMAKE_CXX_COMPILER=$(which g++-$GCC_VERSION) \ diff --git a/.github/workflows/tests_windows_cpp.yml b/.github/workflows/tests_windows_cpp.yml index 2faccc0831..1b2e7522a6 100644 --- a/.github/workflows/tests_windows_cpp.yml +++ b/.github/workflows/tests_windows_cpp.yml @@ -131,7 +131,6 @@ jobs: -DBUILD_TESTS=ON ` -DENABLE_OPENMP=OFF ` -DENABLE_PYTHON=OFF ` - -DENABLE_LAPACK=OFF ` -DENABLE_GATE_DISPATCHER=OFF ` -DPL_BACKEND=${{ matrix.pl_backend }} ` -DENABLE_WARNINGS=OFF diff --git a/CMakeLists.txt b/CMakeLists.txt index c7674d90b8..a7e50f9004 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -47,7 +47,7 @@ option(ENABLE_WARNINGS "Enable warnings" ON) option(ENABLE_NATIVE "Enable native CPU build tuning" OFF) option(ENABLE_PYTHON "Enable compilation of the Python module" ON) -option(ENABLE_LAPACK "Enable compilation with scipy/LAPACK" ON) +option(ENABLE_LAPACK "Enable compilation with scipy/LAPACK" OFF) # OpenMP find_package(OpenMP)