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

Initial Work on Performance Patches #458

Merged
merged 26 commits into from
Feb 12, 2025
Merged

Initial Work on Performance Patches #458

merged 26 commits into from
Feb 12, 2025

Conversation

willtebbutt
Copy link
Member

@willtebbutt willtebbutt commented Feb 4, 2025

This PR starts to address #249 . In particular it

  1. sets up conventions which ought to be followed for how these rules are to be incorporated into Mooncake, and
  2. adds some initial rules.

This will make a couple of specific cases more performant, and make it possible for others to contribute rules that they would like to see in Mooncake.jl.

Copy link

codecov bot commented Feb 4, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Files with missing lines Coverage Δ
src/Mooncake.jl 100.00% <ø> (ø)
src/interpreter/abstract_interpretation.jl 87.50% <100.00%> (-1.24%) ⬇️
src/interpreter/ir_utils.jl 87.50% <100.00%> (ø)
src/rrules/performance_patches.jl 100.00% <100.00%> (ø)
src/test_utils.jl 93.07% <100.00%> (ø)

... and 1 file with indirect coverage changes

Copy link
Contributor

github-actions bot commented Feb 4, 2025

Performance Ratio:
Ratio of time to compute gradient and time to compute function.
Warning: results are very approximate! See here for more context.

┌────────────────────────────┬──────────┬──────────┬─────────┬─────────────┬─────────┐
│                      Label │   Primal │ Mooncake │  Zygote │ ReverseDiff │  Enzyme │
│                     String │   String │   String │  String │      String │  String │
├────────────────────────────┼──────────┼──────────┼─────────┼─────────────┼─────────┤
│                   sum_1000 │ 100.0 ns │      1.8 │     1.1 │         5.5 │    8.21 │
│                  _sum_1000 │ 941.0 ns │     6.76 │  1420.0 │        33.5 │    1.07 │
│               sum_sin_1000 │  6.55 μs │     2.22 │    1.68 │        10.5 │    1.99 │
│              _sum_sin_1000 │  5.17 μs │     2.69 │   257.0 │        13.6 │    2.45 │
│                   kron_sum │ 267.0 μs │     49.5 │    12.2 │       263.0 │    10.3 │
│              kron_view_sum │ 614.0 μs │     22.7 │    5.12 │       125.0 │    49.3 │
│      naive_map_sin_cos_exp │  2.14 μs │     2.19 │ missing │        7.21 │    2.34 │
│            map_sin_cos_exp │  2.12 μs │      2.4 │    1.45 │        6.11 │    2.92 │
│      broadcast_sin_cos_exp │  2.25 μs │     2.26 │    2.27 │        1.49 │    2.27 │
│                 simple_mlp │ 413.0 μs │     4.84 │     3.1 │        6.71 │     3.5 │
│                     gp_lml │ 546.0 μs │     4.74 │     2.4 │     missing │    2.17 │
│ turing_broadcast_benchmark │  2.03 ms │     3.17 │ missing │        27.1 │ missing │
│         large_single_block │ 390.0 ns │     4.03 │  4440.0 │        31.3 │    2.18 │
└────────────────────────────┴──────────┴──────────┴─────────┴─────────────┴─────────┘

@willtebbutt
Copy link
Member Author

Something unfortunate is happening with some allocation checking functionality. It's not really related to the main bit of this PR, but I'll need to fix it before merging.

@willtebbutt willtebbutt mentioned this pull request Feb 6, 2025
3 tasks
@willtebbutt
Copy link
Member Author

Latest commit purely contains changes to comments, so I'm going to merge as soon as the quality checks pass.

@willtebbutt willtebbutt merged commit 1989387 into main Feb 12, 2025
71 of 72 checks passed
@willtebbutt willtebbutt deleted the wct/perf branch February 12, 2025 12:25
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