kokkos-fft

kokkos-fft: A shared-memory FFT for the Kokkos ecosystem - Published in JOSS (2025)

https://github.com/kokkos/kokkos-fft

Science Score: 95.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 4 DOI reference(s) in README and JOSS metadata
  • Academic publication links
    Links to: joss.theoj.org
  • Committers with academic emails
    3 of 11 committers (27.3%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
    Published in Journal of Open Source Software

Keywords

fft fft-library kokkos

Keywords from Contributors

turing-machine standardization pde mesh parallel interpretability evolutionary-algorithms ode pypi simulations

Scientific Fields

Earth and Environmental Sciences Physical Sciences - 36% confidence
Last synced: 4 months ago · JSON representation

Repository

A shared-memory FFT for the Kokkos ecosystem

Basic Info
Statistics
  • Stars: 43
  • Watchers: 10
  • Forks: 9
  • Open Issues: 20
  • Releases: 5
Topics
fft fft-library kokkos
Created about 2 years ago · Last pushed 4 months ago
Metadata Files
Readme Changelog License Authors Copyright

README.md

kokkos-fft

CI Nightly builds docs DOI

[!WARNING] EXPERIMENTAL FFT interfaces for Kokkos C++ Performance Portability Programming EcoSystem

kokkos-fft implements local interfaces between Kokkos and de facto standard FFT libraries, including FFTW, cufft, hipfft (rocfft), and oneMKL. "Local" means not using MPI, or running within a single MPI process without knowing about MPI. We are inclined to implement the numpy.fft-like interfaces adapted for Kokkos. A key concept is that "As easy as numpy, as fast as vendor libraries". Accordingly, our API follows the API by numpy.fft with minor differences. A fft library dedicated to Kokkos Device backend (e.g. cufft for CUDA backend) is automatically used. If something is wrong with runtime values (say View extents), it will raise runtime errors (C++ std::runtime_error). See documentations for more information.

Here is an example for 1D real to complex transform with rfft in kokkos-fft. ```C++

include

include

include

include

using executionspace = Kokkos::DefaultExecutionSpace; template using View1D = Kokkos::View<T*, executionspace>; constexpr int n = 4;

View1D x("x", n); View1DKokkos::complex<double > xhat("xhat", n/2+1);

Kokkos::RandomXorShift64Pool<> randompool(12345); Kokkos::fillrandom(x, random_pool, 1); Kokkos::fence();

KokkosFFT::rfft(executionspace(), x, xhat); ```

This is equivalent to the following python code.

python3 import numpy as np x = np.random.rand(4) x_hat = np.fft.rfft(x)

There are two major differences: execution_space argument and output value (x_hat) is an argument of API (not returned value from API). As imagined, kokkos-fft only accepts Kokkos Views as input data. The accessibilities of Views from execution_space are statically checked (compilation errors if not accessible).

Depending on a View dimension, it automatically uses the batched plans as follows ```C++

include

include

include

include

using executionspace = Kokkos::DefaultExecutionSpace; template using View2D = Kokkos::View<T**, executionspace>; constexpr int n0 = 4, n1 = 8;

View2D x("x", n0, n1); View2DKokkos::complex<double > xhat("xhat", n0, n1/2+1);

Kokkos::RandomXorShift64Pool<> randompool(12345); Kokkos::fillrandom(x, random_pool, 1); Kokkos::fence();

// FFT along -1 axis and batched along 0th axis int axis = -1; KokkosFFT::rfft(executionspace(), x, xhat, KokkosFFT::Normalization::backward, axis); ```

This is equivalent to

python3 import numpy as np x = np.random.rand(4, 8) x_hat = np.fft.rfft(x, axis=-1)

In this example, the 1D batched rfft over 2D View along axis -1 is executed. Some basic examples are found in examples.

Using kokkos-fft

For the moment, there are two ways to use kokkos-fft: including as a subdirectory in CMake project or installing as a library. First of all, you need to clone this repo. bash git clone --recursive https://github.com/kokkos/kokkos-fft.git

Prerequisites

To use kokkos-fft, we need the following: * CMake 3.22+ * Kokkos 4.5+ * gcc 8.3.0+ (CPUs) * IntelLLVM 2023.0.0+ (CPUs, Intel GPUs) * nvcc 11.0.0+ (NVIDIA GPUs) * rocm 5.3.0+ (AMD GPUs)

CMake

Since kokkos-fft is a header-only library, it is enough to simply add as a subdirectory. It is assumed that kokkos and kokkos-fft are placed under <project_directory>/tpls.

Here is an example to use kokkos-fft in the following CMake project. ---/ | └──<project_directory>/ |--tpls | |--kokkos/ | └──kokkos-fft/ |--CMakeLists.txt └──hello.cpp

The CMakeLists.txt would be ```CMake cmakeminimumrequired(VERSION 3.23) project(kokkos-fft-as-subdirectory LANGUAGES CXX)

addsubdirectory(tpls/kokkos) addsubdirectory(tpls/kokkos-fft)

addexecutable(hello-kokkos-fft hello.cpp) targetlink_libraries(hello-kokkos-fft PUBLIC Kokkos::kokkos KokkosFFT::fft) ```

For compilation, we basically rely on the CMake options for Kokkos. For example, the compile options for A100 GPU is as follows. cmake -B build \ -DCMAKE_CXX_COMPILER=g++ \ -DCMAKE_BUILD_TYPE=Release \ -DKokkos_ENABLE_CUDA=ON \ -DKokkos_ARCH_AMPERE80=ON cmake --build build -j 8 This way, all the functionalities are executed on A100 GPUs. For installation, details are provided in the documentation.

Support

Find us on Slack channel or open a GitHub issue.

Contributing

Please see this page for details on how to contribute.

Citing kokkos-fft

Please see this page.

LICENSE

License License: MIT

kokkos-fft is mainly distributed under either the MIT license, or at your option, the Apache-2.0 license with LLVM exception. More strictly, FindFFTW.cmake file is provided under BSD-3-Clause license and reuse.yml file is provided under CC0-1.0 license. Licenses are automatically confirmed with REUSE compliance check in CI (see this page for detail).

Owner

  • Name: Kokkos
  • Login: kokkos
  • Kind: organization
  • Email: crtrott@sandia.gov

Kokkos C++ Performance Portability Programming Ecosystem

JOSS Publication

kokkos-fft: A shared-memory FFT for the Kokkos ecosystem
Published
July 30, 2025
Volume 10, Issue 111, Page 8391
Authors
Yuuichi Asahi ORCID
Université Paris-Saclay, UVSQ, CNRS, CEA, Maison de la Simulation, 91191, Gif-sur-Yvette, France
Thomas Padioleau ORCID
Université Paris-Saclay, UVSQ, CNRS, CEA, Maison de la Simulation, 91191, Gif-sur-Yvette, France
Paul Zehner ORCID
Université Paris-Saclay, UVSQ, CNRS, CEA, Maison de la Simulation, 91191, Gif-sur-Yvette, France
Julien Bigot ORCID
Université Paris-Saclay, UVSQ, CNRS, CEA, Maison de la Simulation, 91191, Gif-sur-Yvette, France
Damien Lebrun-Grandie ORCID
Oak Ridge National Laboratory, Oak Ridge, Tennessee, US
Editor
Daniel S. Katz ORCID
Tags
FFT High performance computing Performance portability

GitHub Events

Total
  • Create event: 35
  • Release event: 1
  • Issues event: 38
  • Watch event: 18
  • Delete event: 35
  • Member event: 1
  • Issue comment event: 203
  • Push event: 137
  • Pull request event: 190
  • Pull request review event: 456
  • Pull request review comment event: 426
  • Fork event: 5
Last Year
  • Create event: 35
  • Release event: 1
  • Issues event: 38
  • Watch event: 18
  • Delete event: 35
  • Member event: 1
  • Issue comment event: 203
  • Push event: 137
  • Pull request event: 190
  • Pull request review event: 456
  • Pull request review comment event: 426
  • Fork event: 5

Committers

Last synced: 7 months ago

All Time
  • Total Commits: 591
  • Total Committers: 11
  • Avg Commits per committer: 53.727
  • Development Distribution Score (DDS): 0.523
Past Year
  • Commits: 143
  • Committers: 8
  • Avg Commits per committer: 17.875
  • Development Distribution Score (DDS): 0.294
Top Committers
Name Email Commits
Yuuichi Asahi y****i@n****p 282
Paul Zehner p****r@c****r 143
yasahi-hpc 5****c 126
Thomas Padioleau t****u@c****r 19
dependabot[bot] 4****] 9
Andrew Ho h****7@l****v 6
Rémi Baron r****n@c****r 2
Kamil Rakoczy k****y@a****m 1
Julien Bigot j****t@c****r 1
Daniel S. Katz d****z@i****g 1
Cédric Chevalier c****9@p****e 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 4 months ago

