[Mlir-commits] [mlir] 81ead8a - [mlir][Linalg] Temporarily circumvent TensorConstant bufferize bug

Nicolas Vasilache llvmlistbot at llvm.org
Mon Oct 12 13:25:17 PDT 2020


Author: Nicolas Vasilache
Date: 2020-10-12T20:23:57Z
New Revision: 81ead8a53525abe1f149b3c5ad1bb44ee258d10f

URL: https://github.com/llvm/llvm-project/commit/81ead8a53525abe1f149b3c5ad1bb44ee258d10f
DIFF: https://github.com/llvm/llvm-project/commit/81ead8a53525abe1f149b3c5ad1bb44ee258d10f.diff

LOG: [mlir][Linalg] Temporarily circumvent TensorConstant bufferize bug

The TensorConstantOp bufferize conversion pattern has a bug that
makes it incorrect in the case of vectors whose alignment is not
the natural alignment. Circumvent it temporarily by using a power of 2.

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

Added: 
    

Modified: 
    mlir/integration_test/Dialect/Linalg/CPU/test-tensor-matmul.mlir

Removed: 
    


################################################################################
diff  --git a/mlir/integration_test/Dialect/Linalg/CPU/test-tensor-matmul.mlir b/mlir/integration_test/Dialect/Linalg/CPU/test-tensor-matmul.mlir
index 2c01a688cfa0..b706c9cef976 100644
--- a/mlir/integration_test/Dialect/Linalg/CPU/test-tensor-matmul.mlir
+++ b/mlir/integration_test/Dialect/Linalg/CPU/test-tensor-matmul.mlir
@@ -4,13 +4,12 @@
 // RUN: | FileCheck %s
 
 func @main() {
-  %A = constant dense<[[1.0, 2.0, 3.0], [4.0, 5.0, 6.0]]> : tensor<2x3xf32>
+  %A = constant dense<[[1.0, 2.0], [4.0, 5.0]]> : tensor<2x2xf32>
   %B = constant dense<[[1.0, 2.0, 3.0, 4.0],
-                       [5.0, 6.0, 7.0, 8.0],
-                       [9.0, 10.0, 11.0, 12.0]]> : tensor<3x4xf32>
+                       [5.0, 6.0, 7.0, 8.0]]> : tensor<2x4xf32>
   %C = constant dense<1000.0> : tensor<2x4xf32>
 
-  %D = linalg.matmul ins(%A, %B: tensor<2x3xf32>, tensor<3x4xf32>)
+  %D = linalg.matmul ins(%A, %B: tensor<2x2xf32>, tensor<2x4xf32>)
                      init(%C: tensor<2x4xf32>) -> tensor<2x4xf32>
 
   %unranked = tensor_cast %D : tensor<2x4xf32> to tensor<*xf32>
@@ -18,8 +17,8 @@ func @main() {
 
   //      CHECK: Unranked Memref base@ = {{0x[-9a-f]*}}
   // CHECK-SAME: rank = 2 offset = 0 sizes = [2, 4] strides = [4, 1] data =
-  // CHECK-NEXT: [1038,   1044,   1050,   1056]
-  // CHECK-NEXT: [1065,   1074,   1083,   1092]
+  // CHECK-NEXT: [1011, 1014, 1017, 1020]
+  // CHECK-NEXT: [1029, 1038, 1047, 1056]
 
   return
 }


        


More information about the Mlir-commits mailing list