-
Notifications
You must be signed in to change notification settings - Fork 80
Update constant folding behavior for large tensors #2488
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
Conversation
Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com>
Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2488 +/- ##
==========================================
- Coverage 70.00% 69.94% -0.06%
==========================================
Files 215 216 +1
Lines 25988 26064 +76
Branches 2606 2614 +8
==========================================
+ Hits 18192 18231 +39
- Misses 6896 6932 +36
- Partials 900 901 +1 ☔ View full report in Codecov by Sentry. |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com>
Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com>
Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com>
I will remove the allow bloat option for now. Will create a function arg for user specified rules |
Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com>
Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com>
Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com>
@iksnagreb @gramalingam I removed the previous always_fold option and added a should_fold arg that takes a function. This is a breaking change. Please let me know if it looks ok. |
@gramalingam could you reapprove? Thanks |
Suggested by #2466, I updated the constant folder logic to allow
Constant folding customization:
always_fold_ops
parameter with ashould_fold
callable that determines on a per-node basis whether folding should occur. This allows users to specify more complex folding policies and makes the API more explicit. (FoldConstantsPass
,fold_constants
) [1] [2] [3] [4] [5]Logging and diagnostics improvements:
should_fold
returns a decision. [1] [2] [3]Code cleanup and minor fixes:
_update_type
function.Fix #2466
cc @iksnagreb