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

Unexpected zero derivative #1304

Closed
swilliamson7 opened this issue Feb 21, 2024 · 2 comments
Closed

Unexpected zero derivative #1304

swilliamson7 opened this issue Feb 21, 2024 · 2 comments

Comments

@swilliamson7
Copy link
Collaborator

Not sure if this is an Enzyme issue or a my code issue, but Enzyme is returning a zero where I would expect a non-zero value. I'm using Checkpointing + Enzyme to try and compute a derivative of a cost function w.r.t. a specific parameter, and running this script will attempt to do it. It successfully runs, the relevant variables in the output structures S and dS are S.parameters.J (this is the total value of the cost function), and dS.parameters.\gamma\_0 (this is the derivative I want). I did a finite difference calculation to find the derivative and I really think it shouldn't be zero, so I'm not quite sure what's happening.

Happy to provide more info if needed!

@swilliamson7
Copy link
Collaborator Author

An update to this, I think the zero is happening because the initial derivative is being chosen incorrectly/something is happening with the initial derivative. This could fall under either Enzyme or Checkpointing, I'm not sure which is causing it, but I get a correct non-zero value if I modify my code slightly so it's not quite a full issue

@wsmoses
Copy link
Member

wsmoses commented May 7, 2024

@swilliamson7 I assume this is resolved by our debug session earlier? Please reopen if not

@wsmoses wsmoses closed this as completed May 7, 2024
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

No branches or pull requests

2 participants