Skip to content
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

Adding perftest #527

Merged
merged 25 commits into from
Sep 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
a1fd341
added perftest
DiamonDinoia Aug 19, 2024
38a9c62
added-perftests
DiamonDinoia Aug 19, 2024
3b3388e
initial script
DiamonDinoia Aug 19, 2024
e14e8f6
draft for the performance page
DiamonDinoia Aug 19, 2024
cc1b067
updated scripts to handle all cases
DiamonDinoia Aug 20, 2024
8dd0b48
removed spurious import
DiamonDinoia Aug 20, 2024
54eb774
First draft of performance page
DiamonDinoia Aug 20, 2024
de92732
Build type was not defaulted to release in 2.2.0
DiamonDinoia Aug 20, 2024
ffcb2f1
fixed plots
DiamonDinoia Aug 20, 2024
0100dba
added fftw forget wisdom
DiamonDinoia Aug 21, 2024
a08eebd
added taskset and fixed wisdom
DiamonDinoia Aug 21, 2024
821db9b
removed redundant ifdef
DiamonDinoia Aug 21, 2024
bae6ea8
using the proper ifdef
DiamonDinoia Aug 21, 2024
d584982
using nruns=10 remove commented out tests
DiamonDinoia Aug 21, 2024
3e183d6
updated plots; fftw_forget_wisdom called before each test; using 10 r…
DiamonDinoia Aug 21, 2024
0a51b2c
updated plots
DiamonDinoia Aug 22, 2024
98525fc
updated plots
DiamonDinoia Aug 22, 2024
aded209
Merge remote-tracking branch 'flatiron/master' into perftests
DiamonDinoia Aug 28, 2024
2dc0412
added temperature check
DiamonDinoia Aug 28, 2024
8d97fb3
updated images clock frequency locked at 3.1 GHz
DiamonDinoia Aug 28, 2024
3cd9b07
updated tests and documentation page
DiamonDinoia Aug 28, 2024
2559a5e
fixing windows getopt
DiamonDinoia Aug 28, 2024
efdc8f2
removed unused sh file
DiamonDinoia Aug 28, 2024
d8e3272
using a warning
DiamonDinoia Aug 28, 2024
97bfe85
Fixing OSx build issue
DiamonDinoia Aug 29, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,24 @@ Flatiron Institute Nonuniform Fast Fourier Transform


Documentation contents
========================
========================

.. toctree::
:maxdepth: 3

install
install_gpu
performance
dirs
math
cex
cex
c
c_gpu
opts
error
trouble
tut
fortran
fortran
matlab
python
python_gpu
Expand All @@ -42,5 +43,3 @@ Documentation contents
users
ackn
refs


112 changes: 112 additions & 0 deletions docs/performance.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
Performance
============

This page shows the performance of the various version of FINUFFT starting from version 2.2.0. The goal is to ensure that performance does not regress between releases.
The results serve also as a user guideline to select the best compile time configuration (compiler, flags, fft implementation) and the best runtime parameters (upsampling factor, number of threads).
Please note that the performance depends on multiple parameters.
Notably: dimensions, size, digits requested, upsamplig factor, CPU utilised, compiler flags, SIMD instructions.
Due to the curse of dimensionality it is not possible to test all possible configurations.
Hence, we selected some use cases from this `GitHub discussion <https://github.com/flatironinstitute/finufft/discussions/398>`_.
If none of the following examples is of any help for your specific use case, participating in the discussion is the best way to communicate with us and the benchmarks may be updated to satisfy the majority of the users.

This `GitHub discussion <https://github.com/flatironinstitute/finufft/discussions/452>`_ shows instead the performance of the spreader/interpolator with different compilers and gives more insight on which one might be the faster for a specific CPU.


The CPU used for all benchmarks is Intel(R) Xeon(R) w5-3435X, the compiler is GCC 13.2.0.
The compiler flags are the ones used as a default in the CMakeLists.txt of the version tested we only impose a Release build and `-march=native`.
The title of the image contains the parameters used.
- pref: precision f=float, d=double
- N(x): dimension along one axes
- M: number of non-uniform points
- type: transform type (1, 2 or 3)

The other parameters are the same as finufft_opts.

To generate the results run `bench.py` as is inside perftest. It requires ``numpy``, ``pandas`` and ``matplotlib``.
The script assumes a bash like shell and it might not work on Windows.
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This script downloads finufft and builds it.

.. warning::
DO NOT RUN the script from inside the finufft git directory as it will mess up the git directory and fail!

1D Transforms
---------------------------------------------

