-
Notifications
You must be signed in to change notification settings - Fork 25
[water] Lower wave constraints to MLIR #422
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
- emit the appropriate mlir dialect attributes for wave DSL constraints Signed-off-by: Tim Gymnich <tim@gymni.ch> stack-info: PR: #422, branch: tgymnich/stack/3
Signed-off-by: Tim Gymnich <tim@gymni.ch> stack-info: PR: #422, branch: tgymnich/stack/3
0f57c0e to
0503b6a
Compare
75f43e7 to
59f76b4
Compare
59f76b4 to
0885f69
Compare
0503b6a to
1247d9f
Compare
Signed-off-by: Tim Gymnich <tim@gymni.ch> stack-info: PR: #422, branch: tgymnich/stack/3
1247d9f to
9a6ecb7
Compare
Signed-off-by: Tim Gymnich <tim@gymni.ch> stack-info: PR: #422, branch: tgymnich/stack/3
9a6ecb7 to
3076ae8
Compare
Signed-off-by: Tim Gymnich <tim@gymni.ch> stack-info: PR: #422, branch: tgymnich/stack/3
3076ae8 to
1aa4827
Compare
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.
Pull Request Overview
This PR adds support for passing constraints through the MLIR converter pipeline. The constraints are now serialized alongside the trace and options, then deserialized in the water emitter where they are converted into MLIR attributes that are attached to the function operation.
- Constraint objects (HardwareConstraint, WorkgroupConstraint) are now passed through the emit_wave_dialect function
- Constraints are serialized/deserialized via dill along with traces and options
- Constraints are converted to MLIR attributes and attached to the function operation
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| wave_lang/kernel/wave/mlir_converter/water_emitter.py | Added constraint parameter throughout, validation logic, and MLIR attribute conversion for constraints |
| wave_lang/kernel/wave/mlir_converter/mlir_converter.py | Updated emit_wave_dialect signature to accept constraints and serialize them |
| lit_tests/kernel/wave/mlir_converter.py | Updated test calls to pass constraints from kernel objects |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: Tim Gymnich <tim@gymni.ch> stack-info: PR: #422, branch: tgymnich/stack/3
1aa4827 to
515cd6b
Compare
Signed-off-by: Tim Gymnich <tim@gymni.ch> stack-info: PR: #422, branch: tgymnich/stack/3
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.
Pull Request Overview
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: Tim Gymnich <tim@gymni.ch> stack-info: PR: #422, branch: tgymnich/stack/3
eb9b30c to
84cc4a3
Compare
Signed-off-by: Tim Gymnich <tim@gymni.ch> stack-info: PR: #422, branch: tgymnich/stack/3
2647d0d to
c1075cd
Compare
Signed-off-by: Tim Gymnich <tim@gymni.ch> stack-info: PR: #422, branch: tgymnich/stack/3
c1075cd to
dfda132
Compare
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.
Pull Request Overview
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: Tim Gymnich <tim@gymni.ch> stack-info: PR: #422, branch: tgymnich/stack/3
- emit the appropriate mlir dialect attributes for wave DSL constraints Signed-off-by: Tim Gymnich <tim@gymni.ch> stack-info: PR: #422, branch: tgymnich/stack/3
dfda132 to
3c3555a
Compare
cf891b4 to
fbfde5c
Compare
- emit the appropriate mlir dialect attributes for wave DSL constraints Signed-off-by: Tim Gymnich <tim@gymni.ch> stack-info: PR: #422, branch: tgymnich/stack/3
3c3555a to
a4e4e58
Compare
- emit the appropriate mlir dialect attributes for wave DSL constraints Signed-off-by: Tim Gymnich <tim@gymni.ch> stack-info: PR: #422, branch: tgymnich/stack/3
a4e4e58 to
eba0daf
Compare
eba0daf to
b62940a
Compare
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.
Pull Request Overview
Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.
Comments suppressed due to low confidence (1)
wave_lang/kernel/wave/mlir_converter/mlir_converter.py:37
- The docstring for
emit_wave_dialectshould be updated to document the newconstraintsparameter. The docstring currently only mentions "trace and options" but the function now also acceptsconstraints.
Suggested update:
"""Emit Wave MLIR by sending the pickled trace, constraints, and options to the emitter.
Args:
trace: The captured trace to convert
constraints: List of Wave constraints to apply
options: Compile options (only the `subs` field is used during emission)
test_diagnostic_emission: Whether to test diagnostic emission
Returns:
A tuple of (MLIR module string, list of diagnostics)
""" """Emit Wave MLIR by sending the pickled trace and options to the emitter.
The `subs` field of options is the only option used during emission."""
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Stacked PRs:
[water] Lower wave constraints to MLIR
Signed-off-by: Tim Gymnich tim@gymni.ch