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

AdjointStyle requires unnecessary AD boilerplate for wrapper transforms #135

Open
danielwe opened this issue Aug 15, 2024 · 0 comments
Open

Comments

@danielwe
Copy link

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?

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