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: Implement ONNX RandomUniform + RandomNormal in burn-import #1806

Merged
merged 4 commits into from
May 27, 2024

Conversation

hexd0t
Copy link
Contributor

@hexd0t hexd0t commented May 23, 2024

Checklist

Related Issues/PRs

Implements a part of #1714

Changes

Adds a Node for ONNX RandomUniform to burn-import.
It supports all of the operation's attributes except seed, since I've found no way of providing a seed value to the Tensor (but since the specific Pseudorandom Generator isn't given, models cannot really rely on using fixed seeds anyways, so the impact is hopefully negligible)

Testing

Created a testcase along the instructions of the contributor book. Since I've found no way of easily fixing the random seed in the testcase, it only checks the resulting tensor dimensions, not actual golden values.

@nathanielsimard nathanielsimard requested a review from laggui May 24, 2024 00:30
Copy link

codecov bot commented May 24, 2024

Codecov Report

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

Project coverage is 86.41%. Comparing base (ef4646c) to head (5d0ca5d).
Report is 3 commits behind head on main.

Files Patch % Lines
crates/burn-import/src/onnx/to_burn.rs 90.90% 4 Missing ⚠️
crates/burn-import/src/onnx/dim_inference.rs 93.54% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1806      +/-   ##
==========================================
- Coverage   86.46%   86.41%   -0.05%     
==========================================
  Files         746      750       +4     
  Lines       86297    87092     +795     
==========================================
+ Hits        74616    75263     +647     
- Misses      11681    11829     +148     

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

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.

Nice work! Some minor comments/changes but overall looks good 👍

crates/burn-import/src/onnx/dim_inference.rs Outdated Show resolved Hide resolved
crates/burn-import/src/onnx/dim_inference.rs Outdated Show resolved Hide resolved
crates/burn-import/src/onnx/to_burn.rs Show resolved Hide resolved
crates/burn-import/src/burn/node/random_uniform.rs Outdated Show resolved Hide resolved
@hexd0t hexd0t changed the title Feat: Implement ONNX RandomUniform in burn-import Feat: Implement ONNX RandomUniform + RandomNormal in burn-import May 24, 2024
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.

Thanks for contributing! 🙏

LGTM. One small typo to fix but I'll approve in advance.

@laggui
Copy link
Member

laggui commented May 27, 2024

🚀 🚀

@nathanielsimard nathanielsimard merged commit cccd96d into tracel-ai:main May 27, 2024
14 checks passed
@hexd0t hexd0t deleted the feat/onnx-randomuniform branch August 27, 2024 19:10
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