All Time
  • Total issues: 57
  • Total pull requests: 354
  • Average time to close issues: about 1 month
  • Average time to close pull requests: 8 days
  • Total issue authors: 7
  • Total pull request authors: 11
  • Average comments per issue: 1.53
  • Average comments per pull request: 1.36
  • Merged pull requests: 290
  • Bot issues: 0
  • Bot pull requests: 24
Past Year
  • Issues: 36
  • Pull requests: 256
  • Average time to close issues: 6 days
  • Average time to close pull requests: 5 days
  • Issue authors: 5
  • Pull request authors: 7
  • Average comments per issue: 2.22
  • Average comments per pull request: 1.54
  • Merged pull requests: 211
  • Bot issues: 0
  • Bot pull requests: 24
Top Authors
Issue Authors
  • yasahi-hpc (27)
  • tpadioleau (23)
  • W-Wuxian (2)
  • jbigot (2)
  • thivinanandh (1)
  • pzehner (1)
  • acalloo (1)
Pull Request Authors
  • yasahi-hpc (256)
  • tpadioleau (37)
  • dependabot[bot] (24)
  • pzehner (23)
  • jbigot (4)
  • rb214678 (3)
  • danielskatz (2)
  • cedricchevalier19 (2)
  • helloworld922 (1)
  • kamilrakoczy (1)
  • thivinanandh (1)
