fix: Add lowering pass to remove output repacking in convert_method_to_trt_engine calls#1945
Merged
gs-olive merged 1 commit intopytorch:mainfrom May 31, 2023
Merged
Conversation
91a8d43 to
e8b6eb1
Compare
- Automatically remove output repacking for `convert_method_to_trt_engine` calls, to improve parity between models which can be converted directly to TRT engines, and models which can be fully compiled - Add new internal `CompileSpec` argument for lowering which indicates whether the lowering passes originate from a `convert_method_to_trt_engine` call or a regular `compile` call, which affects whether the lowering pass is applied - Regular TorchScript graphs cannot have this pass applied, as it can otherwise break the output graph. Newer versions of Torch disallow graph outputs with 0 or 2+ arguments which are not packed in a struct - Current lowering pass detects outputs which are flat Lists or Tuples of Tensors and returns the outputs as-is (direct from the TRT Engine), so the entire model can be converted to a single TRT engine
e8b6eb1 to
62371d9
Compare
narendasan
pushed a commit
that referenced
this pull request
Jun 2, 2023
…to_trt_engine` calls (#1945)
narendasan
pushed a commit
that referenced
this pull request
Jun 2, 2023
…to_trt_engine` calls (#1945)
narendasan
pushed a commit
that referenced
this pull request
Jun 3, 2023
…to_trt_engine` calls (#1945)
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.
Description
convert_method_to_trt_enginecalls, to improve parity between models which can be converted directly to TRT engines, and models which can be fully compiledCompileSpecargument for lowering which indicates whether the lowering passes originate from aconvert_method_to_trt_enginecall or a regularcompilecall, which affects whether the lowering pass is appliedFixes #1938
Fixes #1939
Type of change
Checklist: