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

Re-test enzyme #53

Closed
wants to merge 4 commits into from
Closed

Re-test enzyme #53

wants to merge 4 commits into from

Conversation

Vaibhavdixit02
Copy link
Member

Checklist

  • Appropriate tests were added
  • Any code changes were done in a way that does not break public API
  • All documentation related to code changes were updated
  • The new code follows the
    contributor guidelines, in particular the SciML Style Guide and
    COLPRAC.
  • Any new documentation only uses public API

Additional context

Add any other context about the problem here.

@wsmoses
Copy link
Contributor

wsmoses commented May 31, 2024

@Vaibhavdixit02 can you open an issue with a MWE of the error. I'll try to get it quickly thereafter.

@wsmoses
Copy link
Contributor

wsmoses commented Jun 6, 2024

@Vaibhavdixit02 @ChrisRackauckas do you have a MWE (I didn't see one by chance). I'll try to get it fixed quickly

@Vaibhavdixit02
Copy link
Member Author

I literally mentioned this to Chris like 2 hours ago haha, we are on the same page. Would you be able to help review the sparse support here? I started the effort in the previous home for this code https://github.com/SciML/Optimization.jl/pull/688/files I'll revive that

@Vaibhavdixit02
Copy link
Member Author

Ref MWE let's see if the latest release still throws the same error first

@ChrisRackauckas
Copy link
Member

This is now blocking SciML/SciMLSensitivity.jl#1067

@wsmoses
Copy link
Contributor

wsmoses commented Jun 10, 2024

again, happy to help but need a MWE.

In interim just going to be plugging away at mixed activity stuff.

Project.toml Outdated Show resolved Hide resolved
@wsmoses
Copy link
Contributor

wsmoses commented Jun 11, 2024

bumping this

@Vaibhavdixit02
Copy link
Member Author

Vaibhavdixit02 commented Jun 11, 2024

I have been trying to recreate but ended up with a duplicated returns not handled error instead of the one on CI here - when running ]test this one does show up so it's kind of tricky to figure out a MWE. The issue happens in hessian of a out-of-place closure created here

fncs = map(1:num_cons) do i
function (x)
return f.cons(x, p)[i]
end
end
function f2(x, dx, fnc)
Enzyme.autodiff_deferred(Enzyme.Reverse, fnc, Enzyme.Duplicated(x, dx))
return nothing
end
I suspect the f2 is incorrect but have been unable to pin down the exact issue yet (I am still trying)

@wsmoses
Copy link
Contributor

wsmoses commented Jun 11, 2024

That implies type inference fails. Assuming the return is a float, that should likely be changed to the following to explicitly specify that the return is active (if type inference fails)

 function f2(x, dx, fnc) 
     Enzyme.autodiff_deferred(Enzyme.Reverse, fnc, Enzyme.Active, Enzyme.Duplicated(x, dx)) 
     return nothing 
 end 

test/adtests.jl Outdated Show resolved Hide resolved
@Vaibhavdixit02 Vaibhavdixit02 deleted the Vaibhavdixit02-patch-1 branch June 13, 2024 03:30
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.

3 participants