PennyLane-Lightning-Kokkos plugin
Project description
The PennyLane-Lightning-Kokkos plugin extends the Pennylane-Lightning state-vector simulator written in C++, and offloads to the Kokkos library for accelerated circuit simulation.
PennyLane is a cross-platform Python library for quantum machine learning, automatic differentiation, and optimization of hybrid quantum-classical computations.
Installation
cmake -Bbuild -DKokkos_ENABLE_OPENMP=On -DPLKOKKOS_BUILD_TESTS=On -G Ninja
cmake --build ./build
You can install the python interface with:
python setup.py build_ext --backend="OPENMP"
python setup.py bdist_wheel
pip install ./dist/PennyLane*.whl --force-reinstall
or for an editable pip installation with:
BACKEND="OPENMP" python -m pip install -e .
Supported backend options are “SERIAL”, “OPENMP”, “THREADS”, “HIP” and “CUDA”. For “HIP” and “CUDA”, the appropriate software stacks are required to enable compilation and subsequent use. For explicit targeting of a given supported architecture, the environment variable ARCH can also be specified which directly sets the -DKokkos_ARCH_{…}=ON build option. Note that “THREADS” backend is not recommended since Kokkos does not guarantee its safety.
Testing
To test with the ROCm stack using a manylinux2014 container we must first mount the repository into the container:
docker run -v `pwd`:/io -it quay.io/pypa/manylinux2014_x86_64 bash
Next, within the container, we install the ROCm software stack:
yum install -y https://repo.radeon.com/amdgpu-install/21.40.2/rhel/7.9/amdgpu-install-21.40.2.40502-1.el7.noarch.rpm
amdgpu-install --usecase=hiplibsdk,rocm --no-dkms
We next build the test-suite, with a given AMD GPU target in mind, as listed here.
cd /io
export PATH=$PATH:/opt/rocm/bin/
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/rocm/lib
export CXX=/opt/rocm/hip/bin/hipcc
cmake -Bbuild -DCMAKE_CXX_COMPILER=/opt/rocm/hip/bin/hipcc -DKokkos_ENABLE_HIP=on -DPLKOKKOS_BUILD_TESTS=On -DKokkos_ARCH_VEGA90A=ON
cmake --build ./build --verbose
We may now leave the container, and run the built test-suite on a machine with access to the targetted GPU.
For a system with access to the ROCm stack outside of a manylinux container, an editable pip installation can be built and installed as:
BACKEND="HIP" ARCH="VEGA90A" python -m pip install -e .
Support
Source Code: https://github.com/PennyLaneAI/pennylane-lightning-kokkos
Issue Tracker: https://github.com/PennyLaneAI/pennylane-lightning-kokkos/issues
PennyLane Forum: https://discuss.pennylane.ai
If you are having issues, please let us know by posting the issue on our Github issue tracker, or by asking a question in the forum.
License
The PennyLane-Lightning-Kokkos plugin is free and open source, released under the Apache License, Version 2.0. The PennyLane-Lightning-Kokkos plugin makes use of the Kokkos library, which is held to their own respective licenses.
Acknowledgements
The PennyLane Lightning Kokkos plugin makes use of the following libraries and tools, which are under their own respective licenses:
pybind11: https://github.com/pybind/pybind11
Kokkos Core: https://github.com/kokkos/kokkos
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Hashes for PennyLane-Lightning-Kokkos-0.30.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2f995cfa21156e78b4efcfda45649d921a9864eb4942fae5ea3a845fe76f5b9c |
|
MD5 | 0fab1868c2f91c92f5c25e1e2997fc31 |
|
BLAKE2b-256 | f04c7ae0b66a3c18ffc647c5c9b3e347e649f64b5439b2b27cb9f4b8548c2a81 |
Hashes for PennyLane_Lightning_Kokkos-0.30.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b5afa380bd8b7c2bf6d255fc61a8400166e6861927abf6d54c6ec5d39c0211f0 |
|
MD5 | bbcda29469ba7c450c396f2426b92e8f |
|
BLAKE2b-256 | 92d4cfca9034d8ea5e45c86dd899829ab64d94f750f3a6a7f611d216bac0d8f6 |
Hashes for PennyLane_Lightning_Kokkos-0.30.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5ee0184aefc6b89d0b4cb8c3ccddabca68f424ff475b9b970e37835b5e1807e6 |
|
MD5 | f26d8736bb2eb9fd094d260a073c5884 |
|
BLAKE2b-256 | 08bcbc47976cba8ca114bf4eafd0f4187589c769f5cf7c416592f855719cc8a0 |
Hashes for PennyLane_Lightning_Kokkos-0.30.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ec41d938678388d48562efe6718af4a758af54456c21a797dc3c5db0f37a78c9 |
|
MD5 | 680b2dc8fe11d0313238fb2e72982d7f |
|
BLAKE2b-256 | 8780b26aeb3ee1ec7937b4883ec4b3c4032f2c6aee93614a9a72a312e594b749 |
Hashes for PennyLane_Lightning_Kokkos-0.30.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d4e3f4c6e6298bdfcd11218f7681151f884c248db7a6dcc36bb4da1c9012a00e |
|
MD5 | 4d44c5c844858908b040f62c40393b31 |
|
BLAKE2b-256 | 2d5fc1d1aaf22a0fa2cd63bbfca1138e9ef8d17883499304c3edf58136dcbc8c |