-
Notifications
You must be signed in to change notification settings - Fork 90
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 <[email protected]>
Signed-off-by: Justin Chu <[email protected]>
Signed-off-by: Justin Chu <[email protected]>
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. |
Signed-off-by: Justin Chu <[email protected]>
Signed-off-by: Justin Chu <[email protected]>
Co-authored-by: Copilot <[email protected]>
Signed-off-by: Justin Chu <[email protected]>
Signed-off-by: Justin Chu <[email protected]>
Signed-off-by: Justin Chu <[email protected]>
Signed-off-by: Justin Chu <[email protected]>
Signed-off-by: Justin Chu <[email protected]>
Signed-off-by: Justin Chu <[email protected]>
|
I will remove the allow bloat option for now. Will create a function arg for user specified rules |
Signed-off-by: Justin Chu <[email protected]>
Signed-off-by: Justin Chu <[email protected]>
Signed-off-by: Justin Chu <[email protected]>
|
@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. |
Signed-off-by: Justin Chu <[email protected]>
Signed-off-by: Justin Chu <[email protected]>
Signed-off-by: Justin Chu <[email protected]>
Signed-off-by: Justin Chu <[email protected]>
Signed-off-by: Justin Chu <[email protected]>
|
@gramalingam could you reapprove? Thanks |
Suggested by #2466, I updated the constant folder logic to allow
Constant folding customization:
always_fold_opsparameter with ashould_foldcallable 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_foldreturns a decision. [1] [2] [3]Code cleanup and minor fixes:
_update_typefunction.Fix #2466
cc @iksnagreb