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 within autodiff cmd #1851

Merged
merged 6 commits into from
Sep 18, 2024
Merged

Add within autodiff cmd #1851

merged 6 commits into from
Sep 18, 2024

Conversation

wsmoses
Copy link
Member

@wsmoses wsmoses commented Sep 18, 2024

No description provided.

@wsmoses
Copy link
Member Author

wsmoses commented Sep 18, 2024

@aviatesk what's the right way to do this properly?

I think it's blocking for @avik-pal / @ChrisRackauckas

@wsmoses
Copy link
Member Author

wsmoses commented Sep 18, 2024

#1761

@aviatesk
Copy link
Contributor

If the overlay method table was available, that would be ideal. If that's still difficult, we might have to stick with the current implementation approach.

@wsmoses
Copy link
Member Author

wsmoses commented Sep 18, 2024

So as is this fails atm (presumably because Const prop happens before we can fix this?)

test/abi.jl Outdated
@@ -460,6 +460,11 @@ abssum(x) = sum(abs2, x);

mulsin(x) = sin(x[1] * x[2])

@testset "within_autodiff" begin
@test Enzyme.within_autodiff()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
@test Enzyme.within_autodiff()
@test !Enzyme.within_autodiff()

test/abi.jl Outdated
@@ -460,6 +460,11 @@ abssum(x) = sum(abs2, x);

mulsin(x) = sin(x[1] * x[2])

@testset "within_autodiff" begin
@test Enzyme.within_autodiff()
@test Enzyme.autodiff(ForwardWithPrimal, Enzyme.within_autodiff)[1]
Copy link
Member

@vchuravy vchuravy Sep 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This might need: Enzyme.autodiff(ForwardWithPrimal, ()->Enzyme.within_autodiff())[1]

Entry-points can often be weird.

src/Enzyme.jl Outdated Show resolved Hide resolved
@wsmoses wsmoses merged commit efbe9a1 into main Sep 18, 2024
10 of 26 checks passed
@wsmoses wsmoses deleted the wa branch September 18, 2024 21:37
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.

4 participants