[all-commits] [llvm/llvm-project] 2b2ce5: [MLIR][SCF] Add an API to fuse consumer to a produ...

Abhishek Varma via All-commits all-commits at lists.llvm.org
Sat Jun 1 11:24:03 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 2b2ce50fe843b5b550806a0ab15b06cd5c405d48
      https://github.com/llvm/llvm-project/commit/2b2ce50fe843b5b550806a0ab15b06cd5c405d48
  Author: Abhishek Varma <abhvarma at amd.com>
  Date:   2024-06-01 (Sat, 01 Jun 2024)

  Changed paths:
    M mlir/include/mlir/Dialect/SCF/Transforms/TileUsingInterface.h
    M mlir/include/mlir/Dialect/Tensor/Transforms/Transforms.h
    M mlir/include/mlir/Interfaces/TilingInterface.td
    M mlir/lib/Dialect/Linalg/Transforms/TilingInterfaceImpl.cpp
    M mlir/lib/Dialect/SCF/Transforms/TileUsingInterface.cpp
    M mlir/lib/Dialect/Tensor/IR/TensorTilingInterfaceImpl.cpp
    M mlir/lib/Dialect/Tensor/Transforms/SwapExtractSliceWithProducerPatterns.cpp
    A mlir/test/Interfaces/TilingInterface/tile-and-fuse-consumer.mlir
    M mlir/test/lib/Interfaces/TilingInterface/TestTilingInterfaceTransformOps.cpp
    M mlir/test/lib/Interfaces/TilingInterface/TestTilingInterfaceTransformOps.td

  Log Message:
  -----------
  [MLIR][SCF] Add an API to fuse consumer to a producer within scf loop (#88712)

This commit adds an API (`tileAndFuseConsumerOfSlice`) to fuse consumer to a producer within
scf.for/scf.forall loop.

To support this two new methods are added to the `TilingInterface`
- `getIterationDomainTileFromOperandTile`
- `getTiledImplementationFromOperandTile`.

Consumer operations that implement this method can be used to be fused with tiled producer operands in a manner similar to (but essentially the inverse of) the fusion of an untiled producer with a tiled consumer.

Note that this only does one `tiled producer` -> `consumer` fusion. This could be called repeatedly for fusing multiple consumers. The current implementation also is conservative in when this kicks in (like single use of the value returned by the inter-tile loops that surround the tiled producer, etc.) These can be relaxed over time.

Signed-off-by: Abhishek Varma <abhvarma at amd.com>

---------

Signed-off-by: Abhishek Varma <abhvarma at amd.com>
Signed-off-by: Abhishek Varma <avarma094 at gmail.com>
Co-authored-by: cxy <chenxunyu1993 at gmail.com>



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list