-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: move overrides into a separate file (#379)
* refactor: move overrides into a separate file * fix: traced_getfield move to TracedUtils * refactor: rename to overlay * ci: increase build time allowance * Revert "fix: traced_getfield move to TracedUtils" This reverts commit f35d911.
- Loading branch information
Showing
5 changed files
with
30 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# NOTE: We are placing all the reactant_overrides here to avoid incompatibilities with | ||
# Revise.jl. Essentially files that contain reactant_overrides cannot be revised | ||
# correctly. Once that (https://github.com/timholy/Revise.jl/issues/646) is resolved | ||
# we should move all the reactant_overrides to relevant files. | ||
|
||
# Compiling within a compile should return simply the original function | ||
@reactant_overlay function Compiler.compile( | ||
f, args; client=nothing, optimize=true, sync=false | ||
) | ||
return f | ||
end | ||
|
||
# Enzyme overrides | ||
@reactant_overlay @noinline function Enzyme.autodiff_deferred( | ||
rmode::Enzyme.Mode, f::FA, rt::Type{A}, args::Vararg{Annotation,Nargs} | ||
) where {FA<:Annotation,A<:Annotation,Nargs} | ||
return overload_autodiff(rmode, f, rt, args...) | ||
end | ||
|
||
@reactant_overlay @noinline function Enzyme.autodiff( | ||
rmode::Enzyme.Mode, f::FA, rt::Type{A}, args::Vararg{Annotation,Nargs} | ||
) where {FA<:Annotation,A<:Annotation,Nargs} | ||
return overload_autodiff(rmode, f, rt, args...) | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters