<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/71074>71074</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            MLIR Python benchmark not working
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            mlir
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          yifeihe007
      </td>
    </tr>
</table>

<pre>
    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 "/mimer/NOBACKUP/groups/snic2022-22-567/cc/1031/llvm-project/mlir/benchmark/python/benchmark_sparse.py", line 37, in <module>
    def benchmark_sparse_mlir_multiplication():
 File "/mimer/NOBACKUP/groups/snic2022-22-567/cc/1031/llvm-project/mlir/benchmark/python/benchmark_sparse.py", line 25, in run
    f()
  File "/mimer/NOBACKUP/groups/snic2022-22-567/cc/1031/llvm-project/mlir/benchmark/python/benchmark_sparse.py", line 82, in benchmark_sparse_mlir_multiplication
    compiler()
  File "/mimer/NOBACKUP/groups/snic2022-22-567/cc/1031/llvm-project/mlir/benchmark/python/benchmark_sparse.py", line 58, in compiler
    wrapped_func = emit_benchmark_wrapped_main_func(kernel_func, timer_func)
  File "/mimer/NOBACKUP/groups/snic2022-22-567/cc/1031/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.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzMlU1v2zgTxz8NfRlEkEjLkg86JE4EBM_T3aJozwJNjazZ8EUgqQbup19Qlt1t9tBi97C5CJQ0nPn__nwZGQKdLGLDygdWPm7kHEfnmzMNSCPmebU5uv7cPDNeGYj-TPYE0cEcEOKIYDR5mM5xdBaOaNVopH8B5Xpk4p7ljyy_1_qruZu8-wNVZLxNMxhvb8GMt5f5f_3YhUn6gNl0vuS4PL-EpfqI8DawS1k7M-tIkyYlIzkLw2xVGjB-gGc4uQjovfMgAwxOa_dK9nRTeXl-9lLhUaoXYLw2LkTwqNBGUFJr0DJExve3OQAtaQTGeeIigwnst98f7g__-_KR8fbk3TwFxttgSfGc8zvO78pdxXirFONtkYuC8fZfGpSqH0CTRRBVGpIFJg7G9bNGJp6uWgF6HH7JOcbrHzDfGSUvV0o_2-9ww6r6fa5MzVfNv-T_DUo5M5FO6t8xW1mvbDe1N_2vXk4T9l06isDEI6Ch2H3Pd_1vJNkliPH6Bb1Fvb4dICbC9e0_c0A5Y5x9w11duX8KdfPDoPE4dG7oaLft4nnCxRXy2Qc0n3D4fJ4wO2FM610-3BWsfFxqrME3B5LW7LJ1NB1D1gWK2JGlSFLTN8yYOGinpA5MPGUf_v_86SldfUzcw7P9KjX1sOS7HnG8_p3ti3WvNg1pDbxohkDf8IercqSwXqjKGQwweGd-akWy65_5foCYKk6ECsENS4-BgGgCuDn2MmIP0vZgXUzdqU-VpD1DxBBDtukb0e_FXm6wKXb7er8tyjrfjM1e1FKoiu-GXY65wrKvxHZbVz3WeS0FbqjhORdFkfNiV_Bynykx7IWo6_KY9zulBNvmaCTpLHFlzp82FMKMTVXk1Xaj5RF1WLor5xdUnvqsbxYbjvMpsG2uKYm8JYgUNTZp2eDj296a-F6dfyF72sxeN2OMU0gLydu09SmO8zFTzqwb_O_7fFGXTsci8M8AAAD__1uHl34">