[all-commits] [llvm/llvm-project] b9ff67: [MLIR] Make structured op tests permutation invariant

Geoffrey Martin-Noble via All-commits all-commits at lists.llvm.org
Thu Feb 18 14:36:30 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: b9ff67099ad6da931976e66f1510c5af2558a86e
      https://github.com/llvm/llvm-project/commit/b9ff67099ad6da931976e66f1510c5af2558a86e
  Author: Geoffrey Martin-Noble <gcmn at google.com>
  Date:   2021-02-18 (Thu, 18 Feb 2021)

  Changed paths:
    M mlir/include/mlir/Dialect/Utils/StructuredOpsUtils.h
    M mlir/lib/Dialect/CMakeLists.txt
    A mlir/lib/Dialect/Utils/CMakeLists.txt
    A mlir/lib/Dialect/Utils/StructuredOpsUtils.cpp
    M mlir/lib/Dialect/Vector/CMakeLists.txt
    A mlir/unittests/Dialect/Utils/CMakeLists.txt
    A mlir/unittests/Dialect/Utils/StructuredOpsUtilsTest.cpp

  Log Message:
  -----------
  [MLIR] Make structured op tests permutation invariant

Extracts the relevant dimensions from the map under test to build up the
maps to test against in a permutation-invariant way.

This also includes a fix to the indexing maps used by
isColumnMajorMatmul. The maps as currently written do not describe a
column-major matmul. The linalg named op column_major_matmul has the
correct maps (and notably fails the current test).

If `C = matmul(A, B)` we want an operation that given A in column major
format and B in column major format produces C in column major format.
Given that for a matrix, faux column major is just transpose.
`column_major_matmul(transpose(A), transpose(B)) = transpose(C)`. If
`A` is `NxK` and `B` is `KxM`, then `C` is `NxM`, so `transpose(A)` is
`KxN`, `transpose(B)` is `MxK` and `transpose(C)` is `MxN`, not `NxM`
as these maps currently have.

Reviewed By: nicolasvasilache

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




More information about the All-commits mailing list