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 indices dim check in gather_update_outputs #2149

Merged
merged 1 commit into from
Aug 12, 2024

Conversation

laggui
Copy link
Member

@laggui laggui commented Aug 9, 2024

Checklist

  • Confirmed that run-checks all script has been executed.

Related Issues/PRs

We missed a little something in PR #2141

Changes

Updated gather_update_outputs to accept scalar argtype when checking for indices dim.

@laggui laggui requested review from antimora and mepatrick73 August 9, 2024 18:48
@laggui
Copy link
Member Author

laggui commented Aug 9, 2024

@hexd0t you can also review since you contributed the last PR

Copy link
Collaborator

@antimora antimora left a comment

Choose a reason for hiding this comment

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

LGTM

@hexd0t
Copy link
Contributor

hexd0t commented Aug 9, 2024

LGTM, although I'm not sure why the gather_scalar-Test I had added didn't fail?

Also, in the ONNX model I'm currently trying, I get Tensor(TensorType { elem_type: Int64, dim: 0, shape: Some([]) }) instead of Scalars at this point (which I understand burn doesn't really want to have anyways), stemming from an ONNX constant:

{932218F8-3BB2-4A5E-9711-9F211F9FDBBA}

Copy link

codecov bot commented Aug 9, 2024

Codecov Report

Attention: Patch coverage is 57.14286% with 3 lines in your changes missing coverage. Please review.

Project coverage is 86.21%. Comparing base (5a0c1dc) to head (c7db6b8).
Report is 1 commits behind head on main.

Files Patch % Lines
crates/onnx-ir/src/dim_inference.rs 57.14% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2149      +/-   ##
==========================================
- Coverage   86.22%   86.21%   -0.01%     
==========================================
  Files         694      694              
  Lines       88754    88755       +1     
==========================================
  Hits        76524    76524              
- Misses      12230    12231       +1     

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

@laggui
Copy link
Member Author

laggui commented Aug 9, 2024

Seems like the model generated for the test actually is a TensorType with dim 0 and not a scalar type.

The error was reported to me by a user, and in his case the node received a ScalarType, hence the addition in this PR.

I didn't have time to check why in one case it remained a tensor type with dim 0 while the other was converted to a scalar type, but that might be a parsing issue 🤔

/edit: ahh it could be due to the constant as you point out - it seems they're not handled the same and we have a draft PR opened to fix that iirc.

@antimora antimora mentioned this pull request Aug 9, 2024
@laggui laggui merged commit 0eec293 into main Aug 12, 2024
15 checks passed
@laggui laggui deleted the onnx/gather/fix-scalar-indices branch August 12, 2024 13:20
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