Skip to content

Incorrect pullback of AbstractFFTs.[i]rfft? #1377

Closed
@trahflow

Description

@trahflow

Zygote defines an adjoint of AbstractFFTs.[i]rfft here.
On the other hand, AbstractFFTs defines rrules for [i]rfft and other functions itself (implemented by @devmotion ) here

I assume that Zygote prefers its own adjoint over the ChainRulesCore.rrule of AbstractFFTs (at least that is what I think I'm seeing).

Now the problem is that the two implementations differ (not just by the additional projection into the real domain, but by additional scaling factors) and give different results.
I haven't yet taken the time to figure out how the scaling factors in AbstractFFTs are motivated (unfortunately there's no comment that gives a hint), but finite differencing seems to agree with AbstractFFTs implementation and disagree with Zygote's.

Side question: Can I somehow tell Zygote to prefer the ChainRulesCore.rrule over its own @adjoint?

Metadata

Metadata

Assignees

No one assigned

    Labels

    ChainRulesadjoint -> rrule, and further integration

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions