Skip to content

Equivalence Pattern Rewriter to integrate expansion of Softmax into equality saturation#5655

Open
szerdick wants to merge 87 commits intoxdslproject:jumerckx/interp_ematchfrom
szerdick:interp_ematch
Open

Equivalence Pattern Rewriter to integrate expansion of Softmax into equality saturation#5655
szerdick wants to merge 87 commits intoxdslproject:jumerckx/interp_ematchfrom
szerdick:interp_ematch

Conversation

@szerdick
Copy link
Collaborator

No description provided.

superlopuh and others added 30 commits January 22, 2026 15:19
With the foreach approach, I believe part of this logic can be
simplified/omitted, but this is a good first step.
We need to be more careful with the bindings selected by matchers.
Right now, values are sometimes passed as their class result to a
rewriter:
```
x = …
y = …

c = class x, y

rewrite “myrewrite”(c)
```

This is problematic in MLIR as other rewrites can invalidate c. While we
are guaranteed to not erase any operation in the “program domain”, this
is not true for the operations of the “e-graph domain”.
The solution is to ensure in the pdl lowering that only values from the
program domain are passed to rewriters and the conversion to e-graph
domain happens at the latest possible point, in the rewriter itself.
(This is not an issue in xDSL because erasing an e-class does not
discard of the object)
non-eqsat lowering should stay the same
(not entirely done)

Co-authored-by: Sasha Lopoukhine <superlopuh@gmail.com>
to show how it should be done, the change would also need to be made to
apply_eqsat_pdl.
@jumerckx jumerckx force-pushed the jumerckx/interp_ematch branch from e64571a to ba97362 Compare February 13, 2026 14:04
@jumerckx jumerckx force-pushed the jumerckx/interp_ematch branch 22 times, most recently from ab7c09d to 1077c5a Compare March 7, 2026 14:18
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