Skip to content

[dialects] Reorganize dialect extensions#86

Merged
adam-smnk merged 6 commits intollvm:mainfrom
adam-smnk:transform-ext-refactor
Apr 10, 2026
Merged

[dialects] Reorganize dialect extensions#86
adam-smnk merged 6 commits intollvm:mainfrom
adam-smnk:transform-ext-refactor

Conversation

@adam-smnk
Copy link
Copy Markdown
Member

@adam-smnk adam-smnk commented Mar 20, 2026

Refactors dialect extensions into separate submodules and places their definitions into separate files.

The refactor aligns lighthouse dialect structure closer to upstream bindings mirroring its nesting. That also makes the op discovery easier and allows for cleaner addition of new extensions.

When possible only the snake case op wrappers are exposed to promote their use which simplifies reuse across code and IR forms.

@adam-smnk adam-smnk requested a review from rolfmorel March 20, 2026 13:57
Comment thread lighthouse/dialects/transform/transform_ext/dialect.py Outdated
Comment thread lighthouse/dialects/transform/smt_ext/dialect.py
sg_m, sg_n = layer_params["sg_m"], layer_params["sg_n"]

@td_smt_ext.constrain_params(wg_m, wg_n, sg_m, sg_n)
@smt_ext.constrain_params(wg_m, wg_n, sg_m, sg_n)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
@smt_ext.constrain_params(wg_m, wg_n, sg_m, sg_n)
@td_ext_smt.constrain_params(wg_m, wg_n, sg_m, sg_n)

I am chatting with @PragmaTwice to allow transform_ext.smt.constrain_params. We could also wait for that to merge upstream and change the above to @transform_ext.smt.constrain_params(...).

Copy link
Copy Markdown
Member

@PragmaTwice PragmaTwice Mar 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've opened llvm/llvm-project#187911 to fix it.

@adam-smnk adam-smnk changed the title [dialects][transform] Reorganize transform dialect extensions [dialects] Reorganize dialect extensions Mar 23, 2026
@rengolin
Copy link
Copy Markdown
Member

What's the status of this PR?

@adam-smnk
Copy link
Copy Markdown
Member Author

All feedback has been addressed.

It could land as it is % new conflicts with main. Or wait for the linked PR to land first.

@rengolin
Copy link
Copy Markdown
Member

If there's a linked PR and you'll need to rebase anyway, just let that one merge and finish here.

@PragmaTwice
Copy link
Copy Markdown
Member

I don't recommend you to wait llvm/llvm-project#187911 because the new solution (requested by reviewers) requires more code changes, and I'm not sure when I'll have the time to finish it.

@adam-smnk
Copy link
Copy Markdown
Member Author

Thanks for the update, @PragmaTwice

Then I'd propose to rebase this PR on main and merge the current structure.
I'm happy to revisit and refactor these extensions again later on.

Refactors transform extension dialects into separate submodules and
places their definitions into separate files.

The refactor aligns lighthouse dialect structure closer to upstream
bindings mirroring its nesting. That also makes the op discovery
easier and allows for cleaner addition of new extensions.

When possible only the snake case op wrappers are exposed to promote
their use which simplifies reuse across code and IR forms.
@adam-smnk adam-smnk force-pushed the transform-ext-refactor branch from 3de3b35 to f3ebeb3 Compare April 10, 2026 08:25
@adam-smnk adam-smnk requested review from rengolin and rolfmorel April 10, 2026 08:32
@adam-smnk adam-smnk merged commit b50498d into llvm:main Apr 10, 2026
3 checks passed
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.

4 participants