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

Add C++ decomposition with scipy_openblas32 #995

Merged
merged 182 commits into from
Dec 4, 2024
Merged
Show file tree
Hide file tree
Changes from 175 commits
Commits
Show all changes
182 commits
Select commit Hold shift + click to select a range
4ccd52e
initial commit
multiphaseCFD Nov 12, 2024
0753743
Merge branch 'master' into add_scipy_openblas
multiphaseCFD Nov 12, 2024
565bdca
Auto update version from '0.40.0-dev7' to '0.40.0-dev8'
ringo-but-quantum Nov 12, 2024
ce45b57
add scipy-openblas32 for c++ tests
multiphaseCFD Nov 12, 2024
80ff805
update catalyst lqubit
multiphaseCFD Nov 12, 2024
91d7290
update requirements
multiphaseCFD Nov 12, 2024
d45b6b3
update cmake
multiphaseCFD Nov 12, 2024
102e3a7
test windows
multiphaseCFD Nov 12, 2024
2f84209
make format
multiphaseCFD Nov 12, 2024
1300f06
test
multiphaseCFD Nov 12, 2024
351239d
quick test
multiphaseCFD Nov 12, 2024
2d59042
fix windows_cpp ci
multiphaseCFD Nov 12, 2024
99ec71b
quick fix
multiphaseCFD Nov 12, 2024
25e1b12
test
multiphaseCFD Nov 12, 2024
550f031
quick check
multiphaseCFD Nov 13, 2024
9cf2ee1
quick check
multiphaseCFD Nov 13, 2024
1d06813
update
multiphaseCFD Nov 13, 2024
cd3f6f8
hardcode path
multiphaseCFD Nov 13, 2024
9e2fbc1
debug windows
multiphaseCFD Nov 13, 2024
ab0abda
quick fix
multiphaseCFD Nov 13, 2024
0b4891c
quick fix for c++
multiphaseCFD Nov 13, 2024
be80d27
add path to scipy to env windows C++ CI
multiphaseCFD Nov 13, 2024
190812e
typo fix
multiphaseCFD Nov 13, 2024
42cf833
debug
multiphaseCFD Nov 13, 2024
1e38598
debug
multiphaseCFD Nov 13, 2024
d8c21c5
debug
multiphaseCFD Nov 13, 2024
e2e116b
Auto update version from '0.40.0-dev8' to '0.40.0-dev9'
ringo-but-quantum Nov 13, 2024
c0222c0
Remove Tensor and Hamiltonian in python frontend for lightning (#994)
lillian542 Nov 13, 2024
c01c122
Auto update version from '0.40.0-dev8' to '0.40.0-dev9'
ringo-but-quantum Nov 13, 2024
c9f5eae
Remove Tensor and Hamiltonian in python frontend for lightning (#994)
lillian542 Nov 13, 2024
41f9adb
Auto update version from '0.40.0-dev8' to '0.40.0-dev9'
ringo-but-quantum Nov 13, 2024
dedcdb7
Merge branch 'master' into add_scipy_openblas
multiphaseCFD Nov 13, 2024
086ef56
Auto update version from '0.40.0-dev8' to '0.40.0-dev9'
ringo-but-quantum Nov 13, 2024
49e1eae
use env variable directly
multiphaseCFD Nov 13, 2024
35e05ff
test
multiphaseCFD Nov 13, 2024
db89ccf
fix
multiphaseCFD Nov 13, 2024
90f0049
debug
multiphaseCFD Nov 13, 2024
a5ef053
debug
multiphaseCFD Nov 13, 2024
eea1874
test
multiphaseCFD Nov 13, 2024
b8d80b0
test
multiphaseCFD Nov 13, 2024
fdddfcd
update cmake helper
multiphaseCFD Nov 13, 2024
b0fa853
quick test
multiphaseCFD Nov 13, 2024
057730c
debug for win32
multiphaseCFD Nov 13, 2024
fe30cf8
check
multiphaseCFD Nov 13, 2024
3b91fea
fix typo
multiphaseCFD Nov 13, 2024
71a209e
debug
multiphaseCFD Nov 13, 2024
cf0fca6
test
multiphaseCFD Nov 13, 2024
8afef43
quick fix
multiphaseCFD Nov 13, 2024
25eea18
check
multiphaseCFD Nov 13, 2024
cb54549
check
multiphaseCFD Nov 13, 2024
61758c8
quick debug
multiphaseCFD Nov 13, 2024
c497c06
test NO_DEFAULT_PATH
multiphaseCFD Nov 13, 2024
6392713
quick check
multiphaseCFD Nov 13, 2024
3f4f734
debug
multiphaseCFD Nov 13, 2024
8ee9a89
refactor sharedlibLoader
multiphaseCFD Nov 13, 2024
cae0131
fix win32 ci
multiphaseCFD Nov 13, 2024
f5e753d
update cmakelist in the root
multiphaseCFD Nov 13, 2024
128bec4
update tidy ci workflow
multiphaseCFD Nov 13, 2024
582300e
fix tidy complains
multiphaseCFD Nov 13, 2024
972485a
add BLASLibLoader class to manage scipy_openblas loading
multiphaseCFD Nov 13, 2024
ec471b3
remove enable_lapack from linux cpp workflow
multiphaseCFD Nov 13, 2024
ca55dc5
remove enable_lapack from lkcuda workflow
multiphaseCFD Nov 13, 2024
0a222ca
update LGPU/LGPU-MPI workflows
multiphaseCFD Nov 13, 2024
f017a86
debug windows path cmake
multiphaseCFD Nov 13, 2024
d8f7c83
path change convention changes in BLASLib for windows
multiphaseCFD Nov 13, 2024
933b9c4
revert previous changes and avoid openblas.lib load for MS
multiphaseCFD Nov 13, 2024
6f782fc
make format
multiphaseCFD Nov 13, 2024
81aec6e
refactor UtilLinearAlg API
multiphaseCFD Nov 14, 2024
e6d9b74
fix clang tidy complains
multiphaseCFD Nov 14, 2024
3f39819
test new win headerfiles
multiphaseCFD Nov 14, 2024
e1e701f
revert last changes
multiphaseCFD Nov 14, 2024
b1110ab
tidy up code
multiphaseCFD Nov 14, 2024
0146863
update controlled gate support in catalyst support
multiphaseCFD Nov 18, 2024
82f21f7
Auto update version from '0.40.0-dev9' to '0.40.0-dev11'
ringo-but-quantum Nov 18, 2024
89bdab1
quick test
multiphaseCFD Nov 18, 2024
03050a8
update controlled gates LGPU catalyst tests
multiphaseCFD Nov 18, 2024
40dc38c
Auto update version from '0.40.0-dev11' to '0.40.0-dev12'
ringo-but-quantum Nov 18, 2024
5d51108
make format
multiphaseCFD Nov 18, 2024
a4dd362
make format
multiphaseCFD Nov 18, 2024
dbf459d
Merge branch 'master' into add_scipy_openblas
multiphaseCFD Nov 18, 2024
1ea66a0
Auto update version from '0.40.0-dev11' to '0.40.0-dev12'
ringo-but-quantum Nov 18, 2024
8a99606
quick fix
multiphaseCFD Nov 18, 2024
d6aeeac
update cmakelist and applyControlledMatrix
multiphaseCFD Nov 18, 2024
0e49984
update win-wheels
multiphaseCFD Nov 19, 2024
a0f0e4a
fix for windows
multiphaseCFD Nov 19, 2024
c131628
quick test
multiphaseCFD Nov 19, 2024
ee58730
dirty fix
multiphaseCFD Nov 19, 2024
f87d422
update mpi cis
multiphaseCFD Nov 19, 2024
bd420d1
test if only load openblas is sufficient
multiphaseCFD Nov 19, 2024
328cb5b
tidy up BLASLibLoader
multiphaseCFD Nov 19, 2024
da3b98a
update cmake with setuppy build
multiphaseCFD Nov 19, 2024
75e4bab
quick fix
multiphaseCFD Nov 19, 2024
24f88b6
macos tests
multiphaseCFD Nov 19, 2024
8c4880d
remove getscipyprefix
multiphaseCFD Nov 19, 2024
82422e5
update configure_pyproject_toml
multiphaseCFD Nov 19, 2024
4e5e72f
make format
multiphaseCFD Nov 19, 2024
634e160
update blaslibloader
multiphaseCFD Nov 19, 2024
6eb36b7
Merge branch 'master' into add_scipy_openblas
multiphaseCFD Nov 20, 2024
a834859
Auto update version from '0.40.0-dev12' to '0.40.0-dev13'
ringo-but-quantum Nov 20, 2024
0153758
move find scipy logic to process_option.cmake
multiphaseCFD Nov 20, 2024
8fbfa83
Merge branch 'master' into add_scipy_openblas
multiphaseCFD Nov 20, 2024
a375d7e
make format
multiphaseCFD Nov 20, 2024
47b809d
Auto update version from '0.40.0-dev13' to '0.40.0-dev14'
ringo-but-quantum Nov 20, 2024
21a3df1
tidy up FindSCIPY_OPENBLAS32.cmake
multiphaseCFD Nov 20, 2024
6706e52
add rpath support
multiphaseCFD Nov 20, 2024
98bc254
add scipy_openblas32/lib to the package_data
multiphaseCFD Nov 20, 2024
1fffb71
update error message
multiphaseCFD Nov 20, 2024
5379244
update CI with scipy-openblas dependent
multiphaseCFD Nov 20, 2024
64891e8
update setup.py to ensure scipy-openblas32/lib is correctly copied in…
multiphaseCFD Nov 20, 2024
bd555e4
Ensure one BUILD_RPATH set
multiphaseCFD Nov 20, 2024
f5688e2
copy all depenent libs to wheels macos
multiphaseCFD Nov 20, 2024
ba425ac
quick fix setup.py
multiphaseCFD Nov 20, 2024
148a6ef
quick test
multiphaseCFD Nov 20, 2024
f9987a1
Add RPATH support to L/Catalyst integration
multiphaseCFD Nov 21, 2024
1bb5251
QUICK FIX
multiphaseCFD Nov 21, 2024
0af490e
update BLASLibLoader
multiphaseCFD Nov 21, 2024
4d617ef
make format
multiphaseCFD Nov 21, 2024
ddbb355
tidy up code
multiphaseCFD Nov 22, 2024
203c528
tidy up
multiphaseCFD Nov 22, 2024
5664b60
fix codecov complain
multiphaseCFD Nov 22, 2024
e635ac8
don't ship wheels with scipy_openblas32.libs
multiphaseCFD Nov 25, 2024
0e46fc0
Auto update version from '0.40.0-dev14' to '0.40.0-dev16'
ringo-but-quantum Nov 25, 2024
66573ce
tidy up code
multiphaseCFD Nov 25, 2024
7ddec4e
fix typo
multiphaseCFD Nov 25, 2024
605c235
Merge branch 'master' into add_scipy_openblas
multiphaseCFD Nov 25, 2024
662a524
Auto update version from '0.40.0-dev16' to '0.40.0-dev17'
ringo-but-quantum Nov 25, 2024
db5077b
test if openblas32 dependency can be removed win32.
multiphaseCFD Nov 27, 2024
3943899
Auto update version from '0.40.0-dev17' to '0.40.0-dev20'
ringo-but-quantum Nov 27, 2024
2ee8616
Merge branch 'master' into add_scipy_openblas
multiphaseCFD Nov 27, 2024
f833627
Auto update version from '0.40.0-dev19' to '0.40.0-dev20'
ringo-but-quantum Nov 27, 2024
5a589e5
add openblas32 in CIBW_BEFORE_BUILD win wheel
multiphaseCFD Nov 27, 2024
e67e19f
update docstring
multiphaseCFD Nov 27, 2024
4d2d643
string -> string_view
multiphaseCFD Nov 27, 2024
989f809
make format
multiphaseCFD Nov 27, 2024
e6a9c72
revert string_view to string
multiphaseCFD Nov 27, 2024
0a1569e
make format
multiphaseCFD Nov 27, 2024
4146a2c
inline get_scipylib_path_worker
multiphaseCFD Nov 27, 2024
93857f6
quick fix for typo
multiphaseCFD Nov 27, 2024
7ea2b44
Merge branch 'master' into add_scipy_openblas
multiphaseCFD Nov 27, 2024
9305f1c
Auto update version from '0.40.0-dev20' to '0.40.0-dev21'
ringo-but-quantum Nov 27, 2024
353ef5c
safety check
multiphaseCFD Nov 27, 2024
e3ca66d
DWORD -> string convert for windows
multiphaseCFD Nov 27, 2024
905ebf1
saftety check for win libloader
multiphaseCFD Nov 27, 2024
b9cd734
update requirement-tests
multiphaseCFD Nov 27, 2024
1f0fa49
update requirements.txt
multiphaseCFD Nov 27, 2024
e6096cd
update conditional compilation sharedlibloader
multiphaseCFD Nov 27, 2024
5592b6f
move scipy-openblas32 from requires to dependencies
multiphaseCFD Nov 27, 2024
faf0973
update wheels CIs
multiphaseCFD Nov 27, 2024
1468a16
update README
multiphaseCFD Nov 27, 2024
546873c
add pip install flag
multiphaseCFD Nov 27, 2024
b6ee34f
remove SCIPY_OPENBLAS32_LIB_PATH from runpath for release and install…
multiphaseCFD Nov 27, 2024
e779e4f
update ci lkcuda_cp ci
multiphaseCFD Nov 27, 2024
4c9d2a8
update runpath set
multiphaseCFD Nov 28, 2024
cdb1ded
make format
multiphaseCFD Nov 28, 2024
039b76a
update cmake
multiphaseCFD Nov 28, 2024
0c66a50
Auto update version from '0.40.0-dev21' to '0.40.0-dev22'
ringo-but-quantum Nov 28, 2024
57f3f67
Merge branch 'master' into add_scipy_openblas
multiphaseCFD Nov 28, 2024
0c2224e
Auto update version from '0.40.0-dev21' to '0.40.0-dev22'
ringo-but-quantum Nov 28, 2024
0431dd7
update toml
multiphaseCFD Nov 28, 2024
798ece9
update toml
multiphaseCFD Nov 28, 2024
8c238b0
shots only
multiphaseCFD Nov 28, 2024
de7b191
revert toml changes
multiphaseCFD Nov 28, 2024
83c98fb
Merge branch 'master' into add_scipy_openblas
multiphaseCFD Nov 28, 2024
c0d1d18
Auto update version from '0.40.0-dev22' to '0.40.0-dev23'
ringo-but-quantum Nov 28, 2024
425b6c3
Build LK with GCC 11 for testing CIs (#1013)
maliasadi Nov 28, 2024
cb644fe
Auto update version from '0.40.0-dev23' to '0.40.0-dev24'
ringo-but-quantum Nov 28, 2024
8eeb141
Build LK with GCC 11 for testing CIs (#1013)
maliasadi Nov 28, 2024
62144b9
Auto update version from '0.40.0-dev23' to '0.40.0-dev24'
ringo-but-quantum Dec 2, 2024
9af327a
Merge branch 'master' into add_scipy_openblas
multiphaseCFD Dec 2, 2024
570ff50
Auto update version from '0.40.0-dev23' to '0.40.0-dev24'
ringo-but-quantum Dec 2, 2024
35c0f40
update get_scipy_openblas_libname with {CMAKE_SHARED_LIBRARY_SUFFIX}
multiphaseCFD Dec 2, 2024
a30d9c9
Merge branch 'master' into add_scipy_openblas
multiphaseCFD Dec 3, 2024
3529b04
Auto update version from '0.40.0-dev24' to '0.40.0-dev25'
ringo-but-quantum Dec 3, 2024
360523b
update changelog entry
multiphaseCFD Dec 3, 2024
5101d23
python -> $(PYTHON) in the makefile
multiphaseCFD Dec 3, 2024
7cdd7ac
apply Ali's comments
multiphaseCFD Dec 3, 2024
69aebc0
update python command to get path to scipy_openblas32
multiphaseCFD Dec 3, 2024
363071f
Merge branch 'master' into add_scipy_openblas
multiphaseCFD Dec 3, 2024
dfcd24e
Auto update version from '0.40.0-dev25' to '0.40.0-dev26'
ringo-but-quantum Dec 3, 2024
d610c1b
Merge branch 'master' into add_scipy_openblas
multiphaseCFD Dec 4, 2024
3bcfe76
Auto update version from '0.40.0-dev27' to '0.40.0-dev28'
ringo-but-quantum Dec 4, 2024
4342619
update requirements.txt
multiphaseCFD Dec 4, 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
15 changes: 9 additions & 6 deletions .github/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@

### Breaking changes

* Removed all instances of `qml.QubitStateVector`.
[(#985)](https://github.com/PennyLaneAI/pennylane-lightning/pull/985)

* Handling for the legacy operator arithmetic (the `Hamiltonian` and `Tensor` classes in PennyLane) is removed.
[(#994)](https://github.com/PennyLaneAI/pennylane-lightning/pull/994)
[(#997)](https://github.com/PennyLaneAI/pennylane-lightning/pull/997)

* Removed all instances of `qml.QubitStateVector`.
[(#985)](https://github.com/PennyLaneAI/pennylane-lightning/pull/985)

### Improvements

* Reverse Lightning Qubit generators vector insertion order.
Expand All @@ -32,9 +32,15 @@
* Enable N-controlled gate and matrix support to `lightning.gpu` simulator for Catalyst.
[(#1005)](https://github.com/PennyLaneAI/pennylane-lightning/pull/1005)

* Generalize seeding mechanism for all measurements.
[(#1003)](https://github.com/PennyLaneAI/pennylane-lightning/pull/1003)

* Update Kokkos version support to 4.4.1 and enable Lightning-Kokkos[CUDA] C++ tests on CI.
[(#1000)](https://github.com/PennyLaneAI/pennylane-lightning/pull/1000)

* Add native BLAS support to the C++ layer via dynamic `scipy-openblas32` loading.
[(#995)](https://github.com/PennyLaneAI/pennylane-lightning/pull/995)

* Update installation instruction for Lightning-GPU-MPI to explicitly ask users to add `path/to/libmpi.so` to the `LD_LIBRARY_PATH`. Update the runtime error message to ensure users know how to fix.
[(#993)](https://github.com/PennyLaneAI/pennylane-lightning/pull/993)

Expand All @@ -47,9 +53,6 @@
* Update the `lightning.kokkos` CUDA backend for compatibility with Catalyst.
[(#942)](https://github.com/PennyLaneAI/pennylane-lightning/pull/942)

* Generalize seeding mechanism for all measurements.
[(#1003)](https://github.com/PennyLaneAI/pennylane-lightning/pull/1003)

### Documentation

* Update Lightning-Tensor installation docs and usage suggestions.
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/tests_gpu_cpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ jobs:

- name: Install required basic packages
run: |
python -m pip install ninja cmake scipy
python -m pip install ninja cmake scipy-openblas32

- name: Install required lightning_gpu only packages
if: matrix.pl_backend == 'lightning_gpu'
Expand All @@ -144,6 +144,7 @@ jobs:
-DBUILD_TESTS=ON \
-DENABLE_PYTHON=OFF \
-DPL_BACKEND=${{ matrix.pl_backend }} \
-DSCIPY_OPENBLAS=$(python -c "import scipy_openblas32; import os; print(os.path.dirname(scipy_openblas32.get_lib_dir()))") \
-DCMAKE_CXX_COMPILER=$(which g++-$GCC_VERSION) \
-DENABLE_COVERAGE=ON \
-G Ninja
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/tests_lgpumpi_cpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ jobs:
run: |
source /etc/profile.d/modules.sh && module use /opt/modules/ && module load ${{ matrix.mpilib }}/cuda-${{ matrix.cuda_version_maj }}.${{ matrix.cuda_version_min }}
export CUQUANTUM_SDK=$(python -c "import site; print( f'{site.getsitepackages()[0]}/cuquantum')")
export SCIPY_OPENBLAS=$(python -c "import scipy_openblas32; import os; print(os.path.dirname(scipy_openblas32.get_lib_dir()))")
multiphaseCFD marked this conversation as resolved.
Show resolved Hide resolved
cmake . -BBuild \
-DPL_BACKEND=lightning_gpu \
-DENABLE_PYTHON=OFF \
Expand All @@ -140,6 +141,7 @@ jobs:
-DCMAKE_CUDA_COMPILER=$(which nvcc) \
-DCMAKE_CUDA_ARCHITECTURES="86" \
-DCUQUANTUM_SDK=${CUQUANTUM_SDK} \
-DSCIPY_OPENBLAS=${SCIPY_OPENBLAS} \
-DPython_EXECUTABLE:FILE="${{ steps.python_path.outputs.python }}" \
-G Ninja
cmake --build ./Build
Expand Down
24 changes: 13 additions & 11 deletions .github/workflows/tests_linux_cpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,11 @@ 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 }}), ENABLE_LAPACK=${{ matrix.enable_lapack }})
name: C++ Tests (${{ matrix.pl_backend }}, ENABLE_KERNEL_OMP=${{ matrix.enable_kernel_omp }}, ENABLE_KERNEL_AVX_STREAMING=${{ matrix.enable_kernel_avx_streaming }})
runs-on: pl-4-core-large-runner

steps:
Expand All @@ -66,15 +65,15 @@ jobs:
- name: Install dependencies
run: |
echo ${{ github.event_name }} && sudo apt-get update && sudo apt-get -y -q install cmake gcc-$GCC_VERSION g++-$GCC_VERSION ninja-build gcovr lcov
python -m pip install scipy
python -m pip install scipy-openblas32

- name: Build and run unit tests
run: |
cmake . -BBuild -G Ninja \
-DCMAKE_BUILD_TYPE=Debug \
-DBUILD_TESTS=ON \
-DENABLE_PYTHON=OFF \
-DENABLE_LAPACK=${{ matrix.enable_lapack }} \
-DSCIPY_OPENBLAS=$(python -c "import scipy_openblas32; import os; print(os.path.dirname(scipy_openblas32.get_lib_dir()))") \
-DPL_BACKEND=${{ matrix.pl_backend }} \
-DCMAKE_CXX_COMPILER=$(which g++-$GCC_VERSION) \
-DENABLE_COVERAGE=ON \
Expand All @@ -88,13 +87,13 @@ jobs:
for file in *runner ; do ./$file --order lex --reporter junit --out ./tests/results/report_$file.xml; done;
lcov --directory . -b ../pennylane_lightning/core/src --capture --output-file coverage.info
lcov --remove coverage.info '/usr/*' --output-file coverage.info
mv coverage.info coverage-${{ github.job }}-${{ matrix.pl_backend }}-${{ matrix.enable_kernel_avx_streaming }}-${{ matrix.enable_kernel_omp }}-${{ matrix.enable_lapack }}.info
mv coverage.info coverage-${{ github.job }}-${{ matrix.pl_backend }}-${{ matrix.enable_kernel_avx_streaming }}-${{ matrix.enable_kernel_omp }}.info

- name: Upload test results
uses: actions/upload-artifact@v4
if: always()
with:
name: ubuntu-tests-reports-${{ github.job }}-${{ matrix.pl_backend }}-${{ matrix.enable_kernel_avx_streaming }}-${{ matrix.enable_kernel_omp }}-${{ matrix.enable_lapack }}
name: ubuntu-tests-reports-${{ github.job }}-${{ matrix.pl_backend }}-${{ matrix.enable_kernel_avx_streaming }}-${{ matrix.enable_kernel_omp }}
retention-days: 1
include-hidden-files: true
path: |
Expand All @@ -105,8 +104,8 @@ jobs:
- name: Upload code coverage results
uses: actions/upload-artifact@v4
with:
name: ubuntu-codecov-results-${{ matrix.pl_backend }}-${{ matrix.enable_kernel_avx_streaming }}-${{ matrix.enable_kernel_omp }}-${{ matrix.enable_lapack }}
path: ./Build/coverage-${{ github.job }}-${{ matrix.pl_backend }}-${{ matrix.enable_kernel_avx_streaming }}-${{ matrix.enable_kernel_omp }}-${{ matrix.enable_lapack }}.info
name: ubuntu-codecov-results-${{ matrix.pl_backend }}-${{ matrix.enable_kernel_avx_streaming }}-${{ matrix.enable_kernel_omp }}
path: ./Build/coverage-${{ github.job }}-${{ matrix.pl_backend }}-${{ matrix.enable_kernel_avx_streaming }}-${{ matrix.enable_kernel_omp }}.info
if-no-files-found: error

cpptestswithOpenBLAS:
Expand All @@ -130,7 +129,7 @@ jobs:
- name: Install dependencies
run: |
sudo apt-get update && sudo apt-get -y -q install cmake gcc-$GCC_VERSION g++-$GCC_VERSION libopenblas-base libopenblas-dev ninja-build gcovr lcov
python -m pip install scipy
python -m pip install scipy-openblas32

- name: Build and run unit tests
run: |
Expand All @@ -139,6 +138,7 @@ jobs:
-DENABLE_PYTHON=OFF \
-DENABLE_BLAS=ON \
-DPL_BACKEND=${{ matrix.pl_backend }} \
-DSCIPY_OPENBLAS=$(python -c "import scipy_openblas32; import os; print(os.path.dirname(scipy_openblas32.get_lib_dir()))") \
-DBUILD_TESTS=ON \
-DCMAKE_CXX_COMPILER=$(which g++-$GCC_VERSION) \
-DENABLE_COVERAGE=ON
Expand Down Expand Up @@ -215,7 +215,7 @@ jobs:
- name: Install dependencies
run: |
sudo apt-get update && sudo apt-get -y -q install cmake gcc-$GCC_VERSION g++-$GCC_VERSION ninja-build gcovr lcov
python -m pip install scipy
python -m pip install scipy-openblas32

- name: Build and run unit tests
run: |
Expand All @@ -226,6 +226,7 @@ jobs:
-DCMAKE_PREFIX_PATH=${{ github.workspace }}/Kokkos \
-DPL_BACKEND=${{ matrix.pl_backend }} \
-DCMAKE_CXX_COMPILER=$(which g++-$GCC_VERSION) \
-DSCIPY_OPENBLAS=$(python -c "import scipy_openblas32; import os; print(os.path.dirname(scipy_openblas32.get_lib_dir()))") \
-DENABLE_COVERAGE=ON
cmake --build ./Build
cd ./Build
Expand Down Expand Up @@ -314,7 +315,7 @@ jobs:
- name: Install dependencies
run: |
sudo apt-get update && sudo apt-get -y -q install cmake gcc-$GCC_VERSION g++-$GCC_VERSION ninja-build gcovr lcov
python -m pip install scipy
python -m pip install scipy-openblas32

- name: Build and run unit tests
run: |
Expand All @@ -324,6 +325,7 @@ jobs:
-DENABLE_PYTHON=OFF \
-DCMAKE_PREFIX_PATH=${{ github.workspace }}/Kokkos \
-DPL_BACKEND="lightning_qubit;lightning_kokkos" \
-DSCIPY_OPENBLAS=$(python -c "import scipy_openblas32; import os; print(os.path.dirname(scipy_openblas32.get_lib_dir()))") \
-DCMAKE_CXX_COMPILER=$(which g++-$GCC_VERSION)
cmake --build ./Build
cd ./Build
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests_lkcpu_python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ jobs:
- name: Install dependencies
run: |
sudo apt-get update && sudo apt-get -y -q install cmake gcc-$GCC_VERSION g++-$GCC_VERSION
python -m pip install scipy wheel
python -m pip install scipy-openblas32 wheel

- name: Get required Python packages
run: |
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/tests_lkcuda_cpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,9 @@ jobs:


- name: Install dependencies
run: sudo apt-get update && sudo apt-get -y -q install cmake gcc-$GCC_VERSION g++-$GCC_VERSION ninja-build gcovr lcov
run: |
sudo apt-get update && sudo apt-get -y -q install cmake gcc-$GCC_VERSION g++-$GCC_VERSION ninja-build gcovr lcov
python -m pip install scipy-openblas32

- name: Build and run unit tests
run: |
Expand All @@ -191,6 +193,8 @@ jobs:
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DBUILD_TESTS=ON \
-DENABLE_PYTHON=OFF \
-DSCIPY_OPENBLAS=$(python -c "import scipy_openblas32; import os; print(os.path.dirname(scipy_openblas32.get_lib_dir()))") \
-DCMAKE_PREFIX_PATH=${{ github.workspace }}/Kokkos \
-DPL_BACKEND=${{ matrix.pl_backend }} \
-DCMAKE_CXX_COMPILER=$(which g++-$GCC_VERSION) \
-DENABLE_COVERAGE=ON
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests_lqcpu_python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ jobs:
- name: Install dependencies
run: |
sudo apt-get update && sudo apt-get -y -q install cmake gcc-$GCC_VERSION g++-$GCC_VERSION libopenblas-base libopenblas-dev
python -m pip install scipy wheel
python -m pip install scipy-openblas32 wheel

- name: Get required Python packages
run: |
Expand Down
16 changes: 14 additions & 2 deletions .github/workflows/tests_windows_cpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -124,13 +124,19 @@ jobs:

- name: Install dependencies
run: |
python -m pip install cmake build ninja scipy
python -m pip install cmake build ninja scipy-openblas32

- name: Setup OpenCppCoverage and add to PATH
run: |
choco install OpenCppCoverage -y
echo "C:\Program Files\OpenCppCoverage" >> $env:GITHUB_PATH

- name: Add path to scipy-openblas32 to environment variable
run: |
$scipy_openblas32_path = python -c "import scipy_openblas32; import os; path=scipy_openblas32.get_lib_dir(); print(path)"
echo "SCIPY_OPENBLAS32=${scipy_openblas32_path}" | Out-File -Append -FilePath $env:GITHUB_ENV
Get-Content $env:GITHUB_ENV

- name: Build and run unit tests for code coverage
run: |
cmake -BBuild `
Expand Down Expand Up @@ -202,7 +208,7 @@ jobs:

- name: Install dependencies
run: |
python -m pip install cmake build ninja
python -m pip install cmake build ninja scipy-openblas32

- name: Checkout PennyLane-Lightning
uses: actions/checkout@v4
Expand All @@ -221,6 +227,12 @@ jobs:
run: |
choco install OpenCppCoverage -y
echo "C:\Program Files\OpenCppCoverage" >> $env:GITHUB_PATH

- name: Add path to scipy-openblas32 to environment variable
run: |
$scipy_openblas32_path = python -c "import scipy_openblas32; import os; path=scipy_openblas32.get_lib_dir(); print(path)"
echo "SCIPY_OPENBLAS32=${scipy_openblas32_path}" | Out-File -Append -FilePath $env:GITHUB_ENV
Get-Content $env:GITHUB_ENV

- name: Build and run unit tests for code coverage
run: |
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/tidy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ jobs:
-DCLANG_TIDY_BINARY=$(dirname $(which python))/clang-tidy \
-DBUILD_TESTS=ON \
-DENABLE_WARNINGS=ON \
-DSCIPY_OPENBLAS=$(python -c "import scipy_openblas32; import os; print(os.path.dirname(scipy_openblas32.get_lib_dir()))") \
-DPL_BACKEND=${{ matrix.pl_backend }} \
-DCMAKE_CXX_COMPILER="$(which g++-11)" \
-DCMAKE_C_COMPILER="$(which gcc-11)"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/wheel_linux_x86_64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ jobs:
# Python build settings
CIBW_BEFORE_BUILD: |
cat /etc/dnf.conf | sed "s/\[main\]/\[main\]\ntimeout=5/g" > /etc/dnf.conf
python -m pip install ninja cmake~=3.27.0 scipy
python -m pip install ninja cmake~=3.27.0
dnf clean all -y
dnf install gcc-toolset-13 -y
source /opt/rh/gcc-toolset-13/enable -y
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/wheel_macos_arm64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ jobs:

# Python build settings
CIBW_BEFORE_BUILD: |
python -m pip install pybind11 ninja cmake~=3.27.0 setuptools scipy
python -m pip install pybind11 ninja cmake~=3.27.0 setuptools

CIBW_ENVIRONMENT: |
CMAKE_ARGS="-DCMAKE_CXX_COMPILER_TARGET=arm64-apple-macos11 -DCMAKE_SYSTEM_NAME=Darwin -DCMAKE_SYSTEM_PROCESSOR=ARM64 -DENABLE_OPENMP=OFF -DCMAKE_BUILD_TYPE=Release"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/wheel_macos_x86_64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ jobs:

# Python build settings
CIBW_BEFORE_BUILD: |
python -m pip install pybind11 ninja cmake~=3.27.0 setuptools scipy
python -m pip install pybind11 ninja cmake~=3.27.0 setuptools

CIBW_ENVIRONMENT: |
CMAKE_ARGS="-DCMAKE_BUILD_TYPE=Release"
Expand Down
49 changes: 21 additions & 28 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,6 @@ 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" OFF)

# OpenMP
find_package(OpenMP)
if (OpenMP_CXX_FOUND)
Expand Down Expand Up @@ -88,29 +86,6 @@ set(CMAKE_POLICY_DEFAULT_CMP0127 NEW) # To suppress pybind11 CMP0127 warning
# Add pybind11
include(FetchContent)

if(ENABLE_LAPACK)
find_package(Python COMPONENTS Interpreter Development)
set(SCIPYLIBS ${Python_SITELIB})

if(CMAKE_SYSTEM_NAME MATCHES "Darwin")
set(SCIPYLIBS "/System/Library/Frameworks/Accelerate.framework/Versions/Current/Frameworks/vecLib.framework/libLAPACK.dylib")
elseif(CMAKE_SYSTEM_NAME MATCHES "Linux")
if(EXISTS ${SCIPYLIBS}/scipy.libs)
set(SCIPYLIBS ${SCIPYLIBS}/scipy.libs)
else()
# Fallback to the lib path of Python for `conda` support
set(SCIPYLIBS ${SCIPYLIBS}/../..)
endif()
elseif(CMAKE_SYSTEM_NAME MATCHES "Windows")
else()
message(FATAL_ERROR "Unsupported platform: ${CMAKE_SYSTEM_NAME}")
endif()

add_compile_definitions(SCIPY_LIBS_PATH="${SCIPYLIBS}")

message(STATUS "Python scipy-lib path: ${SCIPYLIBS}")
endif()

if(ENABLE_PYTHON)
find_package(Python COMPONENTS Interpreter Development)
FetchContent_Declare(pybind11
Expand All @@ -123,6 +98,21 @@ endif()
# Print Python site-packages directory for reference
message("Python site-packages directory: ${Python_SITELIB}")

if(NOT DEFINED PY_INSTALL)
include("${CMAKE_CURRENT_SOURCE_DIR}/cmake/FindSCIPY_OPENBLAS32.cmake")
if(NOT DEFINED SCIPY_OPENBLAS32_LIB_PATH AND NOT EXISTS ${SCIPY_OPENBLAS32_LIB_PATH})
set(SCIPY_OPENBLAS32_LIB_PATH "")
find_path_to_openblas(SCIPY_OPENBLAS32_LIB_PATH)
add_compile_definitions(SCIPY_OPENBLAS32_LIB="${SCIPY_OPENBLAS32_LIB_PATH}")
message(STATUS "SCIPY_OPENBLAS32_LIB_PATH: ${SCIPY_OPENBLAS32_LIB_PATH}")
multiphaseCFD marked this conversation as resolved.
Show resolved Hide resolved
else()
add_compile_definitions(SCIPY_OPENBLAS32_LIB="${SCIPY_OPENBLAS32_LIB_PATH}")
endif()
set(SCIPY_OPENBLAS32_RUNTIME_LIB_PATH "${SCIPY_OPENBLAS32_LIB_PATH}")
else()
set(SCIPY_OPENBLAS32_RUNTIME_LIB_PATH "$ORIGIN/../scipy_openblas32/lib")
endif()

set (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})

# All CMakeLists.txt in subdirectories use pennylane_lightning_compile_options and pennylane_lightning_external_libs
Expand Down Expand Up @@ -154,10 +144,13 @@ if(ENABLE_PYTHON)
message(STATUS "ENABLE_PYTHON is ON.")
pybind11_add_module("${PL_BACKEND}_ops" "pennylane_lightning/core/src/bindings/Bindings.cpp")

# Allow pip installation of cuQuantum & CUDA 12 libs to be accessible without setting LD_LIBRARY_PATH for lightning_gpu
set(CMAKE_BUILD_RPATH_USE_ORIGIN ON)
if("${PL_BACKEND}" STREQUAL "lightning_gpu" OR "${PL_BACKEND}" STREQUAL "lightning_tensor")
set(CMAKE_BUILD_RPATH_USE_ORIGIN ON)
set_target_properties("${PL_BACKEND}_ops" PROPERTIES BUILD_RPATH "$ORIGIN/../cuquantum/lib:$ORIGIN/../nvidia/cuda_runtime/lib:$ORIGIN/../nvidia/cublas/lib:$ORIGIN/../nvidia/cusparse/lib:$ORIGIN")
# Allow pip installation of cuQuantum & CUDA 12 libs to be accessible without setting LD_LIBRARY_PATH for lightning_gpu
# BUILD_RPATH only works for the last call
set_target_properties("${PL_BACKEND}_ops" PROPERTIES BUILD_RPATH "$ORIGIN/../cuquantum/lib:$ORIGIN/../nvidia/cuda_runtime/lib:$ORIGIN/../nvidia/cublas/lib:$ORIGIN/../nvidia/cusparse/lib:${SCIPY_OPENBLAS32_RUNTIME_LIB_PATH}:$ORIGIN")
else()
set_target_properties("${PL_BACKEND}_ops" PROPERTIES BUILD_RPATH "${SCIPY_OPENBLAS32_RUNTIME_LIB_PATH}")
endif()

target_link_libraries("${PL_BACKEND}_ops" PRIVATE lightning_compile_options
Expand Down
Loading
Loading