TorchScript before TensorRT #1011
-
Is it needed to compile a model to TorchScript via tracing/scripting before optimizing with TensortRT? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
So there were new APIs added in Torch-TensorRT 1.0 that allow you to provide a standard Really its just syntax sugar to handle the most common use case but if you hit errors we still recommend manually tracing/scripting then passing it to Torch-TensorRT to determine where the source of the error is coming from. |
Beta Was this translation helpful? Give feedback.
So there were new APIs added in Torch-TensorRT 1.0 that allow you to provide a standard
nn.Module
. We will pass that through scripting for you then on to the compile function (there is no trace option for guaranteed correctness reasons) . The old API style now resides intorch_tensorrt.ts
. You can also pass a torchscript module as to the new api if you like.Really its just syntax sugar to handle the most common use case but if you hit errors we still recommend manually tracing/scripting then passing it to Torch-TensorRT to determine where the source of the error is coming from.