This is an archive of the discontinued LLVM Phabricator instance.

[mlir][linalg] Downscale 2D convolution with unit dimensions to 1D convolution
ClosedPublic

Authored by devajith-huawei on Mar 2 2023, 7:07 AM.

Details

Summary

Decompose conv_2d -> conv_1d.

This MR follows a similar approach to https://reviews.llvm.org/D112928.

This patch adds support to convert conv_2D operation with either unit height or unit width to conv_1D operation.

This is useful when 2D convolution is tiled to have a single dimension for either height or width and then can be vectorized once it is decomposed into 1D convolution.

This patch https://reviews.llvm.org/D145160 adds vector support for linalg.conv_1d operation and thereby allowing us to vectorize linalg.conv_2d operation after proper tiling.

This missing feature is reported here: https://discourse.llvm.org/t/vectorization-of-convolution-op/60458.

Diff Detail

Event Timeline

devajith-huawei created this revision.Mar 2 2023, 7:07 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 2 2023, 7:07 AM
devajith-huawei requested review of this revision.Mar 2 2023, 7:07 AM

Thanks for the contributions! Could you please submit a patch with full context? https://llvm.org/docs/DeveloperPolicy.html#making-and-submitting-a-patch

devajith-huawei edited the summary of this revision. (Show Details)Mar 3 2023, 1:24 PM

Thanks for the contributions! Could you please submit a patch with full context? https://llvm.org/docs/DeveloperPolicy.html#making-and-submitting-a-patch

Sorry about that. I've updated the description to be more detailed.

Sorry, I meant the diff context. If you look at the code below, it says "Context not available". You have to use git diff -U999999 if you are uploading a patch manually (take a look at the link I provided in my previous message). If you use Arcanist (see https://llvm.org/docs/Phabricator.html#requesting-a-review-via-the-command-line), it should take care of this automatically.

This comment was removed by devajith-huawei.

Sorry, I meant the diff context. If you look at the code below, it says "Context not available". You have to use git diff -U999999 if you are uploading a patch manually (take a look at the link I provided in my previous message). If you use Arcanist (see https://llvm.org/docs/Phabricator.html#requesting-a-review-via-the-command-line), it should take care of this automatically.

Thank you. Updated the diff with context.

hanchung accepted this revision.Mar 6 2023, 10:09 AM
This revision is now accepted and ready to land.Mar 6 2023, 10:09 AM

I do not have commit access and it would be great if someone could commit this for me.