This is an archive of the discontinued LLVM Phabricator instance.

[tosa][mlir] Fix FullyConnected to correctly order dimensions
ClosedPublic

Authored by rsuderman on Apr 23 2021, 7:26 PM.

Details

Summary

MatMul and FullyConnected have transposed dimensions for the weights.
Also, removed uneeded tensor reshape for bias.

Diff Detail

Event Timeline

rsuderman created this revision.Apr 23 2021, 7:26 PM
rsuderman requested review of this revision.Apr 23 2021, 7:26 PM
mravishankar accepted this revision.Apr 26 2021, 2:14 PM
mravishankar added inline comments.
mlir/lib/Conversion/TosaToLinalg/TosaToLinalg.cpp
802–803

I understand that you want to do this, but just to throw this out there, might want to actually have the transpose variants of matmul. You could write compiler passes to combine transpose with matmuls and present different variants to code-generation.

This revision is now accepted and ready to land.Apr 26 2021, 2:14 PM
rsuderman marked an inline comment as done.Apr 27 2021, 5:25 PM
rsuderman added inline comments.
mlir/lib/Conversion/TosaToLinalg/TosaToLinalg.cpp
802–803

In progress of discussing named op variants of matmul. To avoid having this be a block issue I'll submit and update to whatever solution we find.

rsuderman marked an inline comment as done.Apr 27 2021, 5:32 PM