[fsmt] Exporting the operator triu to ONNX opset version 12 is not supported
Author: stas00
Pull request: no
Labels: name: fsmt

As a follow up to https://github.com/huggingface/transformers/issues/9722

```
import torch
import transformers
from transformers import convert_graph_to_onnx
from pathlib import Path

convert_graph_to_onnx.convert(
    framework="pt",
    model="facebook/wmt19-en-de",
    output=Path("encoder/en_de_trans.onnx"),
    opset=12,
    tokenizer="facebook/wmt19-en-de",
    use_external_format= False,
    pipeline_name= "translation_en_to_de",
)
```
after applying the fix from https://github.com/huggingface/transformers/pull/9736
it then crashes with:

```
Traceback (most recent call last):
  File "/mnt/nvme1/code/huggingface/transformers-master/porting/onnx2.py", line 26, in <module>
    convert_graph_to_onnx.convert(
  File "/hf/transformers-master/src/transformers/convert_graph_to_onnx.py", line 367, in convert
    convert_pytorch(nlp, opset, output, use_external_format)
  File "/hf/transformers-master/src/transformers/convert_graph_to_onnx.py", line 279, in convert_pytorch
    export(
  File "/home/stas/anaconda3/envs/main-38/lib/python3.8/site-packages/torch/onnx/__init__.py", line 271, in export
    return utils.export(model, args, f, export_params, verbose, training,
  File "/home/stas/anaconda3/envs/main-38/lib/python3.8/site-packages/torch/onnx/utils.py", line 86, in export
    _export(model, args, f, export_params, verbose, training, input_names, output_names,
  File "/home/stas/anaconda3/envs/main-38/lib/python3.8/site-packages/torch/onnx/utils.py", line 671, in _export
    _model_to_graph(model, args, verbose, input_names,
  File "/home/stas/anaconda3/envs/main-38/lib/python3.8/site-packages/torch/onnx/utils.py", line 450, in _model_to_graph
    graph = _optimize_graph(graph, operator_export_type,
  File "/home/stas/anaconda3/envs/main-38/lib/python3.8/site-packages/torch/onnx/utils.py", line 204, in _optimize_graph
    graph = torch._C._jit_pass_onnx(graph, operator_export_type)
  File "/home/stas/anaconda3/envs/main-38/lib/python3.8/site-packages/torch/onnx/__init__.py", line 309, in _run_symbolic_function
    return utils._run_symbolic_function(*args, **kwargs)
  File "/home/stas/anaconda3/envs/main-38/lib/python3.8/site-packages/torch/onnx/utils.py", line 970, in _run_symbolic_function
    symbolic_fn = _find_symbolic_in_registry(domain, op_name, opset_version, operator_export_type)
  File "/home/stas/anaconda3/envs/main-38/lib/python3.8/site-packages/torch/onnx/utils.py", line 927, in _find_symbolic_in_registry
    return sym_registry.get_registered_op(op_name, domain, opset_version)
  File "/home/stas/anaconda3/envs/main-38/lib/python3.8/site-packages/torch/onnx/symbolic_registry.py", line 112, in get_registered_op
    raise RuntimeError(msg)
RuntimeError: Exporting the operator triu to ONNX opset version 12 is not supported. Please open a bug to request ONNX export support for the missing operator.

Process finished with exit code 1
```

Need to look at workarounds proposed at https://github.com/pytorch/pytorch/issues/32968

Comments:
Applied a workaround in https://github.com/huggingface/transformers/pull/9738