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

Benchmark FFTW planning #158

Open
chrisbrahms opened this issue Apr 22, 2020 · 7 comments
Open

Benchmark FFTW planning #158

chrisbrahms opened this issue Apr 22, 2020 · 7 comments

Comments

@chrisbrahms
Copy link
Collaborator

Do we need FFTW.PATIENT or is MEASURE or even ESTIMATE good enough?

@chrisbrahms
Copy link
Collaborator Author

So I did some benchmarks for rFFT. Code can be found here.

First, all the data (starting at 1024 samples). For each plot, lower is faster. Colours present different numbers of modes and dashes different planning modes. The number of threads here is set with FFTW.set_num_threads, JULIA_NUM_THREADS is always 4.
image

I think the first conclusion here is that PATIENT only has a small advantage over MEASURE for a single thread. For more threads, it seems that ESTIMATE and MEASURE get it wrong somehow and PATIENT just reproduces the single-thread performance. So for big parallel but single-threaded simulations on the workstation we can safely switch to MEASURE (I still need to run this benchmark on the workstation though).

Second, a comparison of single- and multi-threaded performance:
image
For single-mode, multi-threading is useless (as we'd expect). For 12 modes, the 16-threaded version (still using 4 threads for Julia though) can be up to twice as fast, but this is still only useful when we're not running many of these simultaneously.

Thoughts?

@jtravs
Copy link
Contributor

jtravs commented May 7, 2020

For more threads, it seems that ESTIMATE and MEASURE get it wrong somehow and PATIENT just reproduces the single-thread performance.

Yes, PATIENT switches threads off when it doesn't help: http://www.fftw.org/fftw3_doc/How-Many-Threads-to-Use_003f.html#How-Many-Threads-to-Use_003f

@chrisbrahms
Copy link
Collaborator Author

Ah I misremembered and thought that was the case for MEASURE as well.

@jtravs
Copy link
Contributor

jtravs commented May 7, 2020

For 12 modes, the 16-threaded version (still using 4 threads for Julia though) can be up to twice as fast, but this is still only useful when we're not running many of these simultaneously.

This is useful quite often, dropping say a 12 h sim to 6 h. But in those cases I expect most of the effort is actually in the nonlinear operator.

@jtravs
Copy link
Contributor

jtravs commented May 7, 2020

What about free space?

@chrisbrahms
Copy link
Collaborator Author

What about free space?

Next on the list, but needs to run overnight.

@jtravs
Copy link
Contributor

jtravs commented May 26, 2020

Note that FFTW now does not set threads by default: JuliaMath/FFTW.jl#151

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

No branches or pull requests

2 participants