SymbolicML / DynamicExpressions.jl

Ridiculously fast symbolic expressions
https://ai.damtp.cam.ac.uk/dynamicexpressions
Apache License 2.0
106 stars 15 forks source link

feat!: simplify expression optimization routine #70

Closed MilesCranmer closed 6 months ago

MilesCranmer commented 6 months ago

This is a breaking change as these functions are exported. However they are really overcomplicating things so its better to just have Ref(node) rather than a separate Ref-like struct.

This also should fix the type stability issue seen in SymbolicRegression.jl

github-actions[bot] commented 6 months ago

Benchmark Results

master 8d7f0000535852... master/8d7f0000535852...
eval/ComplexF32/evaluation 7.4 ± 0.47 ms 7.41 ± 0.49 ms 0.999
eval/ComplexF64/evaluation 9.65 ± 0.63 ms 9.62 ± 0.65 ms 1
eval/Float32/derivative 10.6 ± 1.6 ms 10.7 ± 1.6 ms 0.986
eval/Float32/derivative_turbo 10.6 ± 1.6 ms 10.8 ± 1.6 ms 0.988
eval/Float32/evaluation 2.72 ± 0.22 ms 2.76 ± 0.22 ms 0.985
eval/Float32/evaluation_bumper 0.533 ± 0.013 ms 0.534 ± 0.013 ms 0.999
eval/Float32/evaluation_turbo 0.689 ± 0.026 ms 0.688 ± 0.026 ms 1
eval/Float32/evaluation_turbo_bumper 0.528 ± 0.012 ms 0.53 ± 0.013 ms 0.995
eval/Float64/derivative 13.9 ± 0.47 ms 13.7 ± 0.62 ms 1.01
eval/Float64/derivative_turbo 14 ± 0.63 ms 13.7 ± 0.59 ms 1.01
eval/Float64/evaluation 2.89 ± 0.23 ms 2.89 ± 0.24 ms 1
eval/Float64/evaluation_bumper 1.19 ± 0.043 ms 1.21 ± 0.043 ms 0.99
eval/Float64/evaluation_turbo 1.18 ± 0.057 ms 1.18 ± 0.058 ms 1
eval/Float64/evaluation_turbo_bumper 1.19 ± 0.045 ms 1.21 ± 0.043 ms 0.987
utils/combine_operators/break_sharing 0.0409 ± 0.0012 ms 0.0411 ± 0.0013 ms 0.993
utils/convert/break_sharing 28.4 ± 0.82 μs 28.1 ± 0.82 μs 1.01
utils/convert/preserve_sharing 0.128 ± 0.0027 ms 0.128 ± 0.0023 ms 0.999
utils/copy/break_sharing 29.5 ± 0.85 μs 28.9 ± 0.86 μs 1.02
utils/copy/preserve_sharing 0.128 ± 0.0027 ms 0.128 ± 0.0024 ms 0.998
utils/count_constants/break_sharing 11 ± 0.17 μs 11.5 ± 0.18 μs 0.957
utils/count_constants/preserve_sharing 0.112 ± 0.0021 ms 0.112 ± 0.0022 ms 1
utils/count_depth/break_sharing 17.4 ± 0.37 μs 17.3 ± 0.38 μs 1.01
utils/count_nodes/break_sharing 10.2 ± 0.16 μs 10.3 ± 0.15 μs 0.987
utils/count_nodes/preserve_sharing 0.114 ± 0.0021 ms 0.114 ± 0.0022 ms 0.998
utils/get_set_constants!/break_sharing 0.0521 ± 0.00074 ms 0.0526 ± 0.0008 ms 0.99
utils/get_set_constants!/preserve_sharing 0.322 ± 0.006 ms 0.322 ± 0.0058 ms 0.998
utils/has_constants/break_sharing 4.58 ± 0.22 μs 4.35 ± 0.21 μs 1.05
utils/has_operators/break_sharing 1.94 ± 0.021 μs 1.77 ± 0.019 μs 1.1
utils/hash/break_sharing 30.2 ± 0.4 μs 29.7 ± 0.42 μs 1.02
utils/hash/preserve_sharing 0.132 ± 0.0021 ms 0.132 ± 0.0021 ms 1
utils/index_constants/break_sharing 27.8 ± 0.59 μs 27.4 ± 0.62 μs 1.02
utils/index_constants/preserve_sharing 0.13 ± 0.0026 ms 0.13 ± 0.0023 ms 1
utils/is_constant/break_sharing 4.7 ± 0.21 μs 4.76 ± 0.21 μs 0.987
utils/simplify_tree/break_sharing 0.191 ± 0.017 ms 0.176 ± 0.016 ms 1.08
utils/simplify_tree/preserve_sharing 0.297 ± 0.018 ms 0.295 ± 0.017 ms 1
utils/string_tree/break_sharing 0.508 ± 0.012 ms 0.501 ± 0.012 ms 1.01
utils/string_tree/preserve_sharing 0.645 ± 0.015 ms 0.639 ± 0.015 ms 1.01
time_to_load 0.19 ± 0.0026 s 0.19 ± 0.00075 s 1
coveralls commented 6 months ago

Pull Request Test Coverage Report for Build 8862723761

Details


Totals Coverage Status
Change from base Build 7996123220: 0.03%
Covered Lines: 1610
Relevant Lines: 1700

💛 - Coveralls