Skip to content

Commit

Permalink
Remove Lightning Kokkos plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
rauletorresc committed Jul 30, 2024
1 parent c9ced7d commit 6d9457d
Show file tree
Hide file tree
Showing 16 changed files with 7 additions and 910 deletions.
3 changes: 0 additions & 3 deletions .github/workflows/build-wheel-linux-x86_64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -310,11 +310,8 @@ jobs:
-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=$GITHUB_WORKSPACE/runtime-build/lib \
-DPYTHON_EXECUTABLE=$(which python${{ matrix.python_version }}) \
-Dpybind11_DIR=$(python${{ matrix.python_version }} -c "import pybind11; print(pybind11.get_cmake_dir())") \
-DENABLE_LIGHTNING_KOKKOS=ON \
-DENABLE_LAPACK=OFF \
-DLIGHTNING_GIT_TAG=latest_release \
-DKokkos_ENABLE_SERIAL=ON \
-DKokkos_ENABLE_OPENMP=ON \
-DENABLE_WARNINGS=OFF \
-DENABLE_OPENQASM=ON \
-DENABLE_OPENMP=OFF \
Expand Down
4 changes: 0 additions & 4 deletions .github/workflows/build-wheel-macos-arm64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -289,12 +289,8 @@ jobs:
-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=$GITHUB_WORKSPACE/runtime-build/lib \
-DPYTHON_EXECUTABLE=$(which python${{ matrix.python_version }}) \
-Dpybind11_DIR=$(python${{ matrix.python_version }} -c "import pybind11; print(pybind11.get_cmake_dir())") \
-DENABLE_LIGHTNING_KOKKOS=ON \
-DLIGHTNING_GIT_TAG=latest_release \
-DENABLE_LAPACK=OFF \
-DKokkos_ENABLE_SERIAL=ON \
-DKokkos_ENABLE_OPENMP=ON \
-DKokkos_ENABLE_COMPLEX_ALIGN=OFF \
-DENABLE_WARNINGS=OFF \
-DENABLE_OPENQASM=ON \
-DENABLE_OPENMP=OFF \
Expand Down
5 changes: 0 additions & 5 deletions .github/workflows/build-wheel-macos-x86_64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -263,12 +263,7 @@ jobs:
-DPYTHON_EXECUTABLE=$(which python${{ matrix.python_version }}) \
-Dpybind11_DIR=$(python${{ matrix.python_version }} -c "import pybind11; print(pybind11.get_cmake_dir())") \
-DLIGHTNING_GIT_TAG=latest_release \
-DENABLE_LIGHTNING_KOKKOS=ON \
-DENABLE_LAPACK=OFF \
-DKokkos_ENABLE_SERIAL=ON \
-DKokkos_ENABLE_OPENMP=OFF \
-DKokkos_ENABLE_COMPLEX_ALIGN=OFF \
-DKokkos_ENABLE_DEPRECATION_WARNINGS=OFF \
-DENABLE_WARNINGS=OFF \
-DENABLE_OPENQASM=ON \
-DENABLE_OPENMP=OFF \
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/check-catalyst.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -618,7 +618,6 @@ jobs:
C_COMPILER=$(which ${{ needs.constants.outputs[format('c_compiler.{0}', matrix.compiler)] }}) \
CXX_COMPILER=$(which ${{ needs.constants.outputs[format('cxx_compiler.{0}', matrix.compiler)] }}) \
COMPILER_LAUNCHER="" \
ENABLE_LIGHTNING_KOKKOS=OFF \
ENABLE_OPENQASM=OFF \
ENABLE_ASAN=ON \
make test-runtime
Expand All @@ -640,7 +639,6 @@ jobs:
C_COMPILER=$(which ${{ needs.constants.outputs[format('c_compiler.{0}', matrix.compiler)] }}) \
CXX_COMPILER=$(which ${{ needs.constants.outputs[format('cxx_compiler.{0}', matrix.compiler)] }}) \
COMPILER_LAUNCHER="" \
ENABLE_LIGHTNING_KOKKOS=OFF \
ENABLE_ASAN=ON \
make test-runtime
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/check-pl-compat.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,6 @@ jobs:
CXX_COMPILER=$(which g++ }}) \
RT_BUILD_DIR="$(pwd)/runtime-build" \
LIGHTNING_GIT_TAG_VALUE=latest_release \
ENABLE_LIGHTNING_KOKKOS=ON \
ENABLE_OPENQASM=ON \
make runtime
Expand All @@ -137,7 +136,6 @@ jobs:
CXX_COMPILER=$(which g++ }}) \
RT_BUILD_DIR="$(pwd)/runtime-build" \
LIGHTNING_GIT_TAG_VALUE=v0.37.0_rc \
ENABLE_LIGHTNING_KOKKOS=ON \
ENABLE_OPENQASM=ON \
make runtime
Expand Down
4 changes: 0 additions & 4 deletions .github/workflows/scripts/linux_arm64/rh8/build_catalyst.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,8 @@ cmake -S runtime -B runtime-build -G Ninja \
-DPYTHON_INCLUDE_DIR=/opt/_internal/cpython-${PYTHON_VERSION}.${PYTHON_SUBVERSION}/include/python${PYTHON_VERSION} \
-DPYTHON_LIBRARY=/opt/_internal/cpython-${PYTHON_VERSION}.${PYTHON_SUBVERSION}/lib \
-Dpybind11_DIR=/opt/_internal/cpython-${PYTHON_VERSION}.${PYTHON_SUBVERSION}/lib/python${PYTHON_VERSION}/site-packages/pybind11/share/cmake/pybind11 \
-DENABLE_LIGHTNING_KOKKOS=ON \
-DLIGHTNING_GIT_TAG=latest_release \
-DENABLE_LAPACK=OFF \
-DKokkos_ENABLE_SERIAL=ON \
-DKokkos_ENABLE_OPENMP=ON \
-DKokkos_ENABLE_COMPLEX_ALIGN=OFF \
-DENABLE_WARNINGS=OFF \
-DENABLE_OPENQASM=ON \
-DENABLE_OPENMP=OFF \
Expand Down
2 changes: 1 addition & 1 deletion doc/dev/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ them, but using the ``test-runtime`` target instead:

