-
Notifications
You must be signed in to change notification settings - Fork 17
Add kokkos-fft blog post #158
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good overall
content/blog/blog-post-10.md
Outdated
|
||
* 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). |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe "intuitive" then :)
There was a problem hiding this comment.
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
content/blog/blog-post-10.md
Outdated
# 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). |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
@dalg24 Thanks a lot for your comments. |
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 |
Hi @dalg24 Since I have largely modified the source code, I made a benchmark again. |
1e4dbca
to
96238dc
Compare
@dalg24 |
This PR adds a blog post on kokkos-fft.