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

[TF-TRT] Avoid padding calculations when not needed #28878

Conversation

trevor-m
Copy link
Contributor

PR #27988 added the following:

  • In TRT >= 5.1.3, use setPaddingMode so TRT will automatically calculate padding.
  • In TRT >= 5.1.0, use setPostPadding/setPostPadding to perform asymmetric padding without an additional IPaddingLayer (there was a bug using this for convolutions which was fixed in 5.1.3).

For TRT < 5.1.3, we have to compute padding values manually based on the input dimensions. This PR makes it so these calculations are no longer performed for TRT >= 5.1.3 where they are not used.
This PR also simplifies some of the logic determining how to do the padding based on TRT version and adds comments explaining why.

@tensorflow-bot tensorflow-bot bot added the size:S CL Change Size: Small label May 20, 2019
@rthadur rthadur self-assigned this May 20, 2019
@rthadur rthadur added this to Assigned Reviewer in PR Queue via automation May 20, 2019
@rthadur rthadur requested a review from aaroey May 20, 2019 22:06
PR Queue automation moved this from Assigned Reviewer to Approved by Reviewer May 22, 2019
@tensorflow-bot tensorflow-bot bot added kokoro:force-run Tests on submitted change ready to pull PR ready for merge process labels May 22, 2019
@kokoro-team kokoro-team removed the kokoro:force-run Tests on submitted change label May 22, 2019
@tensorflow-copybara tensorflow-copybara merged commit 14438d5 into tensorflow:master May 22, 2019
PR Queue automation moved this from Approved by Reviewer to Merged May 22, 2019
tensorflow-copybara pushed a commit that referenced this pull request May 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes ready to pull PR ready for merge process size:S CL Change Size: Small
Projects
PR Queue
  
Merged
Development

Successfully merging this pull request may close these issues.

None yet

6 participants