iree-org / iree

A retargetable MLIR-based machine learning compiler and runtime toolkit.
http://iree.dev/
Apache License 2.0
2.85k stars 621 forks source link

[Encoding] Introduce "layouts" field to EncodingAttr. #19215

Closed hanhanW closed 4 days ago

hanhanW commented 6 days ago

The revision introduces an optional "layouts" field to EncodingAttr. It is an array of attributes that describes the potential layouts on the device. It is an array because a device could have several executable targets. Note that it can be any attribute that implements EncodingLayoutAttrInterface. The expectation of the field is to bridge the logics between host codes and device codes. If an attribute does not implement the interface, it could be discarded anytime.

The revision also updates the TODO item for round_dims_to field. Because IREE is going to use the new "layouts" field and upcoming attribute interface to handle the allocation problem.

It is a step towards https://github.com/iree-org/iree/issues/17924

hanhanW commented 5 days ago

rebased and updated the comment, please review the last commit.