Skip to content

Conversation

@tgymnich
Copy link
Contributor

@tgymnich tgymnich commented Nov 4, 2025

Stacked PRs:


[water] Lower wave constraints to MLIR

  • emit the appropriate mlir dialect attributes for wave DSL constraints

Signed-off-by: Tim Gymnich tim@gymni.ch

- 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
tgymnich added a commit that referenced this pull request Nov 4, 2025
Signed-off-by: Tim Gymnich <tim@gymni.ch>

stack-info: PR: #422, branch: tgymnich/stack/3
tgymnich added a commit that referenced this pull request Nov 4, 2025
Signed-off-by: Tim Gymnich <tim@gymni.ch>

stack-info: PR: #422, branch: tgymnich/stack/3
@tgymnich tgymnich changed the base branch from tgymnich/stack/2 to main November 4, 2025 01:49
@tgymnich tgymnich changed the base branch from main to tgymnich/stack/2 November 4, 2025 01:49
tgymnich added a commit that referenced this pull request Nov 4, 2025
Signed-off-by: Tim Gymnich <tim@gymni.ch>

stack-info: PR: #422, branch: tgymnich/stack/3
@tgymnich tgymnich changed the base branch from tgymnich/stack/2 to main November 4, 2025 07:49
@tgymnich tgymnich changed the base branch from main to tgymnich/stack/1 November 4, 2025 07:50
@tgymnich tgymnich changed the base branch from tgymnich/stack/1 to main November 4, 2025 08:04
tgymnich added a commit that referenced this pull request Nov 4, 2025
Signed-off-by: Tim Gymnich <tim@gymni.ch>

stack-info: PR: #422, branch: tgymnich/stack/3
Copilot AI review requested due to automatic review settings November 4, 2025 08:04
@tgymnich tgymnich changed the base branch from main to tgymnich/stack/1 November 4, 2025 08:04
Copy link
Contributor

Copilot AI left a 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.

@tgymnich tgymnich changed the base branch from tgymnich/stack/1 to main November 4, 2025 09:07
@tgymnich tgymnich changed the base branch from main to tgymnich/stack/1 November 4, 2025 09:07
tgymnich added a commit that referenced this pull request Nov 4, 2025
Signed-off-by: Tim Gymnich <tim@gymni.ch>

stack-info: PR: #422, branch: tgymnich/stack/3
@tgymnich tgymnich changed the base branch from tgymnich/stack/1 to main November 4, 2025 11:07
@tgymnich tgymnich changed the base branch from main to tgymnich/stack/1 November 4, 2025 11:07
@tgymnich tgymnich marked this pull request as draft November 4, 2025 11:07
tgymnich added a commit that referenced this pull request Nov 4, 2025
Signed-off-by: Tim Gymnich <tim@gymni.ch>

stack-info: PR: #422, branch: tgymnich/stack/3
@tgymnich tgymnich changed the base branch from main to tgymnich/stack/5 November 10, 2025 11:48
Copy link
Contributor

Copilot AI left a 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.

tgymnich added a commit that referenced this pull request Nov 10, 2025
Signed-off-by: Tim Gymnich <tim@gymni.ch>

stack-info: PR: #422, branch: tgymnich/stack/3
tgymnich added a commit that referenced this pull request Nov 10, 2025
Signed-off-by: Tim Gymnich <tim@gymni.ch>

stack-info: PR: #422, branch: tgymnich/stack/3
tgymnich added a commit that referenced this pull request Nov 10, 2025
Signed-off-by: Tim Gymnich <tim@gymni.ch>

stack-info: PR: #422, branch: tgymnich/stack/3
@tgymnich tgymnich changed the base branch from tgymnich/stack/5 to main November 10, 2025 13:35
Copilot AI review requested due to automatic review settings November 10, 2025 13:35
@tgymnich tgymnich changed the base branch from main to tgymnich/stack/5 November 10, 2025 13:35
Copy link
Contributor

Copilot AI left a 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.

tgymnich added a commit that referenced this pull request Nov 10, 2025
Signed-off-by: Tim Gymnich <tim@gymni.ch>

stack-info: PR: #422, branch: tgymnich/stack/3
tgymnich added a commit that referenced this pull request Nov 10, 2025
- 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
@tgymnich tgymnich changed the base branch from tgymnich/stack/5 to main November 10, 2025 13:48
@tgymnich tgymnich changed the base branch from main to tgymnich/stack/5 November 10, 2025 13:49
tgymnich added a commit that referenced this pull request Nov 10, 2025
- 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
tgymnich added a commit that referenced this pull request Nov 10, 2025
- 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
@tgymnich tgymnich changed the base branch from tgymnich/stack/5 to main November 10, 2025 16:29
Copilot AI review requested due to automatic review settings November 10, 2025 16:29
@tgymnich tgymnich changed the base branch from main to tgymnich/stack/5 November 10, 2025 16:29
Base automatically changed from tgymnich/stack/5 to main November 10, 2025 16:31
Copy link
Contributor

Copilot AI left a 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_dialect should be updated to document the new constraints parameter. The docstring currently only mentions "trace and options" but the function now also accepts constraints.

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.

@tgymnich tgymnich merged commit 586084d into main Nov 11, 2025
19 of 22 checks passed
@tgymnich tgymnich deleted the tgymnich/stack/3 branch November 11, 2025 08:26
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.

3 participants