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

Add common interface for pullback functions #72

Closed
adrhill opened this issue Mar 19, 2024 · 2 comments · Fixed by #137
Closed

Add common interface for pullback functions #72

adrhill opened this issue Mar 19, 2024 · 2 comments · Fixed by #137
Assignees
Labels
core Related to the core utilities of the package test Related to the testing subpackage

Comments

@adrhill
Copy link
Collaborator

adrhill commented Mar 19, 2024

Reverse-mode backends like Zygote and Enzyme (?) are able to return pullback functions / closures instead of just the return value of the pullback, which is currently returned by value_and_pullback!.

DI could offer a common interface value_and_pullback_fn (or a mutating value_and_pullback!_fn) for users in need of such closures.

@gdalle
Copy link
Member

gdalle commented Mar 19, 2024

At first I thought we would be able to pull this off with the prepare mechanism, but now I see that prepare is specific for different inputs, whereas we reuse a pullback for the same input. So you have my go ahead ^^

@gdalle
Copy link
Member

gdalle commented Mar 19, 2024

Here's what I spotted:

Forward mode

Reverse mode

@gdalle gdalle added enhancement core Related to the core utilities of the package test Related to the testing subpackage and removed enhancement labels Mar 28, 2024
@gdalle gdalle linked a pull request Apr 4, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Related to the core utilities of the package test Related to the testing subpackage
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants