Skip to content

Enable Kokkos Kernels with explicit host and GPU dependencies #600

Description

@aaadelmann

Summary

Enable optional Kokkos Kernels support in IPPL and add a linear-map eigenanalysis unit test inspired by OPALX's unit_tests/Algorithms/TestLinearMapEigenAnalysis.cpp.

Dependency requirements

Kokkos does not automatically install Kokkos Kernels or external numerical libraries.

In Kokkos Kernels 5.2.0, SerialEigendecomposition requires host LAPACKE or MKL. Its native/device implementation is unfinished. CUDA and HIP builds therefore still need a host provider for this eigenanalysis.

Dependencies by platform:

  • Serial/OpenMP: host LAPACKE with LAPACK/BLAS, or MKL. Including MAC Os
  • CUDA: the same host dependency, plus cuBLAS and cuSOLVER for supported GPU operations.
  • HIP: the same host dependency, plus rocBLAS and rocSOLVER for supported GPU operations.

Enabling GPU libraries does not move this eigenanalysis onto the GPU.

CMake tasks

  • Add an IPPL_ENABLE_KOKKOS_KERNELS option.
  • Default IPPL_ENABLE_KOKKOS_KERNELS is enabled
  • Support installed and FetchContent-built Kokkos Kernels, using a compatible version and the same Kokkos instance as IPPL.
  • Configure host LAPACKE or MKL independently of the GPU backend.
  • Select the appropriate CUDA/HIP libraries for supported GPU operations.
  • Keep installation paths in site presets or toolchain files.
  • Verify matching host headers, libraries, and LP64/ILP64 integer interfaces.
  • Validate required eigenanalysis support with a compile-and-link probe.
  • Report a clear configuration error when eigenanalysis is requested but unavailable.
  • Propagate dependencies through CMake targets and IPPL's exported package.
  • Document dependency installation, configuration options, and the host-only eigenanalysis limitation.

Configuration options cannot change the capabilities of an already installed Kokkos Kernels package. Validate the selected package rather than assuming it provides the requested backend.

Unit test

Use small 4x4 maps with analytically known spectra, inspired by the OPALX tests.

  • Stable rotations and conjugate eigenvalue pairs.
  • Coupled stable modes.
  • Real and complex instabilities.
  • Near-integer and neutral modes.
  • Eigenvector residuals against the original matrix.

Run eigenanalysis on host memory, with explicit device-to-host transfer when needed. Check numerical results rather than relying solely on the upstream wrapper's return status.

Acceptance criteria

  • Builds with Kokkos Kernels disabled remain functional.
  • Enabled builds and relevant tests pass for Serial/OpenMP, CUDA, and HIP where available.
  • Single-rank and multi-rank test runs pass.
  • Installed and build-tree IPPL consumers receive the required dependencies.
  • Numerical tolerances are justified.
  • Unavailable validation platforms and remaining limitations are recorded.

Reference

Kokkos Kernels 5.2.0 eigenanalysis implementation:
https://github.com/kokkos/kokkos-kernels/blob/5.2.0/batched/dense/impl/KokkosBatched_Eigendecomposition_Serial_Internal.hpp

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions