fairseq
fairseq copied to clipboard
JIT scripting/tracing fails with `FairseqLanguageModel`
🐛 Bug
torch.jit.frontend.NotSupportedError
while JIT tracing/scripting FairseqLanguageModel
on CPU.
To Reproduce
Reopening #2741
Code sample
Please refer to #2741
Expected behavior
@myleott, this behavior is expected from PyTorch's point-of-view but fairseq
can probably be made compatible with JIT scripting/tracing. Is there any plan to do so, or would you accept such contributions? Thanks!
Environment
- fairseq Version (main):
- PyTorch Version (1.12)
- OS (Linux):
- How you installed fairseq (
source
): - Build command you used (if compiling from source):
Additional context
TorchScript allows more speedup than eager-mode.