SymbolicML / DynamicExpressions.jl

Ridiculously fast symbolic expressions
https://symbolicml.org/DynamicExpressions.jl/dev
Apache License 2.0
90 stars 11 forks source link

Lazily load Zygote.jl for faster TTL #37

Closed MilesCranmer closed 10 months ago

MilesCranmer commented 1 year ago

This will only load Zygote.jl when autodiff is enabled.

The big remaining TTL contributor is LoopVectorization.jl (direct) and VectorizationBase.jl (indirect), which are also optional. However, since LoopVectorization.jl is used for a macro, I'm not sure whether it can be loaded lazily?

github-actions[bot] commented 1 year ago

Benchmark Results

master 2feaf5d68207ff... t[master]/t[2feaf5d68207ff...]
eval/ComplexF32/evaluation 10.2 ± 0.67 ms 10.1 ± 0.58 ms 1
eval/ComplexF64/evaluation 12 ± 0.86 ms 11.7 ± 0.77 ms 1.02
eval/Float32/derivative 17.7 ± 3.4 ms 1.91 ± 0.038 s 0.00927
eval/Float32/derivative_turbo 18.7 ± 3.6 ms 1.92 ± 0.034 s 0.00976
eval/Float32/evaluation 3.48 ± 0.26 ms 3.43 ± 0.28 ms 1.01
eval/Float32/evaluation_turbo 0.782 ± 0.045 ms 0.746 ± 0.038 ms 1.05
eval/Float64/derivative 24.7 ± 0.95 ms 1.9 ± 0.035 s 0.013
eval/Float64/derivative_turbo 26.4 ± 0.97 ms 1.92 ± 0.0032 s 0.0138
eval/Float64/evaluation 3.56 ± 0.27 ms 3.57 ± 0.26 ms 0.998
eval/Float64/evaluation_turbo 1.21 ± 0.066 ms 1.15 ± 0.05 ms 1.05
time_to_load 1.94 ± 0.015 s 1.91 ± 0.011 s 1.02
utils/combine_operators/break_sharing 0.0626 ± 0.0036 ms 0.0591 ± 0.0038 ms 1.06
utils/convert/break_sharing 0.0479 ± 0.0037 ms 0.0499 ± 0.003 ms 0.96
utils/convert/preserve_sharing 0.225 ± 0.0057 ms 0.223 ± 0.0051 ms 1.01
utils/copy/break_sharing 0.0464 ± 0.0016 ms 0.0471 ± 0.0015 ms 0.985
utils/copy/preserve_sharing 0.221 ± 0.004 ms 0.22 ± 0.004 ms 1
utils/count_constants/break_sharing 26.5 ± 0.6 μs 26.9 ± 0.8 μs 0.985
utils/count_depth/break_sharing 28.2 ± 0.8 μs 28.6 ± 0.9 μs 0.986
utils/count_nodes/break_sharing 24.3 ± 0.6 μs 26.3 ± 0.7 μs 0.924
utils/get_set_constants!/break_sharing 0.104 ± 0.0016 ms 0.102 ± 0.0018 ms 1.01
utils/has_constants/break_sharing 9.2 ± 0.6 μs 8.68 ± 0.67 μs 1.06
utils/has_operators/break_sharing 2.14 ± 0.055 μs 2.44 ± 0.044 μs 0.877
utils/index_constants/break_sharing 0.0796 ± 0.0034 ms 0.0796 ± 0.0034 ms 1
utils/is_constant/break_sharing 8.72 ± 0.57 μs 8.82 ± 0.52 μs 0.989
utils/simplify_tree/break_sharing 0.166 ± 0.016 ms 0.167 ± 0.015 ms 0.99

Benchmark Plots

A plot of the benchmark results have been uploaded as an artifact to the workflow run for this PR. Go to "Actions"->"Benchmark a pull request"->[the most recent run]->"Artifacts" (at the bottom).

MilesCranmer commented 10 months ago

Already implemented with an extension

coveralls commented 4 months ago

Pull Request Test Coverage Report for Build 5100079381

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details


Changes Missing Coverage Covered Lines Changed/Added Lines %
src/EvaluateEquationDerivative.jl 7 9 77.78%
<!-- Total: 24 26 92.31% -->
Files with Coverage Reduction New Missed Lines %
src/EvaluateEquationDerivative.jl 7 89.8%
src/OperatorEnumConstruction.jl 9 89.38%
<!-- Total: 16 -->
Totals Coverage Status
Change from base Build 5095018727: 3.3%
Covered Lines: 928
Relevant Lines: 955

💛 - Coveralls