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

Prevent Stack Overflow #309

Merged
merged 2 commits into from
Oct 22, 2024
Merged

Prevent Stack Overflow #309

merged 2 commits into from
Oct 22, 2024

Conversation

willtebbutt
Copy link
Member

@willtebbutt willtebbutt commented Oct 22, 2024

Resolves a problem that @sunxd3 encountered when generating a large unrolled IR.

I've yet to produce a MWR, but will attempt to do so before merging. @sunxd3 could you run this branch on your problem to confirm that it indeed resolves the issue? (it does on my machine, I'm just keen to ensure that it does also on other machines)

edit: I do not understand why this resolves the problem. Presumably there is some limitation of vcat(x...) that tends not to be hit.

Copy link

codecov bot commented Oct 22, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Files with missing lines Coverage Δ
src/interpreter/s2s_reverse_mode_ad.jl 92.65% <100.00%> (ø)

Copy link
Contributor

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 │     69.7 │      1.0 │         5.5 │ missing │
│                  _sum_1000 │     6.76 │ 339000.0 │        33.1 │ missing │
│               sum_sin_1000 │     2.29 │     1.73 │        10.6 │ missing │
│              _sum_sin_1000 │     2.75 │    243.0 │        13.8 │ missing │
│                   kron_sum │     60.1 │     5.47 │       213.0 │ missing │
│              kron_view_sum │     21.3 │     3.49 │        87.2 │ missing │
│      naive_map_sin_cos_exp │     2.56 │  missing │        7.33 │ missing │
│            map_sin_cos_exp │     2.78 │     1.43 │        6.16 │ missing │
│      broadcast_sin_cos_exp │     3.08 │     3.04 │        1.46 │ missing │
│                 simple_mlp │     4.56 │     2.03 │        9.97 │ missing │
│                     gp_lml │     4.43 │     2.21 │     missing │ missing │
│ turing_broadcast_benchmark │     3.85 │  missing │        24.8 │ missing │
│         large_single_block │     4.15 │   3910.0 │        31.1 │ missing │
└────────────────────────────┴──────────┴──────────┴─────────────┴─────────┘

@sunxd3
Copy link
Collaborator

sunxd3 commented Oct 22, 2024

can confirm that the fix works, thanks

@willtebbutt
Copy link
Member Author

Excellent. Since I really don't have any idea how to construct a MWE, and I don't have the time to dig around at the minute, I'm going to merge + tag this. If a similar problem appears, I'll try harder to great a MWE to tie it down.

@willtebbutt willtebbutt merged commit 77d1cec into main Oct 22, 2024
21 checks passed
@willtebbutt willtebbutt deleted the wct/stack-overflow-large-code branch October 22, 2024 14:50
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