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

Add FlattenAtrousConv transformation #10996

Merged
merged 1 commit into from
Apr 19, 2022

Conversation

Icemist
Copy link
Contributor

@Icemist Icemist commented Apr 13, 2022

This transformation flattens atrous convolution, i.e. finds a sequence of space_to_batch_nd->conv2d->batch_to_space_nd operations and convert them into subgraphs with a convolution with the modified "dilation" and recalculated "padding" parameters

  x     w      x     w
  |     |      |     |
  s2b   |       \   /
   \   /         \ /
   conv2d   ->  conv2d
     |            |
     b2s          |

@Icemist Icemist force-pushed the avoronov/flatten_atrous_conv branch 2 times, most recently from 3e5978b to 7becb90 Compare April 13, 2022 22:57
@Icemist Icemist force-pushed the avoronov/flatten_atrous_conv branch from 7becb90 to 8b583d8 Compare April 14, 2022 04:46
@elvin-n
Copy link
Contributor

elvin-n commented Apr 14, 2022

I propose to add invocation of this pass into standard optimize function OptimizeImpl here. This will allow to avoid situation when users are not familiar with this pass and will not know when and how to call it

@Icemist
Copy link
Contributor Author

Icemist commented Apr 15, 2022

@masahi @jwfromm

@masahi
Copy link
Member

masahi commented Apr 15, 2022

Interesting, I think we can safely enable this pass in the default pipeline as @elvin-n suggested, @Icemist do you want to do that?

You can put the new pass in

Array<Pass> GetPassPrefix(bool is_homegeneous, bool is_vm) {

@masahi masahi merged commit 312b552 into apache:main Apr 19, 2022
@elvin-n
Copy link
Contributor

elvin-n commented Apr 19, 2022

It's pity not to include this pass into standard optimization flows. @Icemist please create another PR with adding it to regular optimization passes.

@Icemist
Copy link
Contributor Author

Icemist commented Apr 20, 2022

Interesting, I think we can safely enable this pass in the default pipeline as @elvin-n suggested, @Icemist do you want to do that?

You can put the new pass in

Array<Pass> GetPassPrefix(bool is_homegeneous, bool is_vm) {

Yes, I posted it as a separate commit #11077. I apologize for the long response.

@TejashShah
Copy link

@Icemist Excellent piece of contribution, regardless of target! Appreciate your efforts in mainlining it

cc @elvin-n

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.

4 participants