JuliaMath / JuliaMath/AbstractFFTs.jl
`AdjointStyle` requires unnecessary AD boilerplate for wrapper transforms
- Dominant language
- Julia
- Stars
- 134
- Forks
- 40
- PR merge metrics
- No merged PRs in 30d
Description
Certain transforms in the ecosystem, such as in FastTransforms.jl and ApproxFun.jl, are just wrappers that compose a basic FFT-like transform with additional scaling or another linear transform. See for example the ChebyshevTransformPlans at https://github.com/JuliaApproximation/FastTransforms.jl/blob/d8cceddd9e9b0829602c2a830de2588655754ea6/src/chebyshevtransform.jl and the JacobiTransformPlan at https://github.com/JuliaApproximation/ApproxFunOrthogonalPolynomials.jl/blob/f0426c65564ca2773114ee53a7082f9eaa2540cc/src/Spaces/Jacobi/jacobitransform.jl.
It should be possible to differentiate through these transforms by letting the AD framework do its job, as long as AD rules are defined for the inner transforms. However, the completely general rules defined in AbstractFFTs.jl require that an `AdjointStyle` and a corresponding implementation of `adjoint_mul` be defined for every single subtype of `AbstractFFTs.Plan`, implying a lot of boilerplate and lots of potential bugs.
Could one imagine a redesign where the AD rules in AbstractFFTs.jl only apply to plans that actually define the `AbstractStyle` trait, while the AD framework gets to do its thing for other transform types?
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.