facebookresearch / fairseq

Facebook AI Research Sequence-to-Sequence Toolkit written in Python.
MIT License
30.57k stars 6.41k forks source link

Is there any plans to support torch.export? #5519

Open mhs4670go opened 4 months ago

mhs4670go commented 4 months ago

Hello.

Is there any plans to support torch.export? It would be awesome for developers who wants compilation of fairseq for backends or their deep learning accelerators.

The code would be like below.

from fairseq.models import FairseqEncoderDecoderModel
import torch

translator= FairseqEncoderDecoderModel.from_pretrained(
    # ..
)
example_inputs = translator.dummy_inputs

with torch.no_grad():
    ep = torch.export.export(translator_model, example_inputs)