From d9948fa9d09a998e048110b476e921d4fdabb5ea Mon Sep 17 00:00:00 2001 From: Franco Nieddu Date: Thu, 11 Jan 2024 15:58:25 +0100 Subject: [PATCH] test: moved Einsum tests to finished --- .../Ops/Onnx/Einsum/EinsumInnerProd.json | 1 + .../Einsum/EinsumInnerProd.onnx | Bin .../tests/Ops/Onnx/Einsum/EinsumInnerProd.res | 3 ++ .../tests/Ops/Onnx/Einsum/EinsumSimple.json | 1 + .../Einsum/EinsumSimple.onnx | 0 .../tests/Ops/Onnx/Einsum/EinsumSimple.res | 3 ++ .../tests/Ops/Onnx/Einsum/EinsumSum.json | 1 + .../Einsum/EinsumSum.onnx | 0 .../tests/Ops/Onnx/Einsum/EinsumSum.res | 3 ++ .../Problematic/Einsum/EinsumInnerProd.json | 1 - .../Problematic/Einsum/EinsumInnerProd.mlir | 26 ------------------ .../Ops/Problematic/Einsum/EinsumSimple.json | 1 - .../Ops/Problematic/Einsum/EinsumSimple.res | 3 -- .../Ops/Problematic/Einsum/EinsumSum.json | 1 - .../Ops/Problematic/Einsum/EinsumSum.res | 3 -- 15 files changed, 12 insertions(+), 35 deletions(-) create mode 100644 mlir-assigner/tests/Ops/Onnx/Einsum/EinsumInnerProd.json rename mlir-assigner/tests/Ops/{Problematic => Onnx}/Einsum/EinsumInnerProd.onnx (100%) create mode 100644 mlir-assigner/tests/Ops/Onnx/Einsum/EinsumInnerProd.res create mode 100644 mlir-assigner/tests/Ops/Onnx/Einsum/EinsumSimple.json rename mlir-assigner/tests/Ops/{Problematic => Onnx}/Einsum/EinsumSimple.onnx (100%) create mode 100644 mlir-assigner/tests/Ops/Onnx/Einsum/EinsumSimple.res create mode 100644 mlir-assigner/tests/Ops/Onnx/Einsum/EinsumSum.json rename mlir-assigner/tests/Ops/{Problematic => Onnx}/Einsum/EinsumSum.onnx (100%) create mode 100644 mlir-assigner/tests/Ops/Onnx/Einsum/EinsumSum.res delete mode 100644 mlir-assigner/tests/Ops/Problematic/Einsum/EinsumInnerProd.json delete mode 100644 mlir-assigner/tests/Ops/Problematic/Einsum/EinsumInnerProd.mlir delete mode 100644 mlir-assigner/tests/Ops/Problematic/Einsum/EinsumSimple.json delete mode 100644 mlir-assigner/tests/Ops/Problematic/Einsum/EinsumSimple.res delete mode 100644 mlir-assigner/tests/Ops/Problematic/Einsum/EinsumSum.json delete mode 100644 mlir-assigner/tests/Ops/Problematic/Einsum/EinsumSum.res diff --git a/mlir-assigner/tests/Ops/Onnx/Einsum/EinsumInnerProd.json b/mlir-assigner/tests/Ops/Onnx/Einsum/EinsumInnerProd.json new file mode 100644 index 0000000..cab9c5f --- /dev/null +++ b/mlir-assigner/tests/Ops/Onnx/Einsum/EinsumInnerProd.json @@ -0,0 +1 @@ +[{"memref": {"data": [0.6612396240234375, 0.8197021484375, 0.279388427734375, 0.43798828125, 0.9425506591796875], "dims": [5], "type": "f32"}}, {"memref": {"data": [0.6065216064453125, 0.0611572265625, 0.1334381103515625, 0.62799072265625, 0.130889892578125], "dims": [5], "type": "f32"}}] \ No newline at end of file diff --git a/mlir-assigner/tests/Ops/Problematic/Einsum/EinsumInnerProd.onnx b/mlir-assigner/tests/Ops/Onnx/Einsum/EinsumInnerProd.onnx similarity index 100% rename from mlir-assigner/tests/Ops/Problematic/Einsum/EinsumInnerProd.onnx rename to mlir-assigner/tests/Ops/Onnx/Einsum/EinsumInnerProd.onnx diff --git a/mlir-assigner/tests/Ops/Onnx/Einsum/EinsumInnerProd.res b/mlir-assigner/tests/Ops/Onnx/Einsum/EinsumInnerProd.res new file mode 100644 index 0000000..5625837 --- /dev/null +++ b/mlir-assigner/tests/Ops/Onnx/Einsum/EinsumInnerProd.res @@ -0,0 +1,3 @@ +Result: +memref[0.8868908246513456] +12 diff --git a/mlir-assigner/tests/Ops/Onnx/Einsum/EinsumSimple.json b/mlir-assigner/tests/Ops/Onnx/Einsum/EinsumSimple.json new file mode 100644 index 0000000..2555db4 --- /dev/null +++ b/mlir-assigner/tests/Ops/Onnx/Einsum/EinsumSimple.json @@ -0,0 +1 @@ +[{"memref": {"data": [0.8265838623046875, 0.6218414306640625, 0.9638824462890625, 0.7792510986328125, 0.7453765869140625, 0.5666656494140625, 0.3115386962890625, 0.1643829345703125, 0.6309967041015625, 0.61712646484375, 0.2880096435546875, 0.8087158203125], "dims": [1, 3, 4], "type": "f32"}}, {"memref": {"data": [0.2086334228515625, 0.7121429443359375, 0.9512939453125, 0.50048828125, 0.7658538818359375, 0.426971435546875, 0.555084228515625, 0.8116912841796875, 0.5715789794921875, 0.2431793212890625, 0.067138671875, 0.2467498779296875, 0.1278839111328125, 0.1687164306640625, 0.506866455078125, 0.9836273193359375, 0.244659423828125, 0.8301849365234375, 0.2261505126953125, 0.7335205078125, 0.152557373046875, 0.5252227783203125, 0.154022216796875, 0.5016326904296875], "dims": [1, 4, 6], "type": "f32"}}] \ No newline at end of file diff --git a/mlir-assigner/tests/Ops/Problematic/Einsum/EinsumSimple.onnx b/mlir-assigner/tests/Ops/Onnx/Einsum/EinsumSimple.onnx similarity index 100% rename from mlir-assigner/tests/Ops/Problematic/Einsum/EinsumSimple.onnx rename to mlir-assigner/tests/Ops/Onnx/Einsum/EinsumSimple.onnx diff --git a/mlir-assigner/tests/Ops/Onnx/Einsum/EinsumSimple.res b/mlir-assigner/tests/Ops/Onnx/Einsum/EinsumSimple.res new file mode 100644 index 0000000..612ed7b --- /dev/null +++ b/mlir-assigner/tests/Ops/Onnx/Einsum/EinsumSimple.res @@ -0,0 +1,3 @@ +Result: +memref<1x3x6xf32>[0.8171204328536987, 1.827608585357666, 1.74919593334198, 1.9222960472106934, 1.0306369066238403, 1.697465419769287, 0.5470737218856812, 1.1639121770858765, 1.215952754020691, 0.9036292433738708, 0.7104341983795166, 0.7991737723350525, 0.6939274668693542, 1.592077612876892, 1.2223577499389648, 1.17392897605896, 0.7197088003158569, 1.0664730072021484] +38 diff --git a/mlir-assigner/tests/Ops/Onnx/Einsum/EinsumSum.json b/mlir-assigner/tests/Ops/Onnx/Einsum/EinsumSum.json new file mode 100644 index 0000000..8ee88ae --- /dev/null +++ b/mlir-assigner/tests/Ops/Onnx/Einsum/EinsumSum.json @@ -0,0 +1 @@ +[{"memref": {"data": [0.8116607666015625, 0.2871551513671875, 0.3785400390625, 0.23797607421875, 0.45184326171875, 0.5684051513671875, 0.4949798583984375, 0.433502197265625, 0.3442230224609375, 0.9390106201171875, 0.2042694091796875, 0.2279205322265625, 0.0595703125, 0.33203125, 0.2831878662109375], "dims": [3, 5], "type": "f32"}}] \ No newline at end of file diff --git a/mlir-assigner/tests/Ops/Problematic/Einsum/EinsumSum.onnx b/mlir-assigner/tests/Ops/Onnx/Einsum/EinsumSum.onnx similarity index 100% rename from mlir-assigner/tests/Ops/Problematic/Einsum/EinsumSum.onnx rename to mlir-assigner/tests/Ops/Onnx/Einsum/EinsumSum.onnx diff --git a/mlir-assigner/tests/Ops/Onnx/Einsum/EinsumSum.res b/mlir-assigner/tests/Ops/Onnx/Einsum/EinsumSum.res new file mode 100644 index 0000000..6d8f823 --- /dev/null +++ b/mlir-assigner/tests/Ops/Onnx/Einsum/EinsumSum.res @@ -0,0 +1,3 @@ +Result: +memref<3xf32>[2.16717529296875, 2.780120849609375, 1.1069793701171875] +18 diff --git a/mlir-assigner/tests/Ops/Problematic/Einsum/EinsumInnerProd.json b/mlir-assigner/tests/Ops/Problematic/Einsum/EinsumInnerProd.json deleted file mode 100644 index fd03593..0000000 --- a/mlir-assigner/tests/Ops/Problematic/Einsum/EinsumInnerProd.json +++ /dev/null @@ -1 +0,0 @@ -[{"memref": {"data": [0.0347747802734375, 0.4170684814453125, 0.787994384765625, 0.239959716796875, 0.0882110595703125], "dims": [5], "type": "f32"}}, {"memref": {"data": [0.4361572265625, 0.0735931396484375, 0.562652587890625, 0.311737060546875, 0.0066070556640625], "dims": [5], "type": "f32"}}] \ No newline at end of file diff --git a/mlir-assigner/tests/Ops/Problematic/Einsum/EinsumInnerProd.mlir b/mlir-assigner/tests/Ops/Problematic/Einsum/EinsumInnerProd.mlir deleted file mode 100644 index c3e54ec..0000000 --- a/mlir-assigner/tests/Ops/Problematic/Einsum/EinsumInnerProd.mlir +++ /dev/null @@ -1,26 +0,0 @@ -module attributes {llvm.data_layout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128", llvm.target_triple = "x86_64-pc-linux-gnu", "onnx-mlir.symbol-postfix" = "einsuminnerprod.mlir"} { - func.func @main_graph(%arg0: memref<5xf32>, %arg1: memref<5xf32>) -> memref attributes {input_names = ["in_a", "in_b"], llvm.emit_c_interface, output_names = ["out_a"]} { - %reinterpret_cast = memref.reinterpret_cast %arg0 to offset: [0], sizes: [1, 5], strides: [5, 1] : memref<5xf32> to memref<1x5xf32> - %reinterpret_cast_0 = memref.reinterpret_cast %arg1 to offset: [0], sizes: [5, 1], strides: [1, 1] : memref<5xf32> to memref<5x1xf32> - %alloc = memref.alloc() {alignment = 16 : i64} : memref<1x1xf32> - %alloc_1 = memref.alloc() : memref<5xf32> - %alloc_2 = memref.alloc() : memref<5xf32> - affine.for %arg2 = 0 to 1 { - affine.for %arg3 = 0 to 1 { - affine.for %arg4 = 0 to 5 { - %1 = affine.load %reinterpret_cast[%arg2, %arg4] : memref<1x5xf32> - %2 = affine.load %reinterpret_cast_0[%arg4, %arg3] : memref<5x1xf32> - affine.store %1, %alloc_1[%arg4] : memref<5xf32> - affine.store %2, %alloc_2[%arg4] : memref<5xf32> - } - %0 = "zkML.dot-product"(%alloc_1, %alloc_2) : (memref<5xf32>, memref<5xf32>) -> f32 - affine.store %0, %alloc[%arg2, %arg3] : memref<1x1xf32> - } - } - memref.dealloc %alloc_1 : memref<5xf32> - memref.dealloc %alloc_2 : memref<5xf32> - %reinterpret_cast_3 = memref.reinterpret_cast %alloc to offset: [0], sizes: [], strides: [] : memref<1x1xf32> to memref - return %reinterpret_cast_3 : memref - } - "krnl.entry_point"() {func = @main_graph, numInputs = 2 : i32, numOutputs = 1 : i32, signature = "[ { \22type\22 : \22f32\22 , \22dims\22 : [5] , \22name\22 : \22in_a\22 }\0A , { \22type\22 : \22f32\22 , \22dims\22 : [5] , \22name\22 : \22in_b\22 }\0A\0A]\00@[ { \22type\22 : \22f32\22 , \22dims\22 : [] , \22name\22 : \22out_a\22 }\0A\0A]\00"} : () -> () -} diff --git a/mlir-assigner/tests/Ops/Problematic/Einsum/EinsumSimple.json b/mlir-assigner/tests/Ops/Problematic/Einsum/EinsumSimple.json deleted file mode 100644 index b3840f6..0000000 --- a/mlir-assigner/tests/Ops/Problematic/Einsum/EinsumSimple.json +++ /dev/null @@ -1 +0,0 @@ -[{"memref": {"data": [0.6128387451171875, 0.1035003662109375, 0.873260498046875, 0.59619140625, 0.4374847412109375, 0.23828125, 0.1722869873046875, 0.1845550537109375, 0.0517425537109375, 0.72930908203125, 0.0628509521484375, 0.0171661376953125], "dims": [1, 3, 4], "type": "f32"}}, {"memref": {"data": [0.8438568115234375, 0.906829833984375, 0.7076263427734375, 0.112945556640625, 0.6533660888671875, 0.005523681640625, 0.539764404296875, 0.4152069091796875, 0.1634674072265625, 0.6858062744140625, 0.23675537109375, 0.681060791015625, 0.3037109375, 0.1006927490234375, 0.5829925537109375, 0.8340301513671875, 0.266876220703125, 0.967376708984375, 0.9199066162109375, 0.30657958984375, 0.198883056640625, 0.0484161376953125, 0.2684173583984375, 0.211700439453125], "dims": [1, 4, 6], "type": "f32"}}] \ No newline at end of file diff --git a/mlir-assigner/tests/Ops/Problematic/Einsum/EinsumSimple.res b/mlir-assigner/tests/Ops/Problematic/Einsum/EinsumSimple.res deleted file mode 100644 index 1479fca..0000000 --- a/mlir-assigner/tests/Ops/Problematic/Einsum/EinsumSimple.res +++ /dev/null @@ -1,3 +0,0 @@ -Result: -memref<1x3x6xf32>[1.3866732120513916, 0.8694256544113159, 1.0782564878463745, 0.8973894715309143, 0.8179929256439209, 1.044861078262329, 0.7198890447616577, 0.5695891380310059, 0.48567384481430054, 0.3654547333717346, 0.4377691149711609, 0.370437353849411, 0.47219812870025635, 0.36132729053497314, 0.19588835537433624, 0.5592595934867859, 0.22785578668117523, 0.5614242553710938] -ADD THE ROWS HERE \ No newline at end of file diff --git a/mlir-assigner/tests/Ops/Problematic/Einsum/EinsumSum.json b/mlir-assigner/tests/Ops/Problematic/Einsum/EinsumSum.json deleted file mode 100644 index b4024e3..0000000 --- a/mlir-assigner/tests/Ops/Problematic/Einsum/EinsumSum.json +++ /dev/null @@ -1 +0,0 @@ -[{"memref": {"data": [0.78106689453125, 0.72314453125, 0.8937530517578125, 0.323822021484375, 0.996337890625, 0.5211029052734375, 0.283172607421875, 0.2689666748046875, 0.2173919677734375, 0.9206695556640625, 0.6438140869140625, 0.718505859375, 0.4782257080078125, 0.70831298828125, 0.99298095703125], "dims": [3, 5], "type": "f32"}}] \ No newline at end of file diff --git a/mlir-assigner/tests/Ops/Problematic/Einsum/EinsumSum.res b/mlir-assigner/tests/Ops/Problematic/Einsum/EinsumSum.res deleted file mode 100644 index 68a861d..0000000 --- a/mlir-assigner/tests/Ops/Problematic/Einsum/EinsumSum.res +++ /dev/null @@ -1,3 +0,0 @@ -Result: -memref<3xf32>[3.7181243896484375, 2.2113037109375, 3.541839599609375] -ADD THE ROWS HERE \ No newline at end of file