-
Notifications
You must be signed in to change notification settings - Fork 77
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
transformations: (csl) use constants instead of params #3319
Conversation
`csl.param`s allow for flexibility we do not utilise whilst providing a possibility of accidentally overriding a value which was not intended to be overridden. In the `ModuleOp.get_param_value` function we even use the value of the param as if it will always be there. After this PR: `csl_wrapper.ParamAttribute` can no longer omit its value (now referred to as "value" not "default") In the layout module: * All `param`s are now `arith.constant`s In the program module: * All params from the `csl_wrapper.ParamAttribute` are now `arith.constant`s * Params from the layout module `yield` arguments are still `csl.param`s.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #3319 +/- ##
==========================================
- Coverage 90.04% 90.02% -0.02%
==========================================
Files 445 445
Lines 56219 56214 -5
Branches 5398 5396 -2
==========================================
- Hits 50620 50609 -11
- Misses 4180 4184 +4
- Partials 1419 1421 +2 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, unfortunately our programs are currently not general enough to support freely modifying the csl.param
s. I still retain some hope that we (or others in other contexts?) may eventually get there, and this discrepancy may not be the fault of the param translation. Translating ParamAttribute
to arith.constant
seems the right fix for us, but semantically - and long-term - translating ParamAttribute
to csl.ParamOp
appears logical.
Introducing a ConstAttribute
alongside the param attribute might be cleaner but also cumbersome. We could potentially introduce a flag to lower-csl-wrapper e.g. a boolean lower-params-as-const
that enables lowering params with a default/value to consts when set?
I have a suggestion then: at the moment, we rename Note that it's still possible to pass |
What's the latest on this? Can we close the PR until a solution is found? |
Yes, I think this can be sorted out at some other time |
csl.param
s allow for flexibility we do not utilise whilst providing a possibility of accidentally overriding a value which was not intended to be overridden. In theModuleOp.get_param_value
function we even use the value of the param as if it will always be there.After this PR:
csl_wrapper.ParamAttribute
can no longer omit its value (now referred to as "value" not "default")In the layout module:
param
s are nowarith.constant
sIn the program module:
csl_wrapper.ParamAttribute
are nowarith.constant
syield
arguments are stillcsl.param
s.