JuliaApproximation / JuliaApproximation/FastTransforms.jl
Loading FastTransforms.jl can make FFTs via FFTW.jl 100x slower due to threading conflicts
- Dominant language
- Julia
- Stars
- 281
- Forks
- 27
- PR merge metrics
- No merged PRs in 30d
Description
While this is not a self-contained example, I would like to summarize an issue I had so that others may find it (and my workaround) when they search for it.
Loading FastTransforms.jl (import FastTransforms or using FastTransforms or loading a package depending on FastTransforms.jl) made some FFTs (of small real vectors with 256 to 4096 entries) via FFTW.jl roughly 100x slower on my system (when running Julia with one thread). Debugging this via the profiling tools showed that a huge amount of time was spent in __psynch_cvwait and __psynch_cvsignal. The reason appears to be
Reversing these settings by executing
FastTransforms.ft_set_num_threads(1)
ccall((:ft_fftw_init_threads, FastTransforms.libfasttransforms), Cint, ())
FastTransforms.ft_fftw_plan_with_nthreads(1)
after loading FastTransforms fixed the performance issue.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.