-
Notifications
You must be signed in to change notification settings - Fork 148
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
FFTW overrides via extension #668
base: master
Are you sure you want to change the base?
Conversation
This also replaces https://github.com/JuliaApproximation/FastTransformsForwardDiff.jl |
I don't understand whats causing the Invalidations failure, it looks like an unrelated bug... |
IMO ForwardDiff should not depend on FFTW. Instead I think it would be preferable to fix JuliaMath/AbstractFFTs.jl#56 and only depend on AbstractFFTs. |
This is why its an extension so it doesn't depend on either but I agree with you that JuliaMath/AbstractFFTs.jl#56 makes sense |
It's not an extension on Julia < 1.9. |
I believe we can just drop FFTW support on Julia <v1.9. How does that sound? |
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #668 +/- ##
==========================================
- Coverage 89.65% 86.63% -3.03%
==========================================
Files 11 13 +2
Lines 967 920 -47
==========================================
- Hits 867 797 -70
- Misses 100 123 +23
☔ View full report in Codecov by Sentry. |
I guess this would be annoying in practice. Downstream packages that want to use ForwardDiff + FFTW would have to copy the diff rules or add some workaround for them in Julia < 1.9, including the LTS version. |
Would something like |
One could also put the FFTW rules behind a |
Looking at the patch, the bulk of it only requires AbstractFFTs, FFTW is only needed for real-to-real FFTs, so just drop FFTW for <1.9 and <1.9 users can still enjoy most of the benefits of this, and add the relatively small real-to-real FFTs by hand if they really need it? |
I’m not quite sure what to do about the tests failures as they pass locally and it’s unclear what’s causing allocations |
Not supporting the FFTW-specific rules on Julia < 1.9 might be a bit surprising but I think it would still be much more preferable than depending on FFTW. The current design of AbstractFFTs is to leave the choice of the FFT backend to the users - as soon as a package loads an FFT backend (directly or indirectly) it's used for all FFT computations in all packages, i.e., the AbstractFFTs design assumes that only users load a backend because otherwise the whole ecosystem is affected (see, e.g., see e.g. JuliaMath/AbstractFFTs.jl#32, JuliaStats/KernelDensity.jl#117, and the discussion in JuliaPlots/StatsPlots.jl#480). I think this design is questionable but probably its restrictions were not a practical concern as long as there was no proper alternative to FFTW.jl. However, with alternatives such as RustFFT.jl nowadays it's more problematic if packages do not take the AbstractFFTs design into account. |
Is using |
This replaces #541 and introduces overrides needed for FFTW as extensions.
Note it will make FFTW and AbstractFFTs dependencies in Julia <v1.9