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

Run LCE optimize pass before and after TFLite optimize pass #525

Merged
merged 1 commit into from
Oct 7, 2020

Conversation

lgeiger
Copy link
Member

@lgeiger lgeiger commented Oct 7, 2020

What do these changes do?

This PR changes the converter to also run the LCE optimize pass before the TFLite optimiyations happen. This allows for transforming bconv -> mul/add -> relu to bconv + mul/add -> relu which would've been prevented by TFLite optimizations that already fuse mul/add -> relu.

master PR
Screenshot 2020-10-07 at 15 46 26 Screenshot 2020-10-07 at 15 46 10

To make sure that all possible optimizations are applied, I kept the LCE optimize pass after all TFLite optimizations have been applied since they might enable further optimizations from our side (e.g. clipping might be converted to a relu op which could be fused by our transformations.

How Has This Been Tested?

Manually verified that fusion is correctly handled for quicknet and some literature models

@lgeiger lgeiger added the bug Something isn't working label Oct 7, 2020
@lgeiger lgeiger requested a review from a team October 7, 2020 14:52
@AdamHillier AdamHillier merged commit c8689f9 into master Oct 7, 2020
@AdamHillier AdamHillier deleted the fix-converter branch October 7, 2020 21:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants