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 L-GPU and L-Kokkos as package extras #515

Merged
merged 11 commits into from
Oct 13, 2023
22 changes: 20 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -190,9 +190,27 @@ Note that OpenMP and BLAS are disabled in this setting.
Lightning Kokkos installation
=============================

For linux systems, `lightning.kokkos` and be readily installed with an OpenMP backend by providing the optional ``[kokkos]`` tag:

.. code-block:: console

$ pip install pennylane-lightning[kokkos]

This can be explicitly installed through PyPI as:

.. code-block:: console

$ pip install pennylane-lightning-kokkos]
mlxd marked this conversation as resolved.
Show resolved Hide resolved


Building from source
--------------------

As Kokkos enables support for many different HPC-targetted hardware platforms, `lightning.kokkos` can be built to support any of these platforms when building from source.

We suggest first installing Kokkos with the wanted configuration following the instructions found in the `Kokkos documentation <https://kokkos.github.io/kokkos-core-wiki/building.html>`_.
Next, append the install location to ``CMAKE_PREFIX_PATH``.
If an installation is not found, our builder will install it from scratch nevertheless.
If an installation is not found, our builder will clone and install it during the build process.

The simplest way to install PennyLane-Lightning-Kokkos (OpenMP backend) is using ``pip``.

Expand Down Expand Up @@ -221,7 +239,7 @@ To build the plugin directly with CMake:
cmake -B build -DKokkos_ENABLE_OPENMP=ON -DPLKOKKOS_BUILD_TESTS=ON -DPL_BACKEND=lightning_kokkos -G Ninja
cmake --build build

Supported backend options are "SERIAL", "OPENMP", "THREADS", "HIP" and "CUDA" and the corresponding build options are ``-DKokkos_ENABLE_XXX=ON``, where ``XXX`` needs be replaced by the backend name, for instance ``OPENMP``.
The supported backend options are "SERIAL", "OPENMP", "THREADS", "HIP" and "CUDA" and the corresponding build options are ``-DKokkos_ENABLE_XXX=ON``, where ``XXX`` needs be replaced by the backend name, for instance ``OPENMP``.
One can activate simultaneously one serial, one parallel CPU host (e.g. "OPENMP", "THREADS") and one parallel GPU device backend (e.g. "HIP", "CUDA"), but not two of any category at the same time.
For "HIP" and "CUDA", the appropriate software stacks are required to enable compilation and subsequent use.
Similarly, the CMake option ``-DKokkos_ARCH_{...}=ON`` must also be specified to target a given architecture.
Expand Down
Loading