Skip to content

Commit 89ca978

Browse files
committed
[tuner] use python binding to get indexing maps for root op
Signed-off-by: Bangtian Liu <[email protected]>
1 parent 6519ca9 commit 89ca978

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

tuner/tuner/dispatch_parser.py

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -57,15 +57,8 @@ def get_problem_size(self) -> ProblemSize:
5757
contraction_dims = linalg.infer_contraction_dimensions(root_op)
5858
assert contraction_dims, "no contraction dimensions"
5959

60-
# TODO(Bangtian): Expose Python bindings for getting indexing maps.
61-
indexing_maps_attr = None
62-
for attr in root_op.opview.attributes:
63-
if attr.name == "indexing_maps" and isinstance(attr.attr, ir.ArrayAttr):
64-
indexing_maps_attr = attr.attr
65-
break
66-
67-
assert indexing_maps_attr, "indexing_maps attribute not found"
68-
maps = [attr.value for attr in indexing_maps_attr]
60+
res_maps = linalg.get_indexing_maps(root_op)
61+
maps = [map_attr.value for map_attr in res_maps]
6962
lhs_dims = get_map_result_dim_positions(maps[0])
7063
rhs_dims = get_map_result_dim_positions(maps[1])
7164
res_dims = get_map_result_dim_positions(maps[2])

0 commit comments

Comments
 (0)