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

Make staged primitive rules possible #437

Merged
merged 9 commits into from
Jan 6, 2025

Conversation

willtebbutt
Copy link
Member

@willtebbutt willtebbutt commented Jan 6, 2025

This will put the infrastructure in place to make it possible to resolve (the known problems in) #427 . It will also make it possible to move a range of other computations from rule-runtime to rule-compile time, which will reduce our dependence on constant propagation / type inference misuse, and reduce our use of generated functions further.

Before merging, I'm going to add docs.

Related (?): #403

Copy link
Contributor

github-actions bot commented Jan 6, 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 │ Mooncake │  Zygote │ ReverseDiff │  Enzyme │
│                     String │   String │  String │      String │  String │
├────────────────────────────┼──────────┼─────────┼─────────────┼─────────┤
│                   sum_1000 │     87.0 │     1.1 │        5.51 │    8.31 │
│                  _sum_1000 │     6.61 │  1340.0 │        33.8 │    1.09 │
│               sum_sin_1000 │     2.26 │    1.67 │        10.5 │    1.98 │
│              _sum_sin_1000 │     2.68 │   241.0 │        13.3 │    2.45 │
│                   kron_sum │     62.4 │    3.51 │       223.0 │    7.98 │
│              kron_view_sum │     21.8 │     3.2 │        76.0 │    33.7 │
│      naive_map_sin_cos_exp │     2.52 │ missing │        7.56 │    2.33 │
│            map_sin_cos_exp │      2.8 │    1.46 │        6.12 │    2.91 │
│      broadcast_sin_cos_exp │     2.55 │    2.27 │        1.48 │    2.26 │
│                 simple_mlp │     7.43 │    3.12 │        12.2 │     3.6 │
│                     gp_lml │     13.2 │    6.98 │     missing │    8.79 │
│ turing_broadcast_benchmark │     3.18 │ missing │        25.6 │ missing │
│         large_single_block │     4.53 │  4240.0 │        32.0 │    2.24 │
└────────────────────────────┴──────────┴─────────┴─────────────┴─────────┘

Copy link

codecov bot commented Jan 6, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Files with missing lines Coverage Δ
src/Mooncake.jl 100.00% <100.00%> (ø)
src/interpreter/s2s_reverse_mode_ad.jl 94.31% <100.00%> (+0.03%) ⬆️

@willtebbutt willtebbutt merged commit f9618e5 into main Jan 6, 2025
70 of 71 checks passed
@willtebbutt willtebbutt deleted the wct/make-build-primitive-rrule-possible branch January 6, 2025 22:55
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.

1 participant