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

Implement congruency check in EnzymeCore #637

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Conversation

vchuravy
Copy link
Member

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".

@vchuravy vchuravy marked this pull request as ready for review March 12, 2023 17:52
@codecov-commenter
Copy link

codecov-commenter commented Mar 12, 2023

Codecov Report

Patch and project coverage have no change.

Comparison is base (2ccf4b7) 73.42% compared to head (fceb201) 73.42%.

📣 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.
📢 Do you have feedback about the report comment? Let us know in this issue.

@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.
Copy link
Member

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
Copy link
Member

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.

Copy link
Member Author

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)

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.

Implement Congruent
3 participants