Skip to content

Conversation

yasahi-hpc
Copy link
Contributor

This PR adds a blog post on kokkos-fft.

  • featuring some technical details and a real world example
  • links are valid

Copy link
Member

@dalg24 dalg24 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good overall


* wishing to integrate in-situ signal and image processing with FFTs. E.g., spectral analyses, low pass filtering, etc.

* __NOT__ willing to go through the documentation of de facto standard FFT libraries. They want to benefit from powerful vendor FFT libraries while working with a simple API like that of [`numpy.fft`](https://numpy.org/doc/stable/reference/routines.fft.html).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't get that point.
Is that about saying that the kokkos-fft API is easier to use than other C++ alternatives and inspired from numpy.fft?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes
I would like to say that the kokkos-fft API is easier to use than those of vendor libraries and inspired from numpy.fft?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that "easier" point is kind of subjective. It is certainly more intuitive to use for Python users, but I am not sure it is the case for hardcore fftw Fortran users.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe "intuitive" then :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cedricchevalier19 I understand your point. Actually, what I am claiming here is that our API is as simple as numpy.fft. As you may say, fftw experts could only prefer fftw APIs

Comment on lines 76 to 137
# Prerequisites

To use kokkos-fft, we need the following:

* `CMake 3.22+`
* `Kokkos 4.4+`

Depending on your backend, you also need at least one of the following compilers (for the latest requirements, see [README](https://github.com/kokkos/kokkos-fft)):

* `gcc 8.3.0+` (CPUs)
* `IntelLLVM 2023.0.0+` (CPUs, Intel GPUs)
* `nvcc 11.0.0+` (NVIDIA GPUs)
* `rocm 5.3.0+` (AMD GPUs)

# Using kokkos-fft in your CMake project

For the moment, there are two ways to use kokkos-fft: include as a subdirectory in your CMake project or install as a library. Since kokkos-fft is a header-only library, it is easy to add it as a subdirectory in a CMake project. We will see how to do it.

It is assumed that both Kokkos and kokkos-fft are placed under `<project_directory>/tpls`. Here is the structure of a simple CMake project.

```
---/
|
└──<project_directory>/
|──tpls/
| |──kokkos/
| └──kokkos-fft/
|──CMakeLists.txt
└──hello.cpp
```

See [here](https://kokkos.org/kokkos-core-wiki/get-started/integrating-kokkos-into-your-cmake-project.html#embedded-kokkos-via-add-subdirectory-and-git-submodules) about embedding Kokkos via `add_subdirectory()` and Git Submodules in your CMake project. Then, you need to clone the repo of kokkos-fft into `<project_directory>/tpls/kokkos-fft`.

```bash
git clone --recursive https://github.com/kokkos/kokkos-fft.git
```

The `CMakeLists.txt` file of the project would be

```CMake
cmake_minimum_required(VERSION 3.23)
project(kokkos-fft-as-subdirectory LANGUAGES CXX)

add_subdirectory(tpls/kokkos)
add_subdirectory(tpls/kokkos-fft)

add_executable(hello-kokkos-fft hello.cpp)
target_link_libraries(hello-kokkos-fft PUBLIC Kokkos::kokkos KokkosFFT::fft)
```

To build the project, we basically rely on the CMake options for Kokkos. For example, the build steps for an A100 GPU based backend are as follows:

```bash
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 FFT functionalities will be executed on the A100 GPU. For installation as a library, details are provided in the [documentation](https://kokkosfft.readthedocs.io/en/latest/intro/building.html#install-kokkosfft-as-a-library).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would drop these two sections and defer to the kokkos-fft documentation.
You could say that the code for the following example can be found in the kokkos-fft repo and post a link.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense. I just tried to make this blog post self-contained. If it is not necessary, I can drop this part

@yasahi-hpc
Copy link
Contributor Author

@dalg24 Thanks a lot for your comments.
I will try to fix as soon as possible.
Is there any deadline to merge this?

@dalg24
Copy link
Member

dalg24 commented Mar 14, 2025

@dalg24 Thanks a lot for your comments.

I will try to fix as soon as possible.

Is there any deadline to merge this?

No hard deadline. But obviously we don't want to unnecessarily drag it too much.

@yasahi-hpc
Copy link
Contributor Author

@dalg24 Thanks a lot for your comments.
I will try to fix as soon as possible.
Is there any deadline to merge this?

No hard deadline. But obviously we don't want to unnecessarily drag it too much.

Good. I think we can safely make it before the end of next week

@yasahi-hpc yasahi-hpc requested a review from dalg24 March 19, 2025 14:50
@yasahi-hpc
Copy link
Contributor Author

Hi @dalg24
May I have another review.

Since I have largely modified the source code, I made a benchmark again.
Surprisingly, with the new python, there is a factor of 2 speed up.
I added the compiler/version in the table for reproducibility.

@dalg24 dalg24 requested a review from lucbv March 20, 2025 07:39
@yasahi-hpc yasahi-hpc force-pushed the add-kokkos-fft-blog branch from 1e4dbca to 96238dc Compare April 1, 2025 11:25
@yasahi-hpc
Copy link
Contributor Author

@dalg24
I have added the performance result on PVC as we have discussed yesterday.

dalg24 and others added 21 commits June 26, 2025 04:16
Apparently it cannot be called like the directory
I am a bit surprised as it was working on my local setup.
* Add poster session

* Update content/blog/kug-2025-program-announced.md

Co-authored-by: Damien L-G <dalg24+github@gmail.com>

* Update content/blog/kug-2025-program-announced.md

Co-authored-by: JBludau <104908666+JBludau@users.noreply.github.com>

* Update main table

---------

Co-authored-by: Damien L-G <dalg24+github@gmail.com>
Co-authored-by: JBludau <104908666+JBludau@users.noreply.github.com>
Table is slightly less ugly that way
* Add blog post about new View implementation
* Apply suggestions from code review
* Rewrite with AI
* add pannel details

* added note about edit

* Update content/blog/kug-2025-program-announced.md

Co-authored-by: Damien L-G <dalg24+github@gmail.com>

---------

Co-authored-by: Damien L-G <dalg24+github@gmail.com>
* update main schedule to match hpsf

* update afternoon session times

* add update hint to top of page

* swap in chris for benjamin

* Shorten title for Chris' talk

---------

Co-authored-by: Damien L-G <dalg24+github@gmail.com>
dalg24 and others added 19 commits June 26, 2025 04:16
Rational: there is currently no tag for any other organization, not even
a CEA one for the CExA Tea-Time page, and that "Sandia" tag is
exclusively used here to annotate the Team page.
It looks just out of place and yield a "Team" "Sandia" marking which is
not the message we are trying to convey.
* Update publication list

* Finish the job

* Capitalize the e

---------

Co-authored-by: Damien L-G <dalg24@gmail.com>
* Make citing-kokkos a top level alias on kokkos.org

Splits citation instructions from publication list.

* Apply suggestions from code review

Co-authored-by: Damien L-G <dalg24+github@gmail.com>

---------

Co-authored-by: Damien L-G <dalg24+github@gmail.com>
* Update the Kokkos Ecosystem Overview

---------

Signed-off-by: Christian Trott <crtrott@sandia.gov>
Co-authored-by: Damien L-G <dalg24+github@gmail.com>
* Add filed repot for KUG 2025

* Add pictures

* Improve blog post

* Add another picture

* Add another picture

* Update blog post and make it adhere to new file ordering

Signed-off-by: Christian Trott <crtrott@sandia.gov>

* Apply suggestions from code review

Co-authored-by: Daniel Arndt <arndtd@ornl.gov>

---------

Signed-off-by: Christian Trott <crtrott@sandia.gov>
Co-authored-by: Christian Trott <crtrott@sandia.gov>
Co-authored-by: Damien L-G <dalg24+github@gmail.com>
* Rename overview URL and tab

* Remove about/{core,kernels,tools} pages

Content was duplicated (word for word) in the overview page

* Cleanup Documentation tabs

Dropped Kernels API tab

* Apply suggestions from code review

Co-authored-by: Luc Berger <lberge@sandia.gov>

---------

Co-authored-by: Luc Berger <lberge@sandia.gov>
@yasahi-hpc yasahi-hpc force-pushed the add-kokkos-fft-blog branch from a94d427 to 6885d41 Compare June 25, 2025 19:16
@yasahi-hpc
Copy link
Contributor Author

Closes
Opens a new one #184

@yasahi-hpc yasahi-hpc closed this Jun 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants