-
Notifications
You must be signed in to change notification settings - Fork 5
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
Change to DifferentiationInterface #46
base: main
Are you sure you want to change the base?
Conversation
Looks good to me! |
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.
Thanks for doing this David, so rather minor things.
), | ||
) | ||
time_elapsed = @elapsed begin | ||
opt_stats = [] |
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 you want to avoid the abstract container (and map(identity,...)
below) you could move the first iteration out of the loop. Or define it unitialized with local opt_stats
here and set it in the i = 1
iteration, similar to
julia> function f(n::Int)
local out
i = 1
while i <= n
out = i == 1 ? [1] : [i + only(out)]
i += 1
end
return only(out)
end
julia> f(3)
6
ADTypes.AutoReverseDiff(false), | ||
ADTypes.AutoEnzyme(), | ||
ADTypes.AutoReverseDiff(; compile=false), | ||
ADTypes.AutoMooncake(; config=Mooncake.Config()), |
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.
Why remove the test with Enzyme?
ADTypes.AutoReverseDiff(false), | ||
# ADTypes.AutoEnzyme(), # not working now | ||
ADTypes.AutoReverseDiff(; compile = false), | ||
ADTypes.AutoMooncake(; config=Mooncake.Config()), |
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.
The test was working with Enzyme (and runtime activity) in https://github.com/TuringLang/NormalizingFlows.jl/pull/38/files.
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.
Maybe try with AutoEnzyme(mode=Enzyme.set_runtime_activity(Enzyme.Reverse))
?
@zuhengxu PR looks great, I can take over and finish integrating the reviews if you are busy |
Thank you all for the review and comments!
Hi @sunxd3, I'm bit busy before Thursday this week. It will be much appreciated if you can help to integrate some of the review! Otherwise I'll integrate them by this Friday. |
Co-authored-by: David Widmann <[email protected]>
Change the optimization interface to DifferentatiationInterface for easier switch/test between different AD systems.