Repository navigation
TF-TRT Prefer static shapes - #48060
Merged
copybara-service[bot] merged 1 commit intoMar 26, 2021
Merged
Conversation
bixia1
reviewed
Mar 24, 2021
tfeher
force-pushed
the
trt_prefer_static_shapes
branch
from
March 25, 2021 16:47
1870688 to
97c83ec
Compare
Contributor
Author
|
I have updated the lowercase name handling and fixed one error in trt_engine_op_test. |
bixia1
approved these changes
Mar 25, 2021
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR improves TF-TRT conversion when the "Optimal" profile generation strategy is used with only a single input shape.
In that case the TRT engine would have a single profile with min=opt=max. This means that the engine should only handle the concrete input dimension defined by the single profile. Therefore, we can define the TRT network with static shapes. This increases conversion rate, because some of our converters are not able to convert dynamic shape input.
This PR updates
TRTEngineOpconstructor to retrieve theprofile_strategygraph attribute, and pass it toTrtShapeOptimizationProfilesduring theInitProfilescall. Additionally anIsStaticCompatiblemethod is introduced toTrtShapeOptimizationProfiles, and is used inTRTEngineOp::BuildEngineto decide whether to build a dynamic or a static engine.Tracker #45481
Tagging @bixia1 for review and @DEKHTIARJonathan