torch-mlir icon indicating copy to clipboard operation
torch-mlir copied to clipboard

[RFC] Adding a new conv3d op to linalg

Open gpetters94 opened this issue 3 years ago • 2 comments

at::convolution and at::convolution_backward require that the operands be in NCDHW order but the only 3D conv op we have in linalg is linalg.conv_3d_ndhwc_dhwcf. Since we have several varieties of 2D conv ops, I propose we add a linalg.conv_3d_ncdhw_fcdhw op so that lowering convolution doesn't require transposing the operands in the 3D case.

gpetters94 avatar Mar 21 '22 17:03 gpetters94

Is the 3d case needed in real model? We could delay implementing it until there is a real use case.

cathyzhyi avatar Mar 21 '22 18:03 cathyzhyi

The op is defined in Sandbox env. We're able to add it to upstream ops definition with the same definition.

https://github.com/google/iree-llvm-sandbox/blob/c8766bf482d6a421780bc1782c0c6f9b39de765f/python/examples/conv/ops.py#L1085-L1099

hanhanW avatar Apr 25 '22 09:04 hanhanW