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

Add prod and prod_dim tensor ops #1460

Merged
merged 3 commits into from
Mar 12, 2024
Merged

Conversation

antimora
Copy link
Collaborator

@antimora antimora commented Mar 11, 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

  1. Fixes prod and prod_axis tensor operators #526
  2. Left over: Implement prod and prod_dim for Autodiff backend #1458
  3. Left over: Implement prod and prod_dim for Candle backend #1454
  4. Left over: Implement prod and prod_dim for WGPU backend #1461

Changes

  1. Default float implementations for prod and prod_dim
  2. Ndarray backend
  3. Tch backend
  4. New tests
  5. Update the docs

Testing

  1. New unit tests
  2. Book render

Copy link

codecov bot commented Mar 11, 2024

Codecov Report

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

Project coverage is 85.70%. Comparing base (80aac1d) to head (6d45239).

Files Patch % Lines
crates/burn-fusion/src/ops/int.rs 0.00% 39 Missing ⚠️
crates/burn-tensor/src/tests/ops/aggregation.rs 53.48% 20 Missing ⚠️
crates/burn-ndarray/src/ops/base.rs 0.00% 17 Missing ⚠️
crates/burn-fusion/src/stream/context.rs 0.00% 11 Missing ⚠️
crates/burn-ndarray/src/ops/macros.rs 0.00% 11 Missing ⚠️
crates/burn-tch/src/ops/base.rs 28.57% 10 Missing ⚠️
crates/burn-jit/src/ops/int_ops.rs 0.00% 9 Missing ⚠️
crates/burn-ndarray/src/ops/int_tensor.rs 0.00% 9 Missing ⚠️
crates/burn-autodiff/src/ops/int_tensor.rs 0.00% 6 Missing ⚠️
crates/burn-fusion/src/stream/operation.rs 0.00% 6 Missing ⚠️
... and 4 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1460      +/-   ##
==========================================
- Coverage   85.88%   85.70%   -0.19%     
==========================================
  Files         645      645              
  Lines       71749    71953     +204     
==========================================
+ Hits        61625    61666      +41     
- Misses      10124    10287     +163     

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

@@ -22,7 +23,7 @@ where
}

/// The float element type for the jit backend.
pub trait FloatElement: JitElement + Element {}
pub trait FloatElement: JitElement + Element + Float {}
Copy link
Member

Choose a reason for hiding this comment

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

I don't think it's a good idea, since we may have u8 implement the FloatElement with quantization. Is there a reason to add this trait?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Let me review it again. It might have been a left over.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Removed it. It was a left over.

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! I only had a question but that was already addressed by the previous review + modifications.

@antimora antimora merged commit 7a98b2f into tracel-ai:main Mar 12, 2024
13 of 14 checks passed
@antimora antimora deleted the tensor-prod-526 branch March 12, 2024 19:00
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.

prod and prod_axis tensor operators
3 participants