kokkos-fft
kokkos-fft: A shared-memory FFT for the Kokkos ecosystem - Published in JOSS (2025)
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
Keywords from Contributors
Scientific Fields
Repository
A shared-memory FFT for the Kokkos ecosystem
Basic Info
- Host: GitHub
- Owner: kokkos
- License: other
- Language: C++
- Default Branch: main
- Homepage: https://kokkosfft.readthedocs.io/
- Size: 18 MB
Statistics
- Stars: 43
- Watchers: 10
- Forks: 9
- Open Issues: 20
- Releases: 5
Topics
Metadata Files
README.md
kokkos-fft
[!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
View1D
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
View2D
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
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
- Website: https://kokkos.org
- Repositories: 34
- Profile: https://github.com/kokkos
Kokkos C++ Performance Portability Programming Ecosystem
JOSS Publication
kokkos-fft: A shared-memory FFT for the Kokkos ecosystem
Authors
Université Paris-Saclay, UVSQ, CNRS, CEA, Maison de la Simulation, 91191, Gif-sur-Yvette, France
Université Paris-Saclay, UVSQ, CNRS, CEA, Maison de la Simulation, 91191, Gif-sur-Yvette, France
Université Paris-Saclay, UVSQ, CNRS, CEA, Maison de la Simulation, 91191, Gif-sur-Yvette, France
Tags
FFT High performance computing Performance portabilityGitHub 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
Top Committers
| Name | 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
Pull Request Labels
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
- Homepage: https://github.com/kokkos/kokkos-fft
- License: []
-
Latest release: 0.3.0
published 6 months ago
Rankings
Maintainers (3)
Dependencies
- 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
- SmartsquareGmbH/delete-old-packages v0.7.0 composite
- $BASE latest build
- $BASE latest build
- $BASE latest build
- $BASE latest build
- actions/checkout v4 composite
- fsfe/reuse-action v3 composite
- breathe *
- cmake >=3.22
- sphinx-rtd-theme *
- DoozyX/clang-format-lint-action bcb4eb2cb0d707ee4f3e5cc3b456eb075f12cf73 composite
- actions/checkout 11bd71901bbe5b1630ceea73d27597364c9af683 composite
- actions/checkout 11bd71901bbe5b1630ceea73d27597364c9af683 composite
- puneetmatharu/cmake-format-lint-action 2ac346e79e7ceac958bc637c1391285fb335ed7c composite
- actions/checkout 11bd71901bbe5b1630ceea73d27597364c9af683 composite
- jlumbroso/free-disk-space 54081f138730dfa15788a46383842cd2f914a1be composite
- actions/checkout 11bd71901bbe5b1630ceea73d27597364c9af683 composite
- docker/login-action 74a5d142397b4f367a81961eba4e8cd7edddf772 composite
- jlumbroso/free-disk-space 54081f138730dfa15788a46383842cd2f914a1be composite
- actions/checkout 11bd71901bbe5b1630ceea73d27597364c9af683 composite
- actions/setup-python 8d9ed9ac5c53483de85588cdf95a591a75ab9f55 composite
- actions/checkout 11bd71901bbe5b1630ceea73d27597364c9af683 composite
- $BASE latest build
- joblib *
- matplotlib *
- numpy *
- pylint *
- pytest >=7.0
- xarray [viz]
- xarray [io]