-
Notifications
You must be signed in to change notification settings - Fork 13
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
Switch backends to ADTypes.jl #28
Conversation
Benchmark resultJudge resultBenchmark Report for /home/runner/work/DifferentiationInterface.jl/DifferentiationInterface.jlJob Properties
ResultsA ratio greater than
Benchmark Group ListHere's a list of all the benchmark groups executed by this job: Julia versioninfoTarget
Baseline
Target resultBenchmark Report for /home/runner/work/DifferentiationInterface.jl/DifferentiationInterface.jlJob Properties
ResultsBelow is a table of this job's results, obtained by running the benchmarks.
Benchmark Group ListHere's a list of all the benchmark groups executed by this job:
Julia versioninfo
Baseline resultBenchmark Report for /home/runner/work/DifferentiationInterface.jl/DifferentiationInterface.jlJob Properties
ResultsBelow is a table of this job's results, obtained by running the benchmarks.
Benchmark Group ListHere's a list of all the benchmark groups executed by this job:
Julia versioninfo
Runtime information
|
Benchmark resultJudge resultBenchmark Report for /home/runner/work/DifferentiationInterface.jl/DifferentiationInterface.jlJob Properties
ResultsA ratio greater than
Benchmark Group ListHere's a list of all the benchmark groups executed by this job: Julia versioninfoTarget
Baseline
Target resultBenchmark Report for /home/runner/work/DifferentiationInterface.jl/DifferentiationInterface.jlJob Properties
ResultsBelow is a table of this job's results, obtained by running the benchmarks.
Benchmark Group ListHere's a list of all the benchmark groups executed by this job:
Julia versioninfo
Baseline resultBenchmark Report for /home/runner/work/DifferentiationInterface.jl/DifferentiationInterface.jlJob Properties
ResultsBelow is a table of this job's results, obtained by running the benchmarks.
Benchmark Group ListHere's a list of all the benchmark groups executed by this job:
Julia versioninfo
Runtime information
|
New proposal here: Core
Basically this is like putting it in Backend-specific
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #28 +/- ##
==========================================
+ Coverage 90.61% 96.17% +5.56%
==========================================
Files 19 21 +2
Lines 341 340 -1
==========================================
+ Hits 309 327 +18
+ Misses 32 13 -19 ☔ View full report in Codecov by Sentry. |
Benchmark resultJudge resultBenchmark Report for /home/runner/work/DifferentiationInterface.jl/DifferentiationInterface.jlJob Properties
ResultsA ratio greater than
Benchmark Group ListHere's a list of all the benchmark groups executed by this job: Julia versioninfoTarget
Baseline
Target resultBenchmark Report for /home/runner/work/DifferentiationInterface.jl/DifferentiationInterface.jlJob Properties
ResultsBelow is a table of this job's results, obtained by running the benchmarks.
Benchmark Group ListHere's a list of all the benchmark groups executed by this job:
Julia versioninfo
Baseline resultBenchmark Report for /home/runner/work/DifferentiationInterface.jl/DifferentiationInterface.jlJob Properties
ResultsBelow is a table of this job's results, obtained by running the benchmarks.
Benchmark Group ListHere's a list of all the benchmark groups executed by this job:
Julia versioninfo
Runtime information
|
I like this a lot. I agree with you on keeping implementations and Any thoughts on putting the function jacobian!(jac::AbstractMatrix, backend::AbstractBackend, f, x::AbstractArray)
return last(value_and_jacobian!(jac, backend, f, x))
function jacobian!(
implem::AbstractImplem,
jac::AbstractMatrix,
backend::AbstractADType,
f,
x::AbstractArray,
)
return last(value_and_jacobian!(implem, jac, backend, f, x))
end to a single method function jacobian!(
jac::AbstractMatrix,
backend::AbstractADType,
f,
x::AbstractArray,
args...
)
return last(value_and_jacobian!(jac, backend, f, x, args...))
end and has the additional benefit of making the mutated input the first argument. |
Yeah that's a good idea, I'll do that |
Benchmark resultJudge resultBenchmark Report for /home/runner/work/DifferentiationInterface.jl/DifferentiationInterface.jlJob Properties
ResultsA ratio greater than
Benchmark Group ListHere's a list of all the benchmark groups executed by this job: Julia versioninfoTarget
Baseline
Target resultBenchmark Report for /home/runner/work/DifferentiationInterface.jl/DifferentiationInterface.jlJob Properties
ResultsBelow is a table of this job's results, obtained by running the benchmarks.
Benchmark Group ListHere's a list of all the benchmark groups executed by this job:
Julia versioninfo
Baseline resultBenchmark Report for /home/runner/work/DifferentiationInterface.jl/DifferentiationInterface.jlJob Properties
ResultsBelow is a table of this job's results, obtained by running the benchmarks.
Benchmark Group ListHere's a list of all the benchmark groups executed by this job:
Julia versioninfo
Runtime information
|
Main idea
This reduces the number of LOCs in our package, and only moderately complexifies the custom/fallback mechanism.
Core
AutoChainRules
autodiff_mode(backend)
, because some backends from ADTypes.jl can do both (mostlyAutoEnzyme
)custom
type parameter with another trait-based dispatch:gradient(backend, f, x)
will call the version using custom package functionsgradient(Val(:fallback), backend, f, x)
will call our fallbacksNote: the
Val
-based traits can be replaced with custom structs if we wantTests
Docs
Benchmarks