-
Notifications
You must be signed in to change notification settings - Fork 6
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
Update readme #36
Update readme #36
Conversation
More explanations
Hi @cedricchevalier19 , because of the breaking change in (#30), I made a new PR. If this is good for you, I will merge this. |
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 one big issue is left out: how user have to specify which fft libraries to use?
This should be in the CMake examples. You should try to copy and paste the lines to be sure that they work at least on one machine.
I am not sure by all the markdown syntax, specially where blank lines are needed, so please use a markdown linter.
README.md
Outdated
single MPI process without knowing about MPI. We are inclined to implement the numpy FFT interfaces based on Kokkos. | ||
Here is the example for 1D case in python and KokkosFFT. | ||
single MPI process without knowing about MPI. We are inclined to implement the [numpy.fft](https://numpy.org/doc/stable/reference/routines.fft.html)-like interfaces adapted for [Kokkos](https://github.com/kokkos/kokkos). | ||
A key concept is that "As easy as numpy, as fast as vendor libraries". Accordingly, our API follows the API by [numpy.fft](https://numpy.org/doc/stable/reference/routines.fft.html) with minor differences. If something is wrong with runtime values (say ```View``` extents), it will raise runtime errors (C++ exceptions or assertions). Here is the example for 1D real to complex transform with ```rfft``` in python and KokkosFFT. |
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.
A key concept is that "As easy as numpy, as fast as vendor libraries". Accordingly, our API follows the API by [numpy.fft](https://numpy.org/doc/stable/reference/routines.fft.html) with minor differences. If something is wrong with runtime values (say ```View``` extents), it will raise runtime errors (C++ exceptions or assertions). Here is the example for 1D real to complex transform with ```rfft``` in python and KokkosFFT. | |
A key concept is that "As easy as numpy, as fast as vendor libraries". Accordingly, our API follows the API by [numpy.fft](https://numpy.org/doc/stable/reference/routines.fft.html) with minor differences. If something is wrong with runtime values (say `View` extents), it will raise runtime errors (C++ exceptions or assertions). Here is the example for 1D real to complex transform with `rfft` in python and KokkosFFT. | |
Concerning assertions, I know it is done this way in some part of Kokkos, however I think it's a bad behaviour for a library. It should not interrupt the calling application, where a proper error handling can be done. Not something to correct now, but perhaps something to keep in mind for the Kokkos ecosystem.
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.
OK. Let us discuss this point in our next meeting
README.md
Outdated
@@ -33,6 +33,8 @@ Kokkos::fence(); | |||
KokkosFFT::rfft(execution_space(), x, x_hat); | |||
``` | |||
|
|||
There are two major differences: [```execution_space```](https://kokkos.org/kokkos-core-wiki/API/core/execution_spaces.html) argument and output value (```x_hat```) is an argument of API (not returned from API). As imagined, KokkosFFT only accepts [Kokkos Views](https://kokkos.org/kokkos-core-wiki/API/core/View.html) as input data. The accessibilities of Views from ```execution_space``` is statically checked (compilation errors if not accessible). |
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.
There are two major differences: [```execution_space```](https://kokkos.org/kokkos-core-wiki/API/core/execution_spaces.html) argument and output value (```x_hat```) is an argument of API (not returned from API). As imagined, KokkosFFT only accepts [Kokkos Views](https://kokkos.org/kokkos-core-wiki/API/core/View.html) as input data. The accessibilities of Views from ```execution_space``` is statically checked (compilation errors if not accessible). | |
There are two major differences: [`execution_space`](https://kokkos.org/kokkos-core-wiki/API/core/execution_spaces.html) argument and output value (`x_hat`) is an argument of API (not returned from API). As imagined, KokkosFFT only accepts [Kokkos Views](https://kokkos.org/kokkos-core-wiki/API/core/View.html) as input data. The accessibilities of Views from `execution_space` is statically checked (compilation errors if not accessible). |
README.md
Outdated
@@ -60,7 +62,106 @@ int axis = -1; | |||
KokkosFFT::rfft(execution_space(), x, x_hat, KokkosFFT::FFT_Normalization::BACKWARD, axis); // FFT along -1 axis and batched along 0th axis | |||
``` | |||
|
|||
## Building KokkosFFT | |||
In this example, the 1D batched ```rfft``` over 2D View along ```axis -1``` is executed. Some basic examples are found in [examples](https://github.com/CExA-project/kokkos-fft/tree/main/examples). |
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.
In this example, the 1D batched ```rfft``` over 2D View along ```axis -1``` is executed. Some basic examples are found in [examples](https://github.com/CExA-project/kokkos-fft/tree/main/examples). | |
In this example, the 1D batched `rfft` over 2D View along `axis -1` is executed. Some basic examples are found in [examples](https://github.com/CExA-project/kokkos-fft/tree/main/examples). |
README.md
Outdated
In this example, the 1D batched ```rfft``` over 2D View along ```axis -1``` is executed. Some basic examples are found in [examples](https://github.com/CExA-project/kokkos-fft/tree/main/examples). | ||
|
||
## Disclaimer | ||
KokkosFFT is under development and subject to change without warning. The authors do not guarantee that this code runs correctly in all the environments. |
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.
KokkosFFT is under development and subject to change without warning. The authors do not guarantee that this code runs correctly in all the environments. | |
** KokkosFFT is under development and subject to change without warning. The authors do not guarantee that this code runs correctly in all the environments. ** |
README.md
Outdated
Since KokkosFFT is a header-only library, it is enough to simply add as a subdirectory. It is assumed that kokkos and kokkosFFT are placed under ```<project_directory>/tpls```. | ||
Here is an example to use KokkosFFT in the following CMake project. |
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.
Since KokkosFFT is a header-only library, it is enough to simply add as a subdirectory. It is assumed that kokkos and kokkosFFT are placed under ```<project_directory>/tpls```. | |
Here is an example to use KokkosFFT in the following CMake project. | |
Since KokkosFFT is a header-only library, it is enough to simply add as a subdirectory. It is assumed that kokkos and kokkosFFT are placed under `<project_directory>/tpls`. | |
Here is an example to use KokkosFFT in the following CMake project. | |
README.md
Outdated
This way, all the functionalities are executed on A100 GPUs. | ||
|
||
### Install as a library | ||
Is is assumed that the Kokkos is installed under ```<lib_dir>/kokkos``` targeting Icelake with OpenMP backend. ```Kokkos_dir``` also needs to be set appropriately. Here is a recipe to install KokkosFFT under ```<lib_dir>/kokkosFFT```. |
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.
Is is assumed that the Kokkos is installed under ```<lib_dir>/kokkos``` targeting Icelake with OpenMP backend. ```Kokkos_dir``` also needs to be set appropriately. Here is a recipe to install KokkosFFT under ```<lib_dir>/kokkosFFT```. | |
Is is assumed that the Kokkos is installed under `<install_dir>/kokkos` with OpenMP backend. Here is a recipe to install KokkosFFT under `<install_dir>/kokkos_fft`. |
README.md
Outdated
export KOKKOSFFT_INSTALL_PREFIX=<lib_dir>/kokkosFFT | ||
export KokkosFFT_DIR=<lib_dir>/kokkosFFT/lib64/cmake/kokkos-fft | ||
|
||
mkdir build_KokkosFFT && cd build_KokkosFFT | ||
cmake -DBUILD_TESTING=OFF \ | ||
-DCMAKE_CXX_COMPILER=icpx \ | ||
-DKokkos_ENABLE_OPENMP=ON \ | ||
-DKokkos_ARCH_SKX=ON \ | ||
-DCMAKE_INSTALL_PREFIX=${KOKKOSFFT_INSTALL_PREFIX} .. | ||
cmake --build . -j 8 | ||
cmake --install . |
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.
export KOKKOSFFT_INSTALL_PREFIX=<lib_dir>/kokkosFFT | |
export KokkosFFT_DIR=<lib_dir>/kokkosFFT/lib64/cmake/kokkos-fft | |
mkdir build_KokkosFFT && cd build_KokkosFFT | |
cmake -DBUILD_TESTING=OFF \ | |
-DCMAKE_CXX_COMPILER=icpx \ | |
-DKokkos_ENABLE_OPENMP=ON \ | |
-DKokkos_ARCH_SKX=ON \ | |
-DCMAKE_INSTALL_PREFIX=${KOKKOSFFT_INSTALL_PREFIX} .. | |
cmake --build . -j 8 | |
cmake --install . | |
cmake -b build_kokkos_fft -DBUILD_TESTING=OFF -DKokkos_ROOT="<install_dir>/kokkos" -DCMAKE_INSTALL_PREFIX="<install_dir>/kokkos_fft" . | |
cmake --build build_kokkos_fft --parallel && cmake --install build_kokkos_fft |
README.md
Outdated
└──hello.cpp | ||
``` | ||
|
||
The ```CMakeLists.txt``` would be |
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.
The ```CMakeLists.txt``` would be | |
The `CMakeLists.txt` would be | |
README.md
Outdated
The ```CMakeLists.txt``` would be | ||
```CMake | ||
cmake_minimum_required(VERSION 3.23) | ||
project(kokkos-fft LANGUAGES CXX) |
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.
Not a good project name
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.
Sure. I will change it
README.md
Outdated
export KOKKOSFFT_INSTALL_PREFIX=<lib_dir>/kokkosFFT | ||
export KokkosFFT_DIR=<lib_dir>/kokkosFFT/lib64/cmake/kokkos-fft | ||
|
||
mkdir build && cd build | ||
cmake -DCMAKE_CXX_COMPILER=icpx \ | ||
-DCMAKE_BUILD_TYPE=Release \ | ||
-DKokkos_ENABLE_OPENMP=ON \ | ||
-DKokkos_ARCH_SKX=ON .. | ||
cmake --build . -j 8 |
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.
export KOKKOSFFT_INSTALL_PREFIX=<lib_dir>/kokkosFFT | |
export KokkosFFT_DIR=<lib_dir>/kokkosFFT/lib64/cmake/kokkos-fft | |
mkdir build && cd build | |
cmake -DCMAKE_CXX_COMPILER=icpx \ | |
-DCMAKE_BUILD_TYPE=Release \ | |
-DKokkos_ENABLE_OPENMP=ON \ | |
-DKokkos_ARCH_SKX=ON .. | |
cmake --build . -j 8 | |
cmake -b build_dir -DCMAKE_PREFIX_PATH="<install_dir>/kokkos;<install_dir>/kokkos_fft" . | |
cmake --build build_dir --parallel |
I do not understand why Kokkos_ENABLE_OPENMP
was passed here if Kokkos is already installed.
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.
That is true. May be unnecessary
Thanks again for your review.
Actually, I am not planning to allow a user to specify fft libraries. A fft library dedicated to Kokkos Device backend is automatically chosen, e.g., If Kokkos Device backend is given, then only the library for device is available. If a user want to call fft from both host and device, it is needed to enable
OK. I will try some plugin |
I was talking on how to find or help finding the correct fft implementations. However, adding a table and the corresponding library can be a great addition in the readme or the documentation. |
Do you mean the complete documentations of API? I agree it is the most important missing ingredient for this repo. I am currently working on that. |
Actually, I found an issue to build a code in case both |
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 do not know how standard is kokkos-path
CMakeLists.txt
Outdated
# First check, Kokkos is added as subdirectory or not | ||
if (KOKKOS_PATH STREQUAL "") | ||
find_package(Kokkos REQUIRED) | ||
else() | ||
message(STATUS "Using Kokkos at ${KOKKOS_PATH}") | ||
endif() |
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.
Please, don't do this.
Use can check for kokkos::kokkos target or something like that.
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.
Thank you. I modified. I will probably add a capability to display the Kokkos version detail in CMake in the future.
…t into update-readme-tmp
No, I mean how to find fftw and so if it is not straightforward. |
As you said, finding fftw is not straightforward. I have prepared a helper to find it, but it would probably only work if fftw is installed in "conventional location". If a user manually install it, I am not sure what is the better way. |
@cedricchevalier19 Regarding the fftw documentations, I would like to make it in another PR. If you are OK, I would merge this |
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 great!
@cedricchevalier19 Thank you again for your review. I will merge this |
Cherry-pick from the previous PR (#27) with modifications based on comments. Because of the breaking changes in PR (#30), I made a new PR. The README is planed to be further updated before release.