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/gather import #1843

Merged
merged 11 commits into from
Jun 3, 2024
Merged

Feat/gather import #1843

merged 11 commits into from
Jun 3, 2024

Conversation

agelas
Copy link
Contributor

@agelas agelas commented May 31, 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

#1714

Changes

Gather and GatherElements were separated into their own folders on the ONNX side. Confusingly, ONNX's GatherElements is equivalent to PyTorch/burn's gather function, while ONNX's Gather seems to be equivalent to burn's select. In PyTorch, the ONNX Gather is an index_select, which burn's select more or less seems equivalent to when using 1D indexes.

Testing

Added unit tests.

Copy link

codecov bot commented May 31, 2024

Codecov Report

Attention: Patch coverage is 96.99248% with 4 lines in your changes are missing coverage. Please review.

Project coverage is 86.26%. Comparing base (99e1ba4) to head (a535852).

Files Patch % Lines
crates/burn-import/src/onnx/dim_inference.rs 83.33% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1843      +/-   ##
==========================================
+ Coverage   86.24%   86.26%   +0.01%     
==========================================
  Files         767      768       +1     
  Lines       88575    88701     +126     
==========================================
+ Hits        76394    76516     +122     
- Misses      12181    12185       +4     

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

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

Thank you for your contribution!

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.

LGTM! Thanks for clearing up the confusion 😄

@laggui laggui merged commit 92b0067 into tracel-ai:main Jun 3, 2024
14 checks passed
LilDojd pushed a commit to LilDojd/burn that referenced this pull request Jun 5, 2024
* Move and redirect GatherElements to new folders/nodes

* Create PyTorch script for gather

* Add onnx file for gather

* Add a gather test to onnx_tests

* Update gather.rs to use select

* Rename codegen test

* Update gather and gather_elements conversion functions

* Validate rank of input node and update output

* Add check for Gather
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