facebookresearch/fairseq

Is there any plans to support torch.export?

Open

#5519 aperta il 5 lug 2024

Vedi su GitHub
 (0 commenti) (0 reazioni) (0 assegnatari)Python (6224 fork)batch import
enhancementhelp wantedneeds triage

Metriche repository

Star
 (29.107 star)
Metriche merge PR
 (Nessuna PR mergiata in 30 g)

Descrizione

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)

Guida contributor