llvm-project
llvm-project copied to clipboard
[mlir] [benchmark] [python] MLIR Python benchmark not working
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.
@SaurabhJha Could you help to take a look at this?
Sorry @yifeihe007 , I am not in a position now to work on this.