buddy-compiler / buddy-benchmark

Benchmark Framework for Buddy Projects
Apache License 2.0
46 stars 39 forks source link

MatMul benchmark fails in benchmarks/OpOptimization #70

Closed xlinsist closed 1 year ago

xlinsist commented 1 year ago

To reproduce

$ cd buddy-benchmark
$ mkdir build && cd build
$ cmake -G Ninja .. \
    -DCMAKE_BUILD_TYPE=RELEASE \
    -DOP_OPTIMIZATION_BENCHMARKS=ON \
    -DBUDDY_MLIR_BUILD_DIR=/PATH/TO/BUDDY-MLIR/BUILD/
$ ninja

Errors shown

[1/21] Generating mlir-gemm.o
/root/buddy-benchmark/benchmarks/OpOptimization/MatMul/gemm.mlir:2:21: error: failed to legalize operation 'builtin.unrealized_conversion_cast' that was explicitly marked illegal
    func.func @gemm(%a : memref<?x?xf32>, %b : memref<?x?xf32>, %c : memref<?x?xf32>) {
                    ^
/root/buddy-benchmark/benchmarks/OpOptimization/MatMul/gemm.mlir:2:21: note: see current operation: %8 = "builtin.unrealized_conversion_cast"(%7) : (!llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)>) -> memref<?x?xf32>

Additional details

While the benchmark of MatMul fails, Conv2dNchwFchw works fine and the binary file conv2d-benchmark can be generated and successfully executed in build/bin. This bug occurs after the latest sync to llvm.

xlinsist commented 1 year ago

Fixed in https://github.com/buddy-compiler/buddy-benchmark/commit/5e5fcea66e345da4344ba45fb5547b81919fb292, closing it.