Skip to content
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

Avoid closure in tree_mapreduce #103

Merged
merged 10 commits into from
Oct 12, 2024
Merged

Avoid closure in tree_mapreduce #103

merged 10 commits into from
Oct 12, 2024

Conversation

MilesCranmer
Copy link
Member

@MilesCranmer MilesCranmer commented Oct 11, 2024

This refactors tree_mapreduce to avoid the use of boxed variables in a closure. I don't think this will affect performance, but it's just more readable.

This also avoids the use of @with_memoization in tree_mapreduce with was quite hard to understand.

This also sets the stage for n-arity operators.

Finally, this deprecates Julia versions earlier than 1.10 which are no longer maintained by Julia.

Copy link
Contributor

github-actions bot commented Oct 11, 2024

Benchmark Results

master 1cf33ed... master/1cf33ed0252fb5...
eval/ComplexF32/evaluation 7.3 ± 0.49 ms 7.4 ± 0.46 ms 0.987
eval/ComplexF64/evaluation 9.47 ± 0.72 ms 9.57 ± 0.74 ms 0.99
eval/Float32/derivative 10.7 ± 1.6 ms 10.9 ± 2 ms 0.988
eval/Float32/derivative_turbo 10.8 ± 1.7 ms 10.9 ± 2 ms 0.987
eval/Float32/evaluation 2.63 ± 0.24 ms 2.62 ± 0.22 ms 1
eval/Float32/evaluation_bumper 0.533 ± 0.012 ms 0.561 ± 0.014 ms 0.951
eval/Float32/evaluation_turbo 0.548 ± 0.024 ms 0.571 ± 0.029 ms 0.961
eval/Float32/evaluation_turbo_bumper 0.532 ± 0.013 ms 0.557 ± 0.013 ms 0.957
eval/Float64/derivative 14.2 ± 0.56 ms 14.7 ± 0.66 ms 0.963
eval/Float64/derivative_turbo 14.1 ± 0.56 ms 14.7 ± 0.78 ms 0.961
eval/Float64/evaluation 2.75 ± 0.24 ms 2.81 ± 0.24 ms 0.978
eval/Float64/evaluation_bumper 1.19 ± 0.043 ms 1.21 ± 0.044 ms 0.986
eval/Float64/evaluation_turbo 1.03 ± 0.056 ms 1.05 ± 0.056 ms 0.98
eval/Float64/evaluation_turbo_bumper 1.19 ± 0.042 ms 1.22 ± 0.044 ms 0.98
utils/combine_operators/break_sharing 0.0393 ± 0.0008 ms 0.0389 ± 0.00053 ms 1.01
utils/convert/break_sharing 22.6 ± 0.93 μs 23.2 ± 0.83 μs 0.978
utils/convert/preserve_sharing 0.122 ± 0.0024 ms 0.115 ± 0.0025 ms 1.06
utils/copy/break_sharing 23.3 ± 0.94 μs 24.4 ± 0.91 μs 0.956
utils/copy/preserve_sharing 0.124 ± 0.0025 ms 0.118 ± 0.0025 ms 1.05
utils/count_constant_nodes/break_sharing 11.7 ± 0.29 μs 9.02 ± 0.11 μs 1.3
utils/count_constant_nodes/preserve_sharing 0.109 ± 0.0026 ms 0.102 ± 0.0021 ms 1.07
utils/count_depth/break_sharing 12.6 ± 0.28 μs 10 ± 0.15 μs 1.26
utils/count_nodes/break_sharing 10.6 ± 0.3 μs 8.56 ± 0.11 μs 1.24
utils/count_nodes/preserve_sharing 0.109 ± 0.0024 ms 0.103 ± 0.0024 ms 1.06
utils/get_set_constants!/break_sharing 0.0342 ± 0.0012 ms 0.0344 ± 0.001 ms 0.994
utils/get_set_constants!/preserve_sharing 0.222 ± 0.0051 ms 0.211 ± 0.0054 ms 1.05
utils/get_set_constants_parametric 0.0478 ± 0.0018 ms 0.0486 ± 0.0015 ms 0.982
utils/has_constants/break_sharing 4.36 ± 0.06 μs 4.28 ± 0.055 μs 1.02
utils/has_operators/break_sharing 1.91 ± 0.023 μs 1.93 ± 0.019 μs 0.988
utils/hash/break_sharing 24.9 ± 0.63 μs 26 ± 0.56 μs 0.959
utils/hash/preserve_sharing 0.131 ± 0.0024 ms 0.122 ± 0.0029 ms 1.07
utils/index_constant_nodes/break_sharing 22.6 ± 0.73 μs 23.1 ± 0.73 μs 0.979
utils/index_constant_nodes/preserve_sharing 0.123 ± 0.0023 ms 0.115 ± 0.0023 ms 1.07
utils/is_constant/break_sharing 4.18 ± 0.066 μs 4.07 ± 0.058 μs 1.03
utils/simplify_tree/break_sharing 0.166 ± 0.0013 ms 0.174 ± 0.0014 ms 0.953
utils/simplify_tree/preserve_sharing 0.279 ± 0.0046 ms 0.276 ± 0.004 ms 1.01
utils/string_tree/break_sharing 0.536 ± 0.013 ms 0.536 ± 0.011 ms 1
utils/string_tree/preserve_sharing 0.664 ± 0.013 ms 0.661 ± 0.022 ms 1
time_to_load 0.242 ± 0.0043 s 0.263 ± 0.0015 s 0.923

@coveralls
Copy link

Pull Request Test Coverage Report for Build 11300259073

Details

  • 20 of 20 (100.0%) changed or added relevant lines in 1 file are covered.
  • 20 unchanged lines in 4 files lost coverage.
  • Overall coverage decreased (-0.5%) to 95.357%

Files with Coverage Reduction New Missed Lines %
src/OperatorEnumConstruction.jl 1 95.19%
src/precompile.jl 2 87.5%
src/EvaluateDerivative.jl 4 88.0%
src/Evaluate.jl 13 94.75%
Totals Coverage Status
Change from base Build 11221646120: -0.5%
Covered Lines: 2403
Relevant Lines: 2520

💛 - Coveralls

@MilesCranmer MilesCranmer merged commit 6b9fb86 into master Oct 12, 2024
16 checks passed
@MilesCranmer MilesCranmer deleted the cleaner-treemapreduce branch October 12, 2024 01:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants