SymbolicML / DynamicExpressions.jl

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

Allow operator aliases #47

Closed MilesCranmer closed 10 months ago

MilesCranmer commented 10 months ago

This creates the empty_old_operators keyword to @extend_operators which effectively lets you prevent the call to empty!(LATEST_BINARY_OPERATOR_MAPPING), which means you can have multiple operators producing the same index. This is good for aliases like safe_pow and ^ meaning the same thing.

coveralls commented 10 months ago

Pull Request Test Coverage Report for Build 5771392058


Changes Missing Coverage Covered Lines Changed/Added Lines %
src/OperatorEnumConstruction.jl 18 20 90.0%
<!-- Total: 18 20 90.0% -->
Totals Coverage Status
Change from base Build 5734174311: 0.08%
Covered Lines: 1074
Relevant Lines: 1180

💛 - Coveralls
github-actions[bot] commented 10 months ago

Benchmark Results

master 580ed0fb0ca324... t[master]/t[580ed0fb0ca324...]
eval/ComplexF32/evaluation 11.1 ± 0.68 ms 11.1 ± 0.68 ms 1
eval/ComplexF64/evaluation 13.7 ± 0.87 ms 13.5 ± 0.96 ms 1.01
eval/Float32/derivative 17.4 ± 2.2 ms 16.7 ± 2.6 ms 1.04
eval/Float32/derivative_turbo 19.4 ± 2.2 ms 19.5 ± 2.5 ms 0.995
eval/Float32/evaluation 3.64 ± 0.28 ms 3.65 ± 0.3 ms 0.996
eval/Float32/evaluation_turbo 1.17 ± 0.062 ms 1.15 ± 0.06 ms 1.01
eval/Float64/derivative 20.3 ± 0.85 ms 20.6 ± 0.73 ms 0.985
eval/Float64/derivative_turbo 24.1 ± 0.72 ms 24 ± 0.73 ms 1
eval/Float64/evaluation 3.72 ± 0.31 ms 3.69 ± 0.28 ms 1.01
eval/Float64/evaluation_turbo 1.63 ± 0.077 ms 1.63 ± 0.082 ms 0.997
time_to_load 0.85 ± 0.0092 s 0.843 ± 0.0079 s 1.01
utils/combine_operators 0.0608 ± 0.0036 ms 0.0604 ± 0.0037 ms 1.01
utils/convert/break_sharing 0.05 ± 0.0054 ms 0.051 ± 0.0066 ms 0.979
utils/convert/preserve_sharing 0.235 ± 0.0092 ms 0.236 ± 0.01 ms 0.998
utils/copy/break_sharing 0.0487 ± 0.0041 ms 0.0491 ± 0.0045 ms 0.992
utils/copy/preserve_sharing 0.234 ± 0.008 ms 0.235 ± 0.0084 ms 0.994
utils/count_constants 26.1 ± 0.7 μs 26.2 ± 0.7 μs 0.996
utils/count_depth 29.6 ± 0.8 μs 28.4 ± 0.8 μs 1.04
utils/count_nodes 25.1 ± 0.7 μs 25.5 ± 0.7 μs 0.984
utils/get_set_constants! 0.103 ± 0.0023 ms 0.104 ± 0.0023 ms 0.999
utils/has_constants 7.43 ± 0.54 μs 7.15 ± 0.52 μs 1.04
utils/has_operators 2.43 ± 0.078 μs 2.16 ± 0.07 μs 1.13
utils/index_constants 0.0805 ± 0.0041 ms 0.0814 ± 0.0044 ms 0.989
utils/is_constant 6.99 ± 0.41 μs 7.63 ± 0.43 μs 0.915
utils/simplify_tree 0.172 ± 0.016 ms 0.179 ± 0.017 ms 0.96
utils/string_tree 0.366 ± 0.012 ms 0.368 ± 0.011 ms 0.994

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).