This is an archive of the discontinued LLVM Phabricator instance.

[mlir][Linalg] Retire LinalgStrategyTilePass and filter-based pattern.
ClosedPublic

Authored by nicolasvasilache on Oct 10 2022, 5:13 AM.

Details

Summary

Context: https://discourse.llvm.org/t/psa-retire-linalg-filter-based-patterns/63785

Uses of LinalgTilingPattern::returningMatchAndRewrite are replaced by a top-level tileWithLinalgTilingOptions function that is marked obsolete and serves
as a temporary means to transition away from LinalgTilingOptions-based tiling.
LinalgTilingOptions supports too many options that have been orthogonalized with the use of the transform dialect.

Additionally, the revision introduces a transform.structured.tile_to_scf_for structured transform operation that is needed to properly tile tensor.pad
via the TilingInterface. Uses of transform.structured.tile will be deprecated and replaced by this new op.
This will achieve the deprecation of linalg::tileLinalgOp.
Context: https://discourse.llvm.org/t/psa-retire-tileandfuselinalgops-method/63850

In the process of transitioning, tests that were performing tile and distribute on tensors are retired: transformations should be orthogonalized better in the future.
In particular, tiling to specific loop types and tileAndDistribute behavior are not available via the transform ops.
The behavior is still available as part of the tileWithLinalgTilingOptions method to allow downstream clients to transition without breakages but is meant to be retired soon.

As more tests are ported to the transform dialect, it became necessary to introduce a test-transform-dialect-erase-schedule-pass to discard the transform specification
once applied so that e2e lowering and execution is possible.

Lastly, a number of redundant tests that were testing composition of patterns are retired as they are available with a better mechanism via the transform dialect.

Diff Detail

Event Timeline

nicolasvasilache requested review of this revision.Oct 10 2022, 5:13 AM
nicolasvasilache edited the summary of this revision. (Show Details)

Update commit message.

nicolasvasilache edited the summary of this revision. (Show Details)

Update commit message.

nicolasvasilache edited the summary of this revision. (Show Details)

s/tileAndX/tileWithLinalgTilingOptions

nicolasvasilache edited the summary of this revision. (Show Details)

Rebase.

ftynse accepted this revision.Oct 10 2022, 8:52 AM
ftynse added inline comments.
mlir/include/mlir/Dialect/Linalg/Transforms/Transforms.h
1026

There is a bunch of unrelated rewrapping that doesn't seem necessary. The lines were 80 cols wide, is your editor set to 79?

This feels spurious and pollutes the change history.

mlir/test/Dialect/Linalg/transform-patterns.mlir
1

Is the test-patterns part still relevant?

mlir/test/lib/Dialect/Transform/TestTransformDialectInterpreter.cpp
77

::mlir shouldn't be necessary here.

This revision is now accepted and ready to land.Oct 10 2022, 8:52 AM
nicolasvasilache marked 3 inline comments as done.Oct 11 2022, 2:10 AM
nicolasvasilache added inline comments.
mlir/test/Dialect/Linalg/transform-patterns.mlir
1

Yes it is, as it triggers some lowering of linalg to loops that we do not control with the transform dialect yet.

I'll drop that in some future update.

nicolasvasilache marked an inline comment as done.

Address comments

Harbormaster completed remote builds in B191455: Diff 466738.
This revision was landed with ongoing or failed builds.Oct 11 2022, 2:43 AM
This revision was automatically updated to reflect the committed changes.
mlir/test/Dialect/Linalg/tile-tensors.mlir