This is an archive of the discontinued LLVM Phabricator instance.

[mlir][tosa] Update tosa.matmul lowering to linalg.batch_matmul
ClosedPublic

Authored by rsuderman on Jun 8 2021, 5:32 PM.

Details

Summary

tosa.matmul is a batched matmul, update the lowering for linalg
with the tests.

Diff Detail

Event Timeline

rsuderman created this revision.Jun 8 2021, 5:32 PM
rsuderman requested review of this revision.Jun 8 2021, 5:32 PM
sjarus added inline comments.Jun 8 2021, 11:40 PM
mlir/lib/Conversion/TosaToLinalg/TosaToLinalg.cpp
1022

Disclaimer: I'm not familiar with LinAlg .

I don't quite understand how the batch size is defined here. Is that being assumed 1 ?

rsuderman marked an inline comment as done.Jun 9 2021, 10:05 AM
rsuderman added inline comments.
mlir/lib/Conversion/TosaToLinalg/TosaToLinalg.cpp
1022

Batch size is inteferred from the shape dimensions of the input/output. Batch matmul exactly maps to the semantics of tosa.matmul so it is a trivial conversion.

sjarus accepted this revision.Jun 9 2021, 10:07 AM

Thanks for the explanation!

This revision is now accepted and ready to land.Jun 9 2021, 10:07 AM
This revision was landed with ongoing or failed builds.Jun 9 2021, 11:12 AM
This revision was automatically updated to reflect the committed changes.
rsuderman marked an inline comment as done.