Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Implement AD testing and benchmarking (with DITest) #883
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 AD testing and benchmarking (with DITest) #883
Changes from all commits
0aedf08
4539a80
70e1aa9
e1a34e1
236f279
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
One alternative is to overload
DI.test_differentiation
so we can tweakadtype
internally.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.
DIT.Scenario doesn't contain a type parameter that we can dispatch on, though.
(While putting the ADTests bit together, I also found out that Scenarios can't be prepared with a specific value of
x
: JuliaDiff/DifferentiationInterface.jl#771)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.
I guess we could do something like
test_differentiation(..., ::DynamicPPL.Model, ::AbstractADType, ...)
and have that construct the scenarioThere 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.
I like this idea. One could have both
test_differentiation(..., ::DynamicPPL.Model, ::AbstractADType, ...)
benchmark_differentiation(..., ::DynamicPPL.Model, ::AbstractADType, ...)
Having unified interfaces across DI and Turing for these autodiff tests would be nice.
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.
Please keep in mind that DIT was designed mostly to test DI itself, so its interface is still rather dirty and unstable. Also,
DIT.test_differentiation
does way more than you probably need here. But if there is interest in standardization, we can take a lookThere 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, @gdalle, for the context.
It is an excellent idea to improve DIT so it can become a community resource like DI. It's very helpful to have a standard interface where
It would help the autodiff dev community discover bugs more quickly. It would also inform the general users which AD backend is likely compatible with the library (e.g. Lux, Turing) they want to use (see, e.g. https://turinglang.org/ADTests/)
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.
DIT is in the weird position where it simultaneously does much more than what we need and also doesn't do some of the things we need. I've said this elsewhere (in meetings etc) but this isn't a criticism of DIT, it's just about choosing the right tool for the job IMO.