Skip to content

Comments

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

Open
reesegrimsley wants to merge 4 commits intoTexasInstruments:masterfrom
reesegrimsley:master
Open

[Model Optimizer] Add conv even -> larger odd kernel#78
reesegrimsley wants to merge 4 commits intoTexasInstruments:masterfrom
reesegrimsley:master

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