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

Correctly handle PartialTypeVars in inference #305

Merged
merged 4 commits into from
Oct 22, 2024
Merged

Conversation

willtebbutt
Copy link
Member

@willtebbutt willtebbutt commented Oct 22, 2024

Should resolve the new problem in #282 .

Occasionally, the inference result associated to an SSA is Core.Compiler.PartialTypeVar. This means that inference has successfully determined that the SSA will be a TypeVar. More than that, it has figured out some of the runtime information about the SSA, in a similar sense (I believe) to the way that Core.Compiler.PartialStruct knows some runtime information about a given struct. I've asked on slack for a MWE of a function in which this is the result of inference. I'll wait a few hours, but will merge this with the current unit test if I nothing appears.

edit: many of the people who would know about this are based in the US. I'll get this merged asap, and make a new PR if an MWE becomes available.

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/abstract_interpretation.jl 83.05% <100.00%> (+0.29%) ⬆️

Copy link
Contributor

github-actions bot commented Oct 22, 2024

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.2 │     1.0 │         5.5 │ missing │
│                  _sum_1000 │     6.78 │  1190.0 │        37.0 │ missing │
│               sum_sin_1000 │     2.31 │    1.68 │        10.6 │ missing │
│              _sum_sin_1000 │     2.68 │   373.0 │        13.3 │ missing │
│                   kron_sum │     88.5 │    6.76 │       292.0 │ missing │
│              kron_view_sum │     58.9 │    9.48 │       242.0 │ missing │
│      naive_map_sin_cos_exp │     2.54 │ missing │        7.02 │ missing │
│            map_sin_cos_exp │     2.78 │    1.42 │        6.14 │ missing │
│      broadcast_sin_cos_exp │     2.57 │    2.25 │        1.45 │ missing │
│                 simple_mlp │     4.68 │    3.03 │        6.28 │ missing │
│                     gp_lml │     4.57 │    1.59 │     missing │ missing │
│ turing_broadcast_benchmark │     3.78 │ missing │        23.3 │ missing │
│         large_single_block │     4.13 │  4400.0 │        31.3 │ missing │
└────────────────────────────┴──────────┴─────────┴─────────────┴─────────┘

@willtebbutt willtebbutt merged commit c58457f into main Oct 22, 2024
21 checks passed
@willtebbutt willtebbutt deleted the wct/partial-typevar branch October 22, 2024 10:11
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