Tosa shape verification prevent shape propagation when coming from a dialect
of known shape. Relax this constraint to allow ingestion / shape propagation
from these other dialects.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Relaxed tosa tensor types to allow unranked in all cases as they could be
refined to valid types.
mlir/include/mlir/Dialect/Tosa/IR/TosaTypesBase.td | ||
---|---|---|
123 ↗ | (On Diff #361019) | I think it may confuse people if the Tosa_TensorND now includes unranked along with the given rank. Most of the ops which are flexible in their rank already take Tosa_Tensor, which is supposed to take ranked and unranked. |
Updated with comment.
The short is we wanted unranked to be supported so that shape inference can
propagate to unranked tensors. If unranked tensors are illegal it requires all
constructed TOSA IR to be always valid.
By enabling unranked we can allow the shape inference to propagate known shapes
then fail if unranked tensors remain in the IR.
mlir/include/mlir/Dialect/Tosa/IR/TosaTypesBase.td | ||
---|---|---|
123 ↗ | (On Diff #361019) | Added a comment to clarify. Short story is we need flexibility on allowing unranked tensors so that shape inference on unknown shape lowerings to still lower to TOSA. Then Tosa's shape inference can handle the remaining shape inference. Essentially we can't say an UnrankedTensor is invalid because its rank is unknown. Rather we should depend on shape inference to propagate the shape and then (only) when that shape cannot be propagate we can label the IR as invalid. |