This is an archive of the discontinued LLVM Phabricator instance.

[tosa] Improve inferred shapes of TOSA operations
ClosedPublic

Authored by sabauma on May 23 2023, 9:52 AM.

Details

Summary

The TosaInferShapes pass avoids updating the shapes of tensor operators
when the consumers are not TOSA operations, limiting the efficacy of
TosaInferShapes when the IR is a mix of TOSA and other operations.
This change attempts to update the result shapes when the consumers
themselves have reasonable type/shape inference methods.

Diff Detail

Event Timeline

sabauma created this revision.May 23 2023, 9:52 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 23 2023, 9:52 AM
sabauma retitled this revision from [tosa] Improve inferred shapes of TOSA operations to [mlir][tosa] Improve inferred shapes of TOSA operations.May 23 2023, 9:58 AM
sabauma updated this revision to Diff 524778.May 23 2023, 9:59 AM

Fix typo in test

sabauma published this revision for review.May 24 2023, 6:54 AM
sabauma added a reviewer: rsuderman.

One minor change, otherwise it looks good to me.

mlir/lib/Dialect/Tosa/Transforms/TosaInferShapes.cpp
240–241

This comment doesn't apply with your change. I'd say to get rid of it in favor of the more accurate comment above.

sabauma updated this revision to Diff 525588.May 25 2023, 6:55 AM
sabauma retitled this revision from [mlir][tosa] Improve inferred shapes of TOSA operations to [tosa] Improve inferred shapes of TOSA operations.

Address @eric-k256's comments

sabauma updated this revision to Diff 525589.May 25 2023, 6:56 AM

Revert accidental change to file

sabauma marked an inline comment as done.May 25 2023, 6:58 AM
eric-k256 accepted this revision.May 25 2023, 9:38 AM

Looks good, thanks for the fix.

This revision is now accepted and ready to land.May 25 2023, 9:38 AM
This revision was automatically updated to reflect the committed changes.