Skip to content

[LAYOUTS] Remove HoistLayoutConversion in favour of backwardsRemat#5788

Merged
lezcano merged 2 commits into
mainfrom
remat_dot
Feb 3, 2025
Merged

[LAYOUTS] Remove HoistLayoutConversion in favour of backwardsRemat#5788
lezcano merged 2 commits into
mainfrom
remat_dot

Conversation

@lezcano
Copy link
Copy Markdown
Contributor

@lezcano lezcano commented Feb 1, 2025

Reland of #5673

We generalise `HoistLayoutConversion` to lift a given `convert_layout dot_operand`
above any chain of operations that do not require data movement. We
could totally generalise this in the future to lift it over other ops. We do
this as a first step to keep the code somewhat similar to the previous
one.

Regarding the previous limitations of `canHoistDotOpEncV2` I did a bit of archeology:
- The "don't hoist past select" was added in this issue #2857. I run the repro and with the recent layout fixes, it now passes.
- The TruncOps being skipped comes from #2181. I think this is related with the hack that was removed in #5044, so now it should work
- Same same for the `UIToFpOp`, this is now supported after #5044
- Mixed dtype hack is not necessary either as now everything works as expected with the `convert_layout` rework.

We also add proper support for `isPure` for `elementwise_inline_asm` ops

On the location of the code, we just leave it in `RemoveLayoutConversion.cpp` to
take advantage of the rather generic implementation of `rewriteSlice`. We could totally
move this pass outside of `remove-layout-conversion`, as it's probably enough to run
it once. This code will go through further changes in the near future, so we'll assess this
then.
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.

2 participants