-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
updated fix for #19892 (FFTW threads initialization) #21169
Conversation
…me the planner is called (JuliaLang#21127 incorrectly prevented threads from being used at all)
are there any simple benchmarks that could be added that would have caught this? |
@tkelman I'm not sure. I spotted the problem by performing benchmarks of a package of mines, but the regression was easily noticeable only in the first run (compilation) of |
We could check for the use of threads by: julia> FFTW.set_num_threads(2)
julia> contains(string(plan_fft(Array{Complex128}(1<<14), flags = FFTW.ESTIMATE)), "dft-thr")
true |
Pushed a test. |
Is it normal that the plan changes with this patch? With 4 threads: On d694548: julia> plan_rfft(randn(10^5,1), flags = FFTW.MEASURE)
FFTW real-to-complex plan for 100000×1 array of Float64
(rdft2-ct-dit/16
(hc2c-direct-16/60/0 "hc2cfdftv_16_avx"
(rdft2-r2hc-direct-16 "r2cf_16")
(rdft2-r2hc01-direct-16 "r2cfII_16"))
(dft-thr-vrank>=1-x4/1
(dft-vrank>=1-x2/1
(dft-ct-dit/25
(dftw-direct-25/96 "t1fv_25_avx")
(dft-vrank>=1-x25/1
(dft-ct-dit/25
(dftw-direct-25/192 "t2fv_25_avx")
(dft-direct-10-x25 "n1fv_10_avx")))))
(dft-vrank>=1-x2/1
(dft-ct-dit/25
(dftw-direct-25/96 "t1fv_25_avx")
(dft-vrank>=1-x25/1
(dft-ct-dit/25
(dftw-direct-25/192 "t2fv_25_avx")
(dft-direct-10-x25 "n1fv_10_avx")))))
(dft-vrank>=1-x2/1
(dft-ct-dit/25
(dftw-direct-25/96 "t1fv_25_avx")
(dft-vrank>=1-x25/1
(dft-ct-dit/25
(dftw-direct-25/192 "t2fv_25_avx")
(dft-direct-10-x25 "n1fv_10_avx")))))
(dft-vrank>=1-x2/1
(dft-ct-dit/25
(dftw-direct-25/96 "t1fv_25_avx")
(dft-vrank>=1-x25/1
(dft-ct-dit/25
(dftw-direct-25/192 "t2fv_25_avx")
(dft-direct-10-x25 "n1fv_10_avx"))))))) On https://github.com/stevengj/julia/tree/fftwfix2 julia> plan_rfft(randn(10^5,1), flags = FFTW.MEASURE)
FFTW real-to-complex plan for 100000×1 array of Float64
(rdft2-ct-dit/16
(hc2c-direct-16/60/0 "hc2cfdftv_16_avx"
(rdft2-r2hc-direct-16 "r2cf_16")
(rdft2-r2hc01-direct-16 "r2cfII_16"))
(dft-thr-vrank>=1-x4/1
(dft-vrank>=1-x2/1
(dft-ct-dit/5
(dftw-direct-5/16 "t1fv_5_avx")
(dft-vrank>=1-x5/1
(dft-ct-dit/5
(dftw-direct-5/8 "t3fv_5_avx")
(dft-vrank>=1-x5/1
(dft-ct-dit/25
(dftw-direct-25/96 "t1fv_25_avx")
(dft-direct-10-x25 "n1fv_10_avx")))))))
(dft-vrank>=1-x2/1
(dft-ct-dit/5
(dftw-direct-5/16 "t1fv_5_avx")
(dft-vrank>=1-x5/1
(dft-ct-dit/5
(dftw-direct-5/8 "t3fv_5_avx")
(dft-vrank>=1-x5/1
(dft-ct-dit/25
(dftw-direct-25/96 "t1fv_25_avx")
(dft-direct-10-x25 "n1fv_10_avx")))))))
(dft-vrank>=1-x2/1
(dft-ct-dit/5
(dftw-direct-5/16 "t1fv_5_avx")
(dft-vrank>=1-x5/1
(dft-ct-dit/5
(dftw-direct-5/8 "t3fv_5_avx")
(dft-vrank>=1-x5/1
(dft-ct-dit/25
(dftw-direct-25/96 "t1fv_25_avx")
(dft-direct-10-x25 "n1fv_10_avx")))))))
(dft-vrank>=1-x2/1
(dft-ct-dit/5
(dftw-direct-5/16 "t1fv_5_avx")
(dft-vrank>=1-x5/1
(dft-ct-dit/5
(dftw-direct-5/8 "t3fv_5_avx")
(dft-vrank>=1-x5/1
(dft-ct-dit/25
(dftw-direct-25/96 "t1fv_25_avx")
(dft-direct-10-x25 "n1fv_10_avx"))))))))) |
@giordano, the |
Ready to merge? |
@stevengj Any idea why the new test would fail with FFTW 3.3.3 (CentOS 7)? Is that expected? |
@nalimilan, yes, So, the test should only run if |
initialize FFTW threads the first time the planner is called (I tried to be clever in #21127, but it incorrectly prevented threads from being used at all). Fixes #21163