Drop `EncodingRole` enum, replace by operand index
bjacob opened this issue · comments
Currently, one of the fields in the encoding
attribute on a tensor is role
,
Which is an enum defined in the same file,
iree/compiler/src/iree/compiler/Dialect/Encoding/IR/EncodingBase.td
Lines 51 to 56 in 58feff3
These values LHS
, RHS
, etc, don't scale very well to other ops we want to support data-tiling for, such as convolutions, for which we rather talk of input and filter and would then want to add new enumeration values for that.
Instead, this role
attribute should just be replaced by the operand index, just an integer (index) attribute. It could be renamed operand_index
.
For a matmul: LHS = operand index 0, RHS = operand index 1, RESULT (by which we really meant the accumulator) = operand index 2.
Question - do we want to separate the inputs (ins
) from the Inits (outs
)? I don't think that's necessary. Just we will have to get used to the result value being encoded as the corresponding init-value (outs[0] => operand index 2 since the outs
come after the ins
).