Skip to content
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

[Model Optimizer] Add conv even -> larger odd kernel #78

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

reesegrimsley
Copy link
Contributor

Adding to model optimizer/conv.py to allow even-sized convolutions to be implemented with larger odd-size. For example, Conv4x4 is replaced with conv5x5. Only square spatial kernels are supported. Padding is added along the top and left sides of the kernel and input.

Regarding padding, TIDL does not support asymmetric padding on the inputs to Conv layers. Replacing even with next size up odd kernel does require asym padding, so padding is all moved to a preceding, standalone layer, and Conv implements zero-pad 'same' configuration

There is a performance penalty, but this is less drastic than offloading conv operations to CPU as even-sized kernels are not implemented.

I have checked on a model with 4x4 conv that the conv5x5 gives identical output results

@reesegrimsley reesegrimsley force-pushed the master branch 3 times, most recently from ed2703a to 9f40059 Compare August 15, 2024 17:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant