llvm-project icon indicating copy to clipboard operation
llvm-project copied to clipboard

[mlir] [benchmark] [python] MLIR Python benchmark not working

Open yifeihe007 opened this issue 3 years ago • 2 comments

I'm trying to use the mlir python benchmark code: llvm-project/mlir/benchmark/python/benchmark_sparse.py

Using the benchmark_sparse_mlir_multiplication function, I got error as following:

Traceback (most recent call last):
  File "llvm-project/mlir/benchmark/python/benchmark_sparse.py", line 37, in <module>
    def benchmark_sparse_mlir_multiplication():
  File "llvm-project/mlir/benchmark/python/benchmark_sparse.py", line 25, in run
    f()
  File "llvm-project/mlir/benchmark/python/benchmark_sparse.py", line 82, in benchmark_sparse_mlir_multiplication
    compiler()
  File "llvm-project/mlir/benchmark/python/benchmark_sparse.py", line 58, in compiler
    wrapped_func = emit_benchmark_wrapped_main_func(kernel_func, timer_func)
  File "llvm-project/mlir/benchmark/python/common.py", line 78, in emit_benchmark_wrapped_main_func
    memref_of_i64_type = ir.MemRefType.get([-1], i64_type)
mlir._mlir_libs._site_initialize.<locals>.MLIRError: Invalid type:
error: unknown: invalid memref size

This error comes from emit_benchmark_wrapped_main_func in llvm-project/mlir/benchmark/python/common.py, this piece of code seems outdated and not used in any tests.

yifeihe007 avatar Nov 02 '23 16:11 yifeihe007

@SaurabhJha Could you help to take a look at this?

yifeihe007 avatar Nov 07 '23 15:11 yifeihe007

Sorry @yifeihe007 , I am not in a position now to work on this.

SaurabhJha avatar Nov 09 '23 10:11 SaurabhJha