[all-commits] [llvm/llvm-project] 5988a3: [mlir] Linalg: ensure tile-and-pad always creates ...

ftynse via All-commits all-commits at lists.llvm.org
Fri Sep 24 09:40:28 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 5988a3b7a09126aff982944ecb36f533c450388e
      https://github.com/llvm/llvm-project/commit/5988a3b7a09126aff982944ecb36f533c450388e
  Author: Alex Zinenko <zinenko at google.com>
  Date:   2021-09-24 (Fri, 24 Sep 2021)

  Changed paths:
    M mlir/include/mlir/Dialect/Linalg/IR/LinalgOps.td
    M mlir/lib/Conversion/TosaToLinalg/TosaToLinalg.cpp
    M mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp
    M mlir/lib/Dialect/Linalg/Transforms/Transforms.cpp
    M mlir/test/Dialect/Linalg/canonicalize.mlir
    M mlir/test/Dialect/Linalg/tile-and-pad-tensors.mlir

  Log Message:
  -----------
  [mlir] Linalg: ensure tile-and-pad always creates padding as requested

Initially, the padding transformation and the related operation were only used
to guarantee static shapes of subtensors in tiled operations. The
transformation would not insert the padding operation if the shapes were
already static, and the overall code generation would actively remove such
"noop" pads. However, this transformation can be also used to pack data into
smaller tensors and marshall them into faster memory, regardless of the size
mismatches. In context of expert-driven transformation, we should assume that,
if padding is requested, a potentially padded tensor must be always created.
Update the transformation accordingly. To do this, introduce an optional
`packing` attribute to the `pad_tensor` op that serves as an indication that
the padding is an intentional choice (as opposed to side effect of type
normalization) and should be left alone by cleanups.

Reviewed By: nicolasvasilache

Differential Revision: https://reviews.llvm.org/D110425




More information about the All-commits mailing list