-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fuse constant padding into conv kernels #7515
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @mbrookhart!
Support for other operators that handle would be a nice follow on, but this handles the majority of problematic cases of padding happening explicitly from ONNX's use of auto_pad. On deeplabv3-mobilenetv2 this reduces the number of explicit nn.pad
calls from 54
-> 11
. Those remaining are part of a space to depth transformation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wonderful! Thanks @mbrookhart
Note that given the layout inference of the implementation, users should consider running SimplifyExpr prior to layout transformations via ConvertLayout or otherwise. Else it may be the case that a |
89b7dee
to
2f59169
Compare
Thanks @mbrookhart @csullivan |
* fuse constant padding into conv kernels * change the kernel to support other layouts * add channel-last test * add a comment about bailing early
* fuse constant padding into conv kernels * change the kernel to support other layouts * add channel-last test * add a comment about bailing early
cc @masahi @csullivan
Currently supports conv1d/2d/3d. I can probably do the same thing for conv transpose and pooling, but this is getting a little long, what do you guys think?