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

Fix merge_metadata for cases where the dimension of the variable changes #781

Merged
merged 8 commits into from
Jan 22, 2025

Conversation

mhauru
Copy link
Member

@mhauru mhauru commented Jan 21, 2025

The diff here is actually much simpler than it looks. The only real change in src/varinfo.jl is removing the line @assert length(vals_left) == length(vals_right), in the if vn in vns_left && vn in vns_right path. It's just that once you remove that line, you can simplify the surrounding code, because two of the if-paths become exactly identical and the third one nearly so.

I don't see any reason why we couldn't, when merging two metadata objects, merge just the same in the case where the dimension of some variable is different on the left and the right. I asked @torfjelde and he couldn't think of a reason either, but if someone else knows why the @assert was there in the first place, please say so.

This change would resolve TuringLang/Turing.jl#2472.

@mhauru mhauru requested a review from penelopeysm January 21, 2025 10:58
@coveralls
Copy link

coveralls commented Jan 21, 2025

Pull Request Test Coverage Report for Build 12885489364

Details

  • 13 of 13 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-12.6%) to 73.721%

Totals Coverage Status
Change from base Build 12812100099: -12.6%
Covered Lines: 3156
Relevant Lines: 4281

💛 - Coveralls

Copy link

codecov bot commented Jan 21, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 86.16%. Comparing base (938a69d) to head (0547f1b).
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #781      +/-   ##
==========================================
- Coverage   86.25%   86.16%   -0.10%     
==========================================
  Files          36       36              
  Lines        4330     4301      -29     
==========================================
- Hits         3735     3706      -29     
  Misses        595      595              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@coveralls
Copy link

coveralls commented Jan 21, 2025

Pull Request Test Coverage Report for Build 12907177100

Details

  • 13 of 13 (100.0%) changed or added relevant lines in 1 file are covered.
  • 3 unchanged lines in 1 file lost coverage.
  • Overall coverage decreased (-0.09%) to 86.246%

Files with Coverage Reduction New Missed Lines %
src/varinfo.jl 3 83.87%
Totals Coverage Status
Change from base Build 12812100099: -0.09%
Covered Lines: 3706
Relevant Lines: 4297

💛 - Coveralls

Copy link
Member

@penelopeysm penelopeysm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm 👍

@mhauru
Copy link
Member Author

mhauru commented Jan 21, 2025

Thanks @penelopeysm. I'll give this a few hours to see if anyone who knows the old code wants to rush in shouting "STOP THE MERGE".

@mhauru mhauru added this pull request to the merge queue Jan 21, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jan 21, 2025
@penelopeysm penelopeysm added this pull request to the merge queue Jan 21, 2025
@penelopeysm
Copy link
Member

Weird. The only difference between the runs is that ADTypes was upgraded from 1.11.0 to 1.12.0, which was a change to AutoFiniteDiff that isn't used anywhere in our code.

@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jan 21, 2025
@penelopeysm
Copy link
Member

OK, I found that KernelAbstractions.jl also got bumped from 0.9.31 to 0.9.32, and I think it's this JuliaGPU/KernelAbstractions.jl#551 that broke our code.

It seems that for now a suitable solution is to pin the version of KernelAbstractions (we should do this in the toplevel Project.toml, not just the test one, because with the newer version JET will infer an untyped varinfo when it's not really needed). I tested locally and can confirm that this fixes the failing test.

Longer term we should make a smaller repro and post an upstream issue.

@penelopeysm penelopeysm mentioned this pull request Jan 21, 2025
Project.toml Outdated Show resolved Hide resolved
Copy link
Member

@penelopeysm penelopeysm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ell gee tee em

Project.toml Outdated Show resolved Hide resolved
@penelopeysm penelopeysm enabled auto-merge January 22, 2025 11:25
@penelopeysm penelopeysm added this pull request to the merge queue Jan 22, 2025
Merged via the queue into master with commit 727da63 Jan 22, 2025
21 checks passed
@penelopeysm penelopeysm deleted the mhauru/merge-metadata-diff-dims branch January 22, 2025 12:36
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.

3 participants