This is an archive of the discontinued LLVM Phabricator instance.

[mlir][linalg] Rename conv_2d_ngchw_fgchw to conv_2d_ngchw_gfchw
Needs ReviewPublic

Authored by kon72 on May 7 2023, 6:26 AM.

Details

Summary

The name conv_2d_ngchw_fgchw suggests it takes a kernel in FGCHW format, but it actually expected the kernel to be in GFCHW format, and Torch-MLIR is using this op on the assumption that it takes GFCHW kernel.
https://github.com/llvm/torch-mlir/blob/0cf9ee340bc3264922e03b0df002e41c69184702/lib/Conversion/TorchToLinalg/Linear.cpp#L826

This change renames conv_2d_ngchw_fgchw to conv_2d_ngchw_gfchw and fixes the shape map.
Note that the behavior of this op remains the same as before.

Also adds a test against static tensors to make sure the data format is correct.

Diff Detail

Event Timeline

kon72 created this revision.May 7 2023, 6:26 AM
Herald added a project: Restricted Project. · View Herald Transcript
kon72 requested review of this revision.May 7 2023, 6:26 AM
kon72 retitled this revision from [mlir][linalg] Fix the naming of grouped conv2d to [mlir][linalg] Rename conv_2d_ngchw_fgchw to conv_2d_ngchw_gfchw.May 12 2023, 12:19 AM

Afterthought, it seems this change was meant to be a part of D128880