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

Unstable imfilter! execution time with variable FFTW threads #246

Open
IanButterworth opened this issue Mar 23, 2022 · 0 comments
Open

Unstable imfilter! execution time with variable FFTW threads #246

IanButterworth opened this issue Mar 23, 2022 · 0 comments

Comments

@IanButterworth
Copy link
Member

I'm assuming this is due to FFTW's auto planning making different decisions. If so, it would be good to expose the plan settings, if possible.

I'm seeing unexplained significant slowdown in imfilter! on some different data sizes, and I'm wondering whether this is the culpret.

julia> v1 = rand(Float32, 100, 100, 100);

julia> v2 = rand(Float32, 100, 100, 100);

julia> for t in 1:16
              FFTW.set_num_threads(t)
              @info "FFTW: $t"
              @btime imfilter!($v2, $v1, $(centered(Kernel.gaussian((1, 1, 10)))), "symmetric", Algorithm.FFT());
          end
[ Info: FFTW: 1
  31.118 ms (172 allocations: 64.69 MiB)
[ Info: FFTW: 2
  22.252 ms (335 allocations: 64.70 MiB)
[ Info: FFTW: 3
  17.866 ms (380 allocations: 64.70 MiB)
[ Info: FFTW: 4
  16.727 ms (419 allocations: 64.70 MiB)
[ Info: FFTW: 5
  16.070 ms (463 allocations: 64.71 MiB)
[ Info: FFTW: 6
  14.941 ms (505 allocations: 64.71 MiB)
[ Info: FFTW: 7
  212.458 ms (1171542 allocations: 134.28 MiB)
[ Info: FFTW: 8
  215.672 ms (1171782 allocations: 134.29 MiB)
[ Info: FFTW: 9
  214.504 ms (1171885 allocations: 134.29 MiB)
[ Info: FFTW: 10
  213.847 ms (1171566 allocations: 134.29 MiB)
[ Info: FFTW: 11
  213.470 ms (1172045 allocations: 134.30 MiB)
[ Info: FFTW: 12
  213.978 ms (1170869 allocations: 134.27 MiB)
[ Info: FFTW: 13
  17.095 ms (2094 allocations: 64.81 MiB)
[ Info: FFTW: 14
  15.242 ms (848 allocations: 64.74 MiB)
[ Info: FFTW: 15
  15.483 ms (889 allocations: 64.74 MiB)
[ Info: FFTW: 16
  15.473 ms (1182 allocations: 64.76 MiB)

With the mkl backend the bump doesn't occur and performance increases gradually with FFTW.jl threads

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

1 participant