This is an archive of the discontinued LLVM Phabricator instance.

[mlir][linalg] Define a depthwise 2-D convolution op
ClosedPublic

Authored by antiagainst on Jan 19 2021, 5:09 AM.

Details

Summary

This commit defines linalg.depthwise_conv_2d_nhwc for depthwise
2-D convolution with NHWC input/output data format.

This op right now only support channel multiplier == 1, which is
the most common case.

Depends on D96297

Diff Detail

Event Timeline

antiagainst created this revision.Jan 19 2021, 5:09 AM
antiagainst requested review of this revision.Jan 19 2021, 5:09 AM
mehdi_amini added inline comments.Jan 19 2021, 2:46 PM
mlir/test/Dialect/Linalg/named-ops.mlir
27

Can you add failing tests here? (missing strides attribute, or invalid type/shape for the strides attributes for example)

I'd also look for a linalg-generalize-named-ops test to check the semantics.

+1 on the negative tests but IIRC there is no size check/verifier automatically generated from the affine maps?
This is generally something we want for all linalg ops but it is missing atm.

mlir/include/mlir/Dialect/Linalg/IR/LinalgNamedStructuredOpsSpec.tc
96

The commit message mentions channel multiplier must be 1, this description should also be loud about it if people expect this parameter, as it does not appear here.

Address comments

antiagainst edited the summary of this revision. (Show Details)Feb 8 2021, 2:58 PM
antiagainst marked 2 inline comments as done.
antiagainst added inline comments.
mlir/test/Dialect/Linalg/named-ops.mlir
27

Good point. Actually this reveals a hidden issue. I've captured more in D96297 and proposed a solution there. Let me know if you think there are better ways to handle it.

nicolasvasilache accepted this revision.Feb 8 2021, 11:39 PM

looks good post D96297, thanks!

This revision is now accepted and ready to land.Feb 8 2021, 11:39 PM
This revision was automatically updated to reflect the committed changes.
antiagainst marked an inline comment as done.