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

Refactor/elemwise/kernel selection + dynamic fused inplace operations and broadcasting #1359

Merged
merged 11 commits into from Feb 27, 2024

Conversation

nathanielsimard
Copy link
Member

Refactor elemwise fused kernels to use the new compilation settings to identify kernels instead of pre-compiling every possible combination and having a complex selection process. This allows support for dynamic partial in-place operations as well as avoiding the execution of broadcasting procedures in fused kernels when not necessary (a new kernel is going to be created). These are very finely grained optimizations; no real speed improvements are going to be noticeable at first, but with more aggressive fusion and a longer stream of operations fused, it will help in reducing allocated memory.

@nathanielsimard nathanielsimard changed the title Refactor/elemwise/kernel selection Refactor/elemwise/kernel selection + dynamic fused inplace operations and broadcasting Feb 24, 2024
@nathanielsimard nathanielsimard marked this pull request as draft February 24, 2024 00:56
@nathanielsimard nathanielsimard marked this pull request as ready for review February 26, 2024 19:00
Copy link
Member

@louisfd louisfd left a comment

Choose a reason for hiding this comment

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

LGTM

crates/burn-wgpu/src/codegen/compilation.rs Outdated Show resolved Hide resolved
crates/burn-wgpu/src/codegen/dialect/gpu/scope.rs Outdated Show resolved Hide resolved
@nathanielsimard nathanielsimard force-pushed the refactor/elemwise/kernel-selection branch from 8af12da to f5c41b7 Compare February 26, 2024 23:21
Copy link

codecov bot commented Feb 27, 2024

Codecov Report

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

Project coverage is 85.34%. Comparing base (bdec8d5) to head (a60e068).

Files Patch % Lines
crates/burn-wgpu/src/codegen/compilation.rs 87.06% 26 Missing ⚠️
crates/burn-wgpu/src/codegen/dialect/gpu/scope.rs 80.00% 2 Missing ⚠️
crates/burn-wgpu/src/fusion/elemwise/kernel.rs 98.59% 1 Missing ⚠️
crates/burn-wgpu/src/fusion/kernel.rs 95.23% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1359      +/-   ##
==========================================
- Coverage   85.40%   85.34%   -0.06%     
==========================================
  Files         591      591              
  Lines       67468    67497      +29     
==========================================
- Hits        57618    57604      -14     
- Misses       9850     9893      +43     

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

@nathanielsimard nathanielsimard merged commit 57887e7 into main Feb 27, 2024
15 checks passed
@nathanielsimard nathanielsimard deleted the refactor/elemwise/kernel-selection branch February 27, 2024 13:41
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.

None yet

2 participants