.. code-block:: console
make test-runtime ENABLE_LIGHTNING_KOKKOS=ON ENABLE_OPENQASM=ON
make test-runtime ENABLE_OPENQASM=ON
.. note::

Expand Down
11 changes: 2 additions & 9 deletions runtime/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ option(ENABLE_ADDRESS_SANITIZER "Enable address sanitizer" OFF)
option(RUNTIME_CLANG_TIDY "Enable Clang Tidy" OFF)

option(ENABLE_LIGHTNING "Build Lightning backend device" ON)
option(ENABLE_LIGHTNING_KOKKOS "Build Lightning-Kokkos backend device" OFF)
option(ENABLE_OPENQASM "Build OpenQasm backend device" OFF)

set(CMAKE_VERBOSE_MAKEFILE ON)
Expand Down Expand Up @@ -79,20 +78,14 @@ if(RUNTIME_ENABLE_WARNINGS)
endif()

message(STATUS "ENABLE_LIGHTNING is ${ENABLE_LIGHTNING}.")
message(STATUS "ENABLE_LIGHTNING_KOKKOS is ${ENABLE_LIGHTNING_KOKKOS}.")
message(STATUS "ENABLE_OPENQASM is ${ENABLE_OPENQASM}.")

set(devices_list)
list(APPEND devices_list rtd_dummy)

if(ENABLE_LIGHTNING OR ENABLE_LIGHTNING_KOKKOS)
if(ENABLE_LIGHTNING)
list(APPEND devices_list pennylane_lightning rtd_lightning)
if(ENABLE_LIGHTNING)
list(APPEND backend_includes "${PROJECT_SOURCE_DIR}/lib/backend/lightning/lightning_dynamic")
endif()
if(ENABLE_LIGHTNING_KOKKOS)
list(APPEND backend_includes "${PROJECT_SOURCE_DIR}/lib/backend/lightning/lightning_kokkos")
endif()
list(APPEND backend_includes "${PROJECT_SOURCE_DIR}/lib/backend/lightning/lightning_dynamic")
endif()

if(ENABLE_OPENQASM)
Expand Down
6 changes: 0 additions & 6 deletions runtime/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@ TEST_TARGETS := ""
ifeq ($(ENABLE_LIGHTNING), ON)
BUILD_TARGETS += rtd_lightning
TEST_TARGETS += runner_tests_lightning
else ifeq ($(ENABLE_LIGHTNING_KOKKOS), ON)
BUILD_TARGETS += rtd_lightning
TEST_TARGETS += runner_tests_lightning
endif

ifeq ($(ENABLE_OPENQASM), ON)
Expand All @@ -34,7 +31,6 @@ ifeq ($(ENABLE_OPENQASM), ON)
endif

