-
Notifications
You must be signed in to change notification settings - Fork 69
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
Implement congruency check in EnzymeCore #637
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportPatch and project coverage have no change.
📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more Additional details and impacted files@@ Coverage Diff @@
## main #637 +/- ##
=======================================
Coverage 73.42% 73.42%
=======================================
Files 18 18
Lines 6906 6906
=======================================
Hits 5071 5071
Misses 1835 1835 Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report in Codecov by Sentry. |
lib/EnzymeCore/src/EnzymeCore.jl
Outdated
@warn """ | ||
Due to a bug in Julia (until 1.6.5 and 1.7.1), setting preferences in transitive dependencies | ||
is broken (https://github.com/JuliaPackaging/Preferences.jl/issues/24). To fix this either update | ||
your version of Julia, or add EnzyemCore as a direct dependency to your project. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rename EnzymeCore ? (typo)
@@ -61,6 +83,10 @@ accumulator for gradients (so ``\\partial f / \\partial x`` will be *added to*) | |||
struct Duplicated{T} <: Annotation{T} | |||
val::T | |||
dval::T | |||
function Duplicated(val::T, dval::T; checked=structure_check) where T |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if the preference isn't there, will this be a static no check, or will it load a global then check?
If the latter, I want to have a way to avoid the performance penalty.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a global const so it's propagated (and it's a compile time preference)
Fixes #636
The goal is to check on construction of Duplicated that the shadows are structurally equivalent
and thus the reverse pass does not "index past the array".