-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
ENH use mkl fft if available #1916
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
Conversation
|
@mainakjas this made things worse somehow, right? Should we close, or are there additional things to try? |
|
sorry @Eric89GXL for not getting back to this yet. I think I had some things to try on this but it's not on the top of my priority list at the moment |
|
I just did a quick bench here with this script: with : mkl.set_num_threads(1) I get : 10000 loops, best of 3: 103 µs per loop with : mkl.set_num_threads(2) I get : 10000 loops, best of 3: 103 µs per loop with : mkl.set_num_threads(4) I get : 10000 loops, best of 3: 103 µs per loop so take home message mkl fft worse than scipy fft if num_threads = 1 but as soon as we allow more than 2 threads mkl wins with a speedup up to a power of 2 in this case. now if you don't take a power of 2 for the length of x ( 10 loops, best of 3: 62.3 ms per loop so MKL is about 88x faster in this case... we need to bring the PR back to life... |
|
Wouldn't it make sense to approach this like _get_fast_dot? E.g., have a function that tries to return mkl's fft, and if it can't, it returns the default spicy fft? |
|
Seems like Jona has some vision here and is volunteering :) On Mon, Nov 16, 2015 at 11:16 AM, jona-sassenhagen <notifications@github.com
|
|
yes it's as simple as that
|
|
Hm ... I'll see if I can get around to it. I was just trying to get our boss to buy a GPU/CUDA machine :) As this is 1. restricted to TFR, 2. applies to 3 or so functions, should the get_X functions go in mne.utils or in tfr? |
|
in utils
I would say
from mne.utils import fft
|
|
Argh ... it's always more complicated than you think ... how to set the # of threads? I guess we don't want to use the max # of threads by default. We can set to max number of threads minus one by default (and if there's only 2, we return the scipy version). Or we could read from n_jobs. Or set a global, user-accessible parameter. Or ... |
|
just let people set it globally in their environment. Don't interfere with
it.
|
|
Ok I'll see if I can get around to it. Probably once I start doing more time-frequency stuff myself again. |
|
If I understand it correctly, for MKL fft in welch-reliant stuff (e.g. PSDs), we'd have to reimplement them? |
|
yes
|
|
closing in favor of #2623 |
No description provided.