LIGHTNING_ENABLE_OPENMP?=OFF
KOKKOS_ENABLE_OPENMP?=ON

coverage: CODE_COVERAGE=ON
coverage: BUILD_TYPE=Debug
Expand Down Expand Up @@ -75,10 +71,8 @@ configure:
-DCMAKE_C_COMPILER_LAUNCHER=$(COMPILER_LAUNCHER) \
-DCMAKE_CXX_COMPILER_LAUNCHER=$(COMPILER_LAUNCHER) \
-DENABLE_LIGHTNING=$(ENABLE_LIGHTNING) \
-DENABLE_LIGHTNING_KOKKOS=$(ENABLE_LIGHTNING_KOKKOS) \
-DENABLE_OPENQASM=$(ENABLE_OPENQASM) \
-DENABLE_OPENMP=$(LIGHTNING_ENABLE_OPENMP) \
-DKokkos_ENABLE_OPENMP=$(KOKKOS_ENABLE_OPENMP) \
-DENABLE_CODE_COVERAGE=$(CODE_COVERAGE) \
-DRUNTIME_ENABLE_WARNINGS=$(ENABLE_WARNINGS) \
-DENABLE_WARNINGS=OFF \
Expand Down
17 changes: 1 addition & 16 deletions runtime/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -98,23 +98,8 @@ Installation

By default, the runtime builds all supported backend devices.
You can build the runtime with custom devices from the list of Backend Devices.
You can use ``ENABLE_LIGHTNING_KOKKOS=OFF`` to disable building the runtime with
`lightning.kokkos <https://docs.pennylane.ai/projects/lightning/en/stable/lightning_kokkos/device.html>`_:

.. code-block:: console
make runtime ENABLE_LIGHTNING_KOKKOS=OFF
Lightning-Kokkos provides support for other Kokkos backends including OpenMP, HIP and CUDA.
Please refer to `the installation guideline <https://docs.pennylane.ai/projects/lightning/en/stable/lightning_kokkos/installation.html>`_ for the requirements.
You can further use the ``CMAKE_ARGS`` flag to issue any additional compiler arguments or override the preset ones in the make commands.
To build the runtime with the ``Kokkos::OpenMP`` backend execution space:

.. code-block:: console
make runtime CMAKE_ARGS="-DKokkos_ENABLE_OPENMP=ON"
You can also use ``ENABLE_OPENQASM=OFF`` to disable building the runtime with `Amazon-Braket-OpenQasm <https://aws.amazon.com/braket/>`_:
You can use ``ENABLE_OPENQASM=OFF`` to disable building the runtime with `Amazon-Braket-OpenQasm <https://aws.amazon.com/braket/>`_:

.. code-block:: console
Expand Down
2 changes: 1 addition & 1 deletion runtime/lib/backend/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
add_subdirectory(dummy)
configure_file(dummy/dummy_device.toml dummy_device.toml)
if(ENABLE_LIGHTNING OR ENABLE_LIGHTNING_KOKKOS)
if(ENABLE_LIGHTNING)
add_subdirectory(lightning)
endif()
if(ENABLE_OPENQASM)
Expand Down
11 changes: 1 addition & 10 deletions runtime/lib/backend/lightning/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,8 @@ else()
endif()
set(CMAKE_POSITION_INDEPENDENT_CODE ON) # build with -fPIC

if(ENABLE_LIGHTNING AND ENABLE_LIGHTNING_KOKKOS)
set(PL_BACKEND "lightning_qubit;lightning_kokkos" CACHE STRING "PennyLane Lightning backend")
elseif(ENABLE_LIGHTNING)
if(ENABLE_LIGHTNING)
set(PL_BACKEND "lightning_qubit" CACHE STRING "PennyLane Lightning backend")
elseif(ENABLE_LIGHTNING_KOKKOS)
set(PL_BACKEND "lightning_kokkos" CACHE STRING "PennyLane Lightning backend")
endif()
set(ENABLE_PYTHON OFF CACHE BOOL "Enable compilation of the Python module")

Expand All @@ -65,11 +61,6 @@ if(ENABLE_LIGHTNING)
lightning_dynamic/LightningSimulator.cpp
)
endif()
if(ENABLE_LIGHTNING_KOKKOS)
list(APPEND src_files
lightning_kokkos/LightningKokkosSimulator.cpp
)
endif()

add_library(rtd_lightning SHARED ${src_files})
add_dependencies(rtd_lightning pennylane_lightning)
Expand Down
Loading

0 comments on commit 6d9457d

Please sign in to comment.