-
-
Notifications
You must be signed in to change notification settings - Fork 189
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
Supporting Eigen & FFTW when STAN_THREADS is enabled #3025
Comments
I would be in favor of this. I think you'd want the condition to actually be I'm curious about your application that got faster - I had previously tried to use FFTW for a problem which required a 2-D fft, but that was not much faster in Stan-Math because Eigen (as of 3.4, anyway) only exposes a 1-D FFT function, so our 2-D FFTs are just loops still. |
@rok-cesnovar would it make more sense for this to be in |
Hmm, I think you are right, because that way its not limited to cmdstan only. Will move to math. |
For a model using 2-D FFTs, I saw about a 1.5x speedup by using FFTW. This also required some changes to our FFT code, since Eigen exposes the 2-D transforms conditionally: https://github.com/WardBrian/math/tree/experiment/eigen-fftw |
Awesome! Yeah, FFTW is the real deal :) |
Description:
The FFTW library can be used seamlessly with Eigen and their FFT implementation which makes everything simple to use with Stan. Using FFTW has proven to yield huge speedups in our model.
There is however a problem when using threading. When using fftw in multi-threaded applications, you need to call
fftw_make_planner_thread_safe();
once before callingfft()
.Which means I need to add
in main() of cmdstan.
Do we think this might be worth adding for all users? Or is this too niche?
Current Version:
v2.33.1
The text was updated successfully, but these errors were encountered: