TensorRT for combined encoder/decoder model

what is the best way to convert a combined encoder decoder transformer model to tensorrt. The model is used by calling model.encode() and model.decode(), which is different then the typical forward pass that is supported. Also, once the model is passed through torch_tensorrt.compile, what is the expected type of the output converted model? What do we do if the actual converted model runs slower than the original unconverted model? Is there a docker container image that exists for jetson that has tensorrt, jetpack 6.2, and tensorrt-llm?

  • Are there strategies to reduce memory usage during conversion like incremental optimizations?
  • Whether dynamic shapes affect optimization performance?
  • Best practices for custom operations like a specialized patch embedding layer or rotary positional encoding.

@tony161, apologies for the delayed response.
Can you please share more details? Does the client want both encoder and decoder output? Does the client want the encoder output to be piped to the decoder as part of the input, and only wants the decoder output? If so, how is it different from “the typical forward pass”?

Please ensure you follow best practices outlined in our documentation, and if the issue persists, you can file an issue or report a bug.

Yes, please set up a working system first, and then you can review it.
Thank you.