This is an archive of the discontinued LLVM Phabricator instance.

[mlir][tosa] Added shape inference for tosa convolution operations
ClosedPublic

Authored by rsuderman on Jul 8 2021, 11:13 AM.

Details

Summary

Added shape inference handles cases for convolution operations. This includes
conv2d, conv3d, depthwise_conv2d, and transpose_conv2d. With transpose conv
we use the specified output shape when possible however will shape propagate
if the output shape attribute has dynamic values.

Diff Detail

Event Timeline

rsuderman created this revision.Jul 8 2021, 11:13 AM
rsuderman requested review of this revision.Jul 8 2021, 11:13 AM

Rebased to head

Quick comment (forgot to hit send earlier, will do full review tomorrow)

mlir/lib/Dialect/Tosa/IR/TosaOps.cpp
852

outputShape(4, ShapedType::kDynamic) ? (then you can avoid resize below)

856

Could we use ShapedType::kDynamic here and below or does -1 not signal dynamic but something else?

878

If we can use kDynamic above, then this becomes ShapedType::isDynamic(outputShape[3])

rsuderman updated this revision to Diff 358443.Jul 13 2021, 3:19 PM

Addressed initial comments by jpienaar

jpienaar accepted this revision.Jul 16 2021, 9:17 AM

Looks good, thanks

This revision is now accepted and ready to land.Jul 16 2021, 9:17 AM