Top Labels
Issue Labels
idea (5) enhancement (4) user story (3) good first issue (3) cleanup (3) CI (1) documentation (1) bug (1)
Pull Request Labels
cleanup (99) enhancement (98) CI (42) documentation (36) bug (32) dependencies (26) github_actions (24) CMake (20) feature request (8) python (2)

Packages

  • Total packages: 1
  • Total downloads: unknown
  • Total dependent packages: 0
  • Total dependent repositories: 0
  • Total versions: 1
  • Total maintainers: 3
spack.io: kokkos-fft

FFT interfaces for Kokkos C++ Performance Portability Programming EcoSystem

  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent repos count: 0.0%
Average: 27.5%
Dependent packages count: 54.9%
Last synced: 4 months ago

Dependencies

.github/workflows/build_test.yaml actions
  • DoozyX/clang-format-lint-action v0.13 composite
  • actions/checkout v4 composite
  • actions/download-artifact v3 composite
  • actions/upload-artifact v3 composite
  • jlumbroso/free-disk-space v1.2.0 composite
  • tj-actions/changed-files v42 composite
.github/workflows/cleanup_base.yaml actions
  • SmartsquareGmbH/delete-old-packages v0.7.0 composite
docker/gcc/Dockerfile docker
  • $BASE latest build
docker/intel/Dockerfile docker
  • $BASE latest build
docker/nvcc/Dockerfile docker
  • $BASE latest build
docker/rocm/Dockerfile docker
  • $BASE latest build
.github/workflows/reuse.yml actions
  • actions/checkout v4 composite
  • fsfe/reuse-action v3 composite
docs/requirements.txt pypi
  • breathe *
  • cmake >=3.22
  • sphinx-rtd-theme *
.github/workflows/__clang-format-check.yaml actions
  • DoozyX/clang-format-lint-action bcb4eb2cb0d707ee4f3e5cc3b456eb075f12cf73 composite
  • actions/checkout 11bd71901bbe5b1630ceea73d27597364c9af683 composite
.github/workflows/__cmake-format-check.yaml actions
  • actions/checkout 11bd71901bbe5b1630ceea73d27597364c9af683 composite
  • puneetmatharu/cmake-format-lint-action 2ac346e79e7ceac958bc637c1391285fb335ed7c composite
.github/workflows/build_nightly.yaml actions
  • actions/checkout 11bd71901bbe5b1630ceea73d27597364c9af683 composite
  • jlumbroso/free-disk-space 54081f138730dfa15788a46383842cd2f914a1be composite
.github/workflows/create_base.yaml actions
  • actions/checkout 11bd71901bbe5b1630ceea73d27597364c9af683 composite
  • docker/login-action 74a5d142397b4f367a81961eba4e8cd7edddf772 composite
  • jlumbroso/free-disk-space 54081f138730dfa15788a46383842cd2f914a1be composite
.github/workflows/heartbeat.yaml actions
.github/workflows/python-test.yaml actions
  • actions/checkout 11bd71901bbe5b1630ceea73d27597364c9af683 composite
  • actions/setup-python 8d9ed9ac5c53483de85588cdf95a591a75ab9f55 composite
.github/workflows/website-checks.yaml actions
  • actions/checkout 11bd71901bbe5b1630ceea73d27597364c9af683 composite
docker/clang/Dockerfile docker
  • $BASE latest build
python_scripts/pyproject.toml pypi
  • joblib *
  • matplotlib *
  • numpy *
  • pylint *
  • pytest >=7.0
  • xarray [viz]
  • xarray [io]