Type 1
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. image:: pics/10000x1x1-type-1-upsamp2.00-precf-thread1.png
.. image:: pics/10000x1x1-type-1-upsamp1.25-precf-thread1.png
.. image:: pics/10000x1x1-type-1-upsamp2.00-precd-thread1.png
.. image:: pics/10000x1x1-type-1-upsamp1.25-precd-thread1.png

Type 2
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. image:: pics/10000x1x1-type-2-upsamp1.25-precd-thread1.png
.. image:: pics/10000x1x1-type-2-upsamp1.25-precf-thread1.png
.. image:: pics/10000x1x1-type-2-upsamp2.00-precd-thread1.png
.. image:: pics/10000x1x1-type-2-upsamp2.00-precf-thread1.png

Type 3
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. image:: pics/10000x1x1-type-3-upsamp1.25-precd-thread1.png
.. image:: pics/10000x1x1-type-3-upsamp1.25-precf-thread1.png
.. image:: pics/10000x1x1-type-3-upsamp2.00-precd-thread1.png
.. image:: pics/10000x1x1-type-3-upsamp2.00-precf-thread1.png

2D transforms
---------------------------------------------
Type 1
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. image:: pics/320x320x1-type-1-upsamp1.25-precf-thread1.png
.. image:: pics/320x320x1-type-1-upsamp1.25-precd-thread1.png
.. image:: pics/320x320x1-type-1-upsamp2.00-precf-thread1.png
.. image:: pics/320x320x1-type-1-upsamp2.00-precd-thread1.png

Type 2
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. image:: pics/320x320x1-type-2-upsamp1.25-precf-thread1.png
.. image:: pics/320x320x1-type-2-upsamp1.25-precd-thread1.png
.. image:: pics/320x320x1-type-2-upsamp2.00-precf-thread1.png
.. image:: pics/320x320x1-type-2-upsamp2.00-precd-thread1.png

Type 3
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. image:: pics/320x320x1-type-3-upsamp1.25-precf-thread1.png
.. image:: pics/320x320x1-type-3-upsamp1.25-precd-thread1.png
.. image:: pics/320x320x1-type-3-upsamp2.00-precf-thread1.png
.. image:: pics/320x320x1-type-3-upsamp2.00-precd-thread1.png

2D transforms Multi-Threaded
---------------------------------------------

Type 1
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. image:: pics/320x320x1-type-1-upsamp1.25-precf-thread32.png
.. image:: pics/320x320x1-type-1-upsamp2.00-precf-thread32.png

Type 2
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. image:: pics/320x320x1-type-2-upsamp1.25-precf-thread32.png
.. image:: pics/320x320x1-type-2-upsamp2.00-precf-thread32.png

Type 3
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. image:: pics/320x320x1-type-3-upsamp1.25-precf-thread32.png
.. image:: pics/320x320x1-type-3-upsamp2.00-precf-thread32.png

3D transforms Multi-Threaded (float32)
---------------------------------------------

Type 1
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. image:: pics/192x192x128-type-1-upsamp1.25-precf-thread32.png
.. image:: pics/192x192x128-type-1-upsamp2.00-precf-thread32.png

Type 2
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. image:: pics/192x192x128-type-2-upsamp1.25-precf-thread32.png
.. image:: pics/192x192x128-type-2-upsamp2.00-precf-thread32.png

Type 3
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. image:: pics/192x192x128-type-3-upsamp1.25-precf-thread32.png
.. image:: pics/192x192x128-type-3-upsamp2.00-precf-thread32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 14 additions & 4 deletions perftest/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,25 @@ set(PERFTESTS guru_timing_test manysmallprobs spreadtestnd spreadtestndall)

foreach(TEST ${PERFTESTS})
add_executable(${TEST} ${TEST}.cpp)
if (FINUFFT_USE_DUCC0)
if(FINUFFT_USE_DUCC0)
target_compile_definitions(${TEST} PRIVATE -DFINUFFT_USE_DUCC0)
endif ()
endif()
finufft_link_test(${TEST})

add_executable(${TEST}f ${TEST}.cpp)
target_compile_definitions(${TEST}f PRIVATE -DSINGLE)
if (FINUFFT_USE_DUCC0)
if(FINUFFT_USE_DUCC0)
target_compile_definitions(${TEST}f PRIVATE -DFINUFFT_USE_DUCC0)
endif ()
endif()
finufft_link_test(${TEST}f)
endforeach()

include(CheckIncludeFile)
check_include_file("getopt.h" HAVE_GETOPT_H)
if(HAVE_GETOPT_H)
add_executable(perftest perftest.cpp)
if(FINUFFT_USE_DUCC0)
target_compile_definitions(perftest PRIVATE -DFINUFFT_USE_DUCC0)
endif()
finufft_link_test(perftest)
endif()
Loading
Loading