ONNX support for encoder/decoder separately
### Feature request

Hello, thanks for your work!

I am trying to leverage NVIDIA's TRITON inference server to speed up generation for Blenderbot model for production.

If I export the model in ONNX format, it exports the entire model whereas generative models go through a separate encoder->decoder cycles(if I understand correctly).

Would you be able to point me towards a direction on how I would be able to manage this?

I've tried:
1. writing an ONNX config and generating the model.onnx files separately for each encoder & decoder. Got stuck at converting encoder outputs to decoder inputs and such, mainly due to mismatch in ONNX model outputs and generative model outputs(such as hidden layers)
2. using the whole model exported as onnx and loading it into TRITON inference server. Also stuck at generation parameters & handling input/outputs, reason same as above.

### Motivation

To use generative model for blenderbot 3 on TRITON inference server

### Your contribution

Would love to make it work and share the results, either through PR for separate encoder/decoder onnx configs or sharing the results.
Might be of interest to @lewtun <|||||>This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.

Please note that issues that do not follow the [contributing guidelines](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md) are likely to be ignored.<|||||>Hi @yanksyoon we have a new ONNX exporter in `optimum` [docs](https://huggingface.co/docs/optimum/exporters/onnx/usage_guides/export_a_model) that splits the encoder and decoder separately for fast inference with T5 models. I recommend opening your feature request there

cc @fxmarty <|||||>Hi @yanksyoon , indeed Triton Inference Server should be quite good! For reference, the latest release should help to export separately encoder/decoder, see the section "Extended ONNX export for encoder-decoder and decoder models": https://github.com/huggingface/optimum/releases/tag/v1.6.0

We are very open to contributions to make the use of Triton Inference Server for decoder models smoother in Optimum. Feel free to open an issue there so that we can track and help!<|||||>@fxmarty @lewtun  Thanks for the guidance! Will have a look this weekend :)<|||||>This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.

Please note that issues that do not follow the [contributing guidelines](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md) are likely to be ignored.