This is an archive of the discontinued LLVM Phabricator instance.

[mlir][Linalg] Deprecate `tileAndFuseLinalgOps` method and associated patterns.
ClosedPublic

Authored by mravishankar on Jul 15 2022, 1:22 PM.

Details

Summary

The tileAndFuseLinalgOps is a legacy approach for tiling + fusion of
Linalg operations. Since it was also intended to work on operations
with buffer operands, this method had fairly complex logic to make
sure tile and fuse was correct even with side-effecting linalg ops.
While complex, it still wasnt robust enough. This patch deprecates
this method and thereby deprecating the tiling + fusion method for ops
with buffer semantics. Note that the core transformation to do fusion
of a producer with a tiled consumer still exists. The deprecation here
only removes methods that auto-magically tried to tile and fuse
correctly in presence of side-effects.

The tileAndFuseLinalgOps also works with operations with tensor
semantics. There are at least two other ways the same functionality
exists.

  1. The tileConsumerAndFuseProducers method. This does a similar transformation, but using a slightly different logic to automatically figure out the legal tile + fuse code. Note that this is also to be deprecated soon.
  2. The prefered way uses the TilingInterface for tile + fuse, and relies on the caller to set the tiling options correctly to ensure that the generated code is correct.

As proof that (2) is equivalent to the functionality provided by
tileAndFuseLinalgOps, relevant tests have been moved to use the
interface, where the test driver sets the tile sizes appropriately to
generate the expected code.

Diff Detail

Event Timeline

mravishankar created this revision.Jul 15 2022, 1:22 PM
mravishankar requested review of this revision.Jul 15 2022, 1:22 PM
nicolasvasilache accepted this revision.Jul 19 2022, 8:25 AM

Nice red diff, thanks much @mravishankar !

This revision is now accepted and ready to land.Jul 19 2022, 8:25 AM

Fix bazel build.

This revision was landed with ongoing or failed builds.Jul 20 2022, 10:05 PM
This revision was automatically updated to reflect the committed changes.
mlir/test/Dialect/Linalg/fusion-pattern.mlir