The benchmark currently fails to run because it cannot find the func
symbol when using a FuncOp. I suppose that the breakage was introduced
by the extraction of the func dialect from the builtin dialect that
wasn't reflected in the benchmark yet.
Details
Details
- Reviewers
aartbik - Commits
- rG5da5483ffb40: [mlir][benchmark] Fix import in sparse benchmark.
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Comment Actions
Updating D129738: [mlir][benchmark] Fix import in sparse benchmark.
The update also fixes problems in common.py, which I had not seen
previously. Those must have been introduced in an attempt to port the
file to the new organization of the func dialect, but that attempt
introduced a name clash on the name func.
Also, the benchmark only runs with the following work-around, which I
assume to be a bug in the python bindings of BlockArgumentList:
patch diff --git a/mlir/benchmark/python/common.py b/mlir/benchmark/python/common.py index 3d80892b0fb8..864b456fe817 100644 --- a/mlir/benchmark/python/common.py +++ b/mlir/benchmark/python/common.py @@ -94,10 +94,9 @@ def emit_benchmark_wrapped_main_func(kernel_func, timer_func): loop = scf.ForOp(zero, n_iterations, one, iter_args) with ir.InsertionPoint(loop.body): start = func.CallOp(timer_func, []) - call = func.CallOp( - kernel_func, - wrapped_func.arguments[:-num_results - 1] + loop.inner_iter_args - ) + args = [a for a in wrapped_func.arguments[:-num_results - 1]] + \ + [a for a in loop.inner_iter_args] + call = func.CallOp(kernel_func, args) end = func.CallOp(timer_func, []) time_taken = arith.SubIOp(end, start) memref.StoreOp(time_taken, timer_buffer, [loop.induction_variable])
Comment Actions
Thanks for fixing. At the moment, this code is not look at by many but I plan to change that. It explains why nobody had seen this yet ;-)