Replies: 3 comments
-
Lets dig deeper into the internals. For example we now expose the potential for conflicting settings in
How does this UX compare to going into the model code and doing an inplace replacement vs trying to get Torch-TensorRT to accept the full model? One concern I have is part of the process for Torch-TensorRT is to go through lowering which will change the model, for partial compilation this changes both TensorRT and Torch blocks. At the very least it would seem we would need to go in and pull out the subgraphs corresponding to selected modules to maximize compatibility. |
Beta Was this translation helpful? Give feedback.
-
cc: @bowang007 @peri044 |
Beta Was this translation helpful? Give feedback.
-
@narendasan Yes, things may get messed up if we can specify torch_executed_x or tensorrt_executed_x at the same time. Interface exclusiveness issueTo avoid that situation, maybe it is more clear to make them mutually exclusive, with the
How to maximize compatibility when doing loweringWhen doing lowering, whether Here is how to do lowering pass when } else if ((!mark.top() && default_torch_execution) or (mark.top() && !default_torch_execution)) {
LOG_GRAPH("Marking " << util::node_info(n) << " to run in PyTorch");
n->i_(c10::Symbol::attr("to_compile"), (int64_t) false);
} You can check details in PR #1122 |
Beta Was this translation helpful? Give feedback.
-
According to the current design, every module is by default compiled to TensorRT execpt those modules included in
torch_executed_modules
.However, in some cases, for example, a multi-modal model where ResNet and BERT are present, BERT is optimized by custom op implementation (FasterTransformer). Developers may only want to compile ResNet, and leave everything in BERT (embedding, custom op, FC) run in torch. Although it is fine to explicitly assign values for
torch_executed_modules
, it will be much more convenient to have an interface liketrt_executed_modules
, and a switch-mode interface likedefault_torch_execution
.When the switch is turned on, every module would by default run in Torch, and only modules explicitly included in
trt_executed_modules
would be compiled.Beta Was this translation helpful? Give feedback.
All reactions