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

Improve AD module #176

Merged
merged 7 commits into from
Dec 4, 2024
Merged

Improve AD module #176

merged 7 commits into from
Dec 4, 2024

Conversation

omlins
Copy link
Owner

@omlins omlins commented Oct 29, 2024

No description provided.

@omlins
Copy link
Owner Author

omlins commented Oct 30, 2024

@vchuravy / @aelligp : concerning your previous contribution, could you please tell me why for example here g! is not promoted to Const(g!) either by you're promotion function or enzyme itself (here in the documentation f is not annotated):

Enzyme.autodiff_deferred(Enzyme.Reverse, g!, Const, DuplicatedNoNeed(A_ref, Ā_ref), DuplicatedNoNeed(B_ref, B̄_ref), Const(a))`

(I changed it back in the test. This is why the CI fails)

@vchuravy
Copy link
Contributor

IIRC Enzyme no longer auto-promotes arguments, it might still take functions to be Const, but I am afk so I can't double-check.

args = promote_to_const(args...)

The custom promotion is only applied to the splatted in args and not the first arg which likely is the function.

@omlins omlins merged commit bb60399 into main Dec 4, 2024
8 checks passed
@omlins omlins deleted the ad branch December 4, 2024 17:36
@omlins
Copy link
Owner Author

omlins commented Dec 5, 2024

IIRC Enzyme no longer auto-promotes arguments, it might still take functions to be Const, but I am afk so I can't double-check.

args = promote_to_const(args...)

The custom promotion is only applied to the splatted in args and not the first arg which likely is the function.

Thanks for your reply @vchuravy !

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

Successfully merging this pull request may close these issues.

2 participants