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

Feat: burn-import implement ONNX ConstantOfShape #1815

Merged
merged 7 commits into from
Jul 8, 2024

Conversation

hexd0t
Copy link
Contributor

@hexd0t hexd0t commented May 26, 2024

Pull Request Template

Checklist

  • Confirmed that run-checks all script has been executed.
  • Made sure the book is up to date with changes in this PR.

Related Issues/PRs

Although ConstantOfShape is not explicitly there, this still benefits #1714

Changes

Add ConstantOfShape support to onnx import.

Testing

Codegen and overall import tests as described in the contributor book.

Copy link

codecov bot commented May 27, 2024

Codecov Report

Attention: Patch coverage is 89.79592% with 25 lines in your changes missing coverage. Please review.

Project coverage is 85.38%. Comparing base (b331290) to head (739f983).
Report is 9 commits behind head on main.

Files Patch % Lines
crates/onnx-ir/src/util.rs 56.00% 11 Missing ⚠️
...tes/burn-import/src/burn/node/constant_of_shape.rs 89.65% 9 Missing ⚠️
crates/burn-import/src/onnx/to_burn.rs 91.17% 3 Missing ⚠️
crates/burn-import/src/burn/ty.rs 93.33% 1 Missing ⚠️
crates/onnx-ir/src/dim_inference.rs 96.29% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1815      +/-   ##
==========================================
- Coverage   85.50%   85.38%   -0.13%     
==========================================
  Files         811      821      +10     
  Lines      100401   101427    +1026     
==========================================
+ Hits        85848    86603     +755     
- Misses      14553    14824     +271     

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

@hexd0t hexd0t force-pushed the feat/onnx-constantofshape branch from c224e40 to dbe0a87 Compare May 27, 2024 22:16
@hexd0t hexd0t force-pushed the feat/onnx-constantofshape branch from dbe0a87 to 43e70f6 Compare May 28, 2024 20:06
Copy link
Member

@laggui laggui left a comment

Choose a reason for hiding this comment

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

A couple of changes needed to follow the spec, but otherwise a great start! 💪

crates/burn-import/src/onnx/dim_inference.rs Outdated Show resolved Hide resolved
crates/burn-import/src/burn/node/constant_of_shape.rs Outdated Show resolved Hide resolved
crates/burn-import/src/burn/node/constant_of_shape.rs Outdated Show resolved Hide resolved
crates/burn-import/src/onnx/to_burn.rs Outdated Show resolved Hide resolved
Copy link
Contributor

This PR has been marked as stale because it has not been updated for over a month

@github-actions github-actions bot added the stale The issue or pr has been open for too long label Jun 29, 2024
@antimora antimora self-assigned this Jul 2, 2024
@antimora
Copy link
Collaborator

antimora commented Jul 2, 2024

I will take over this PR and fix issues.

@antimora antimora removed the stale The issue or pr has been open for too long label Jul 2, 2024
@antimora
Copy link
Collaborator

antimora commented Jul 2, 2024

I am trying to resolve some conflicts. It looks like @laggui added ConstantOfShape implementation in "Refactor tensor data" (#1916). I know he had worked on this previously, so it might have been checked in accidentally.

@antimora antimora requested review from laggui and nathanielsimard and removed request for nathanielsimard July 6, 2024 22:35
@antimora
Copy link
Collaborator

antimora commented Jul 6, 2024

@skewballfox, if you have a chance, please take a look at this PR. I started using Shape arg type instead of using Tensor because shape operation is outside tensor operation but ONNX treats them as if they tensors.

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.

I fixed unresolved issues and started using Shape ArgType which we had but didn't use it. I am approving since I looked at the code and fixed issues.

Copy link
Member

@laggui laggui left a comment

Choose a reason for hiding this comment

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

There's still an issue with the generated ONNX model for the tests.

Otherwise LGTM!

@antimora antimora requested a review from laggui July 8, 2024 16:41
@antimora antimora merged commit c2b6318 into tracel-ai:main Jul 8, 2024
14 checks passed
@hexd0t
Copy link
Contributor Author

hexd0t commented Aug 7, 2024

Thanks; sorry, I had other things preventing me from finishing this.

@hexd0t hexd0t deleted the feat/onnx-constantofshape branch August 7, 2024 18:01
@antimora
Copy link
Collaborator

antimora commented Aug 7, 2024

Thanks; sorry, I had other things preventing me from finishing this.

No worries! This happens. Thanks for starting it and contributing. Now it's done.

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.

5 participants