plaidml / tpp-mlir

TPP experimentation on MLIR for linear algebra
https://arxiv.org/abs/2404.15204
Other
111 stars 29 forks source link

Fold into eltwise pass #953

Closed adam-smnk closed 1 month ago

adam-smnk commented 1 month ago

Adds pass that folds operations into elementwise Linalg ops. Combined operations are rewritten into a single linalg.generic.

Initially, a pattern for folding broadcast producer into an elementwise consumer is added. This allows to improve layout propagation, allows for fusion after tiling, and reduces the number of temporary buffers by eliminating explicit broadcast.

adam-smnk commented 1 month ago

this could be an upstream pass.

Yes, it should be pretty generic but

But it would be easier to get it merged once we have the broadcast semantics added to element-wise named ops.

Agreed here. With these new semantics it would be much cleaner and we can avoid going down to generic.