Commit Graph

33 Commits

Author SHA1 Message Date
Myle Ott
5e343f5f23 Remove --distributed-wrapper (consolidate to --ddp-backend) (#1544)
Summary: Pull Request resolved: https://github.com/fairinternal/fairseq-py/pull/1544

Test Plan: Imported from OSS

Reviewed By: girifb

Differential Revision: D25836856

Pulled By: myleott

fbshipit-source-id: eb0a6a02f4d9fe2b6b12a456ef95208dd92c97cb
2021-01-28 14:21:08 -08:00
Myle Ott
f32de63e69 Fix IWSLT'14 link (fixes #2984) (#3113)
Summary: Pull Request resolved: https://github.com/pytorch/fairseq/pull/3113

Reviewed By: pritamdamania87

Differential Revision: D25836423

Pulled By: myleott

fbshipit-source-id: 0fe9cafcfd0f3edab2db1025d2fcc8dbb8af570a
2021-01-11 12:32:00 -08:00
Myle Ott
72a25a4e52 Rename optimization.min_lr -> optimization.stop_min_lr (#1486)
Summary: Pull Request resolved: https://github.com/fairinternal/fairseq-py/pull/1486

Test Plan: Imported from OSS

Reviewed By: alexeib

Differential Revision: D25342181

Pulled By: myleott

fbshipit-source-id: 7d1cfb26334fff26d688648724ab073e5fb956f5
2020-12-05 07:37:51 -08:00
Myle Ott
9831634946 Misc fixes (#2448)
Summary: Pull Request resolved: https://github.com/pytorch/fairseq/pull/2448

Reviewed By: ngoyal2707

Differential Revision: D23011193

Pulled By: myleott

fbshipit-source-id: 1a29481707108e4465aca78ec1581fb79f05efba
2020-08-14 10:24:51 -07:00
Myle Ott
f0a61a2774 Miscellaneous fixes (#1196)
Summary:
Incorporate several fixes, incl. from OSS contributors:
- fix model argument in sequence generator in semisupervised_translation.py
- fix aggregate logging in semisupervised_translation.py
- Fix EOS token in multilingual_denoising
- Handle missing eos_idx in data_utils.collate_tokens
- Better OOM handling for single-GPU training
- fix prepend_bos argument in translation_from_pretrained_bart.py …
- Fix eos_idx in multilingual_denoising
- Small logging fixes
- Fix fb_hub on PyTorch 1.6
- Better variable names
- Add support for model parallel to interactive.py
- Use `//` operator to fix Integer division warning
- Set default `--clip-norm=0.0`
- Cleanup some binaries in root directory

Pull Request resolved: https://github.com/fairinternal/fairseq-py/pull/1196

Reviewed By: ngoyal2707

Differential Revision: D22162202

Pulled By: myleott

fbshipit-source-id: 835b0c0ad9246827f9d915fdb4e89d7b5be2475d
2020-06-24 10:08:53 -07:00
Xing
e773446a85 examples/translation: Specifiy the correct bpe when loading WMT19 (#1951)
Summary:
# Description

In [examples/translation](https://github.com/pytorch/fairseq/tree/master/examples/translation), the code will not run if you change the model from `transformer.wmt16` to `transformer.wmt19`, since the BPE they are using are different. I corrected that with a note at the end of the section.
Pull Request resolved: https://github.com/pytorch/fairseq/pull/1951

Reviewed By: ngoyal2707

Differential Revision: D21663490

Pulled By: myleott

fbshipit-source-id: 13010dbec0ef5202355e0b3eb6d77b1958e80e97
2020-05-20 11:09:38 -07:00
Katsuya Iida
e5facc9984 Error preprocessing multi-lang translation: prepare-iwslt17-multilingual.sh #1777 (#1784)
Summary:
# Before submitting

- [X] Was this discussed/approved via a Github issue? (no need for typos, doc improvements)
- [X] Did you read the [contributor guideline](https://github.com/pytorch/fairseq/blob/master/CONTRIBUTING.md)?
- [X] Did you make sure to update the docs?
- [X] Did you write any new necessary tests?

## What does this PR do?
Fixes https://github.com/pytorch/fairseq/issues/1777.

## PR review
Anyone in the community is free to review the PR once the tests have passed.
If we didn't discuss your PR in Github issues there's a high chance it will not be merged.

## Did you have fun?
Make sure you had fun coding �
Pull Request resolved: https://github.com/pytorch/fairseq/pull/1784

Differential Revision: D20322705

Pulled By: myleott

fbshipit-source-id: 0787225db7f94da0565a2aa7628f2a1ee22f777f
2020-03-08 12:31:35 -07:00
Mathias Müller
1da061f37f Append validation data instead of overwrite (#1642)
Summary:
Very minor fix to avoid overwriting validation data.

# Before submitting

- [x] Was this discussed/approved via a Github issue? (no need for typos, doc improvements)
- [x] Did you read the [contributor guideline](https://github.com/pytorch/fairseq/blob/master/CONTRIBUTING.md)?
- [x] Did you make sure to update the docs?
- [x] Did you write any new necessary tests?

## What does this PR do?
Fixes https://github.com/pytorch/fairseq/issues/1641.

## PR review
Anyone in the community is free to review the PR once the tests have passed.
If we didn't discuss your PR in Github issues there's a high chance it will not be merged.

## Did you have fun?
Make sure you had fun coding �
Pull Request resolved: https://github.com/pytorch/fairseq/pull/1642

Differential Revision: D19555371

Pulled By: myleott

fbshipit-source-id: 2c2dd1d3c66605dd42113f2330ba98fe62c53a92
2020-01-24 10:37:22 -08:00
Jiatao Gu
60fbf64f30 Add --eval-bleu for translation
Summary: Pull Request resolved: https://github.com/fairinternal/fairseq-py/pull/989

Reviewed By: MultiPath

Differential Revision: D19411162

Pulled By: myleott

fbshipit-source-id: 74842f0174f58e39a13fb90f3cc1170c63bc89be
2020-01-17 12:17:46 -08:00
sai-prasanna
3b53962cd7 Refactor hub interface for batched inference (#1539) (#1539)
Summary:
# Before submitting

- [x] Was this discussed/approved via a Github issue? (no need for typos, doc improvements)
- [x] Did you read the [contributor guideline](https://github.com/pytorch/fairseq/blob/master/CONTRIBUTING.md)?
- [x] Did you make sure to update the docs?
- [] Did you write any new necessary tests?

## What does this PR do?
Fixes https://github.com/pytorch/fairseq/issues/1508.
Pull Request resolved: https://github.com/pytorch/fairseq/pull/1539

Pulled By: myleott

Differential Revision: D19216104

fbshipit-source-id: 14917c1459b8794eeb74c09a16b9899c366242d2
2019-12-25 19:20:39 -08:00
Myle Ott
15bd9bebbb Misc fixes
Summary: Pull Request resolved: https://github.com/fairinternal/fairseq-py/pull/939

Differential Revision: D18874807

Pulled By: myleott

fbshipit-source-id: 3c97b8315042fc499a0d47b778ba0aee2a318b34
2019-12-11 10:58:49 -08:00
Kevin
13d9e2baf8 Fix changes of file locations of subword-nmt (#1219)
Summary:
Solves https://github.com/pytorch/fairseq/issues/1218.
Pull Request resolved: https://github.com/pytorch/fairseq/pull/1219

Differential Revision: D18339541

Pulled By: myleott

fbshipit-source-id: 6d5bd7b60fa7fd30c038fdad54591343a01f228b
2019-11-07 09:08:29 -08:00
Myle Ott
a0f75996b1 Fix building of docs
Summary: Pull Request resolved: https://github.com/pytorch/fairseq/pull/1340

Differential Revision: D18289455

Pulled By: myleott

fbshipit-source-id: a1c8163a35273b6c646d300142701e8a317d7378
2019-11-02 16:52:50 -07:00
Guntupalli Venkata Sai Kalyan
13519720f3 fix typo in README of examples/translation
Summary: Pull Request resolved: https://github.com/pytorch/fairseq/pull/1200

Differential Revision: D17659658

Pulled By: myleott

fbshipit-source-id: 1863e6d60a439dbb7e71e5da68817c9d53649737
2019-09-29 14:53:05 -07:00
Myle Ott
ac66df47b5 Update README
Summary: Pull Request resolved: https://github.com/fairinternal/fairseq-py/pull/826

Differential Revision: D16830402

Pulled By: myleott

fbshipit-source-id: 25afaa6d9de7b51cc884e3f417c8e6b349f5a7bc
2019-08-15 09:47:16 -07:00
Myle Ott
abb7ed4c91 Update READMEs for torch.hub
Summary: Pull Request resolved: https://github.com/fairinternal/fairseq-py/pull/795

Differential Revision: D16620488

Pulled By: myleott

fbshipit-source-id: 1998a9ccd8816fc7f590861fb4898f910a36bc1e
2019-08-02 06:24:17 -07:00
Myle Ott
3d764a3dc6 Update torch.hub usage
Summary: Pull Request resolved: https://github.com/fairinternal/fairseq-py/pull/770

Differential Revision: D16491911

Pulled By: myleott

fbshipit-source-id: 8dd2b76f8fa24183640ae9d1129ea47ded77d43d
2019-07-25 06:33:51 -07:00
Myle Ott
8af5554269 Improve interactive generation (support --tokenizer and --bpe)
Summary: Pull Request resolved: https://github.com/fairinternal/fairseq-py/pull/734

Differential Revision: D16377044

Pulled By: myleott

fbshipit-source-id: 37d5553d76aa7c653113fec089f59710281c31d7
2019-07-19 06:45:18 -07:00
Peng-Jen Chen
9c3bb5c6d6 Better explain the inference argument format of multilingual translation
Summary:
In https://github.com/pytorch/fairseq/issues/656, people are often confused about how to set multilingual translation parameters at inference time.

This diff add more checks to ensure the arguments (`--lang-pairs`, `--encoder-langtok`, `--decoder-langtok`) load from checkpoint are consistent with arguments specified in generate/interactive command line.
We also add a section in example page to explain how to set the arguments

Reviewed By: myleott

Differential Revision: D15682169

fbshipit-source-id: 64e6db94cd72ea7ce2d0aa1067c9c2dcd3b8a2ac
2019-06-19 19:45:13 -07:00
Myle Ott
6d1233fa2f Switch to gzip for large WMT'18 ensemble (#803)
Summary:
It's so much faster to extract (3 minutes instead of 20).
Pull Request resolved: https://github.com/pytorch/fairseq/pull/803

Differential Revision: D15795810

Pulled By: myleott

fbshipit-source-id: 3b2ae8bd7924a77ac8e795f5e1a7da0c4ae27374
2019-06-12 19:20:41 -07:00
Myle Ott
5bdee18e96 Iterate on torch.hub interface
Summary: Pull Request resolved: https://github.com/pytorch/fairseq/pull/793

Differential Revision: D15758755

Pulled By: myleott

fbshipit-source-id: b93e4ac11bde36a0b59b4d6d1c84d31c3124d767
2019-06-11 15:04:43 -07:00
Wen-Ding Li
a24880bd10 Minor fix for multilingual example shell command (#561)
Summary:
Add `\` to fix for the shell command.
Pull Request resolved: https://github.com/pytorch/fairseq/pull/561

Differential Revision: D14460091

Pulled By: myleott

fbshipit-source-id: 3658ca41e69bcd00d4ad8ec2d79ddcc6a8de586e
2019-03-14 09:53:59 -07:00
Myle Ott
00493490ba Multilingual training example (#527)
Summary:
* Add example for multilingual translation on IWSLT'17
* Match dataset ordering for multilingual_translation and translation
* Fix bug with LegacyDistributedDataParallel when calling forward of sub-modules
Pull Request resolved: https://github.com/pytorch/fairseq/pull/527

Differential Revision: D14218372

Pulled By: myleott

fbshipit-source-id: 2e3fe24aa39476bcc5c9af68ef9a40192db34a3b
2019-02-25 18:46:10 -08:00
Myle Ott
4294c4f6d7 Add code for mixture of experts (#521)
Summary:
Code for the paper: [Mixture Models for Diverse Machine Translation: Tricks of the Trade (Shen et al., 2019)](https://arxiv.org/abs/1902.07816).
Pull Request resolved: https://github.com/pytorch/fairseq/pull/521

Differential Revision: D14188021

Pulled By: myleott

fbshipit-source-id: ed5b1ed5ad9a582359bd5215fa2ea26dc76c673e
2019-02-22 13:14:09 -08:00
Myle Ott
fbd4cef9a5 Add fairseq to PyPI (#495)
Summary:
- fairseq can now be installed via pip: `pip install fairseq`
- command-line tools are globally accessible: `fairseq-preprocess`, `fairseq-train`, `fairseq-generate`, etc.
Pull Request resolved: https://github.com/pytorch/fairseq/pull/495

Differential Revision: D14017761

Pulled By: myleott

fbshipit-source-id: 10c9f6634a3056074eac2f33324b4f1f404d4235
2019-02-08 22:03:29 -08:00
Myle Ott
b41c74dc5b Add code for "Pay Less Attention with Lightweight and Dynamic Convolutions" (#473)
Summary:
Changelog:
- `e330f56`: Add code for the "Pay Less Attention with Lightweight and Dynamic Convolutions" paper
- `5e3b98c`: Add scripts for computing tokenized BLEU with compound splitting and sacrebleu
- update READMEs
- misc fixes
Pull Request resolved: https://github.com/pytorch/fairseq/pull/473

Differential Revision: D13819717

Pulled By: myleott

fbshipit-source-id: f2dc12ea89a436b950cafec3593ed1b04af808e9
2019-01-25 15:40:26 -08:00
Myle Ott
b87c536651 Merge internal changes (#295)
Summary:
Changelog:
- `90f52a1`: Support loading subsets of the data on each worker with the `--fix-batches-to-gpus` flag. This should fix #217 and #266.
- `6eda0a9`: Update README for replicating the "Scaling Neural Machine Translation" paper
- `b14c7cf`: Fallback to no_c10d backend for pytorch 0.4.1 (fixes #294)
Pull Request resolved: https://github.com/pytorch/fairseq/pull/295

Differential Revision: D10121559

Pulled By: myleott

fbshipit-source-id: 41c84d0ee4cdd113544b5d3aa38ae8b23acc2c27
2018-09-30 14:06:24 -07:00
Sergey Edunov
c279407010 Update IWSLT configuration for transformer 2018-07-25 07:26:39 -07:00
Myle Ott
a75c30923b
Fix preprocessing for WMT14 En-De to replicate Scaling NMT paper (#203) 2018-06-28 14:19:31 -04:00
Myle Ott
b458977a61 Add steps to reproduce WMT En-De results from Scaling NMT paper 2018-06-21 14:58:50 -04:00
Myle Ott
70d61db4b7
Fix translation README (fixes #186) (#189) 2018-06-21 08:04:21 -04:00
Myle Ott
ff68a9ef50 Add FairseqTask
A Task defines the data format, stores shared state (e.g., dictionaries) and provides helpers for building the model/criterion and calculating the loss.

Changes:
- Add TranslationTask and LanguageModelingTask. New tasks can be registered with @register_task decorator.
- Add EpochBatchIterator to encapsulate batching and saving/restoring dataloader position
- Remove LEFT_PAD_* constants and make them configurable per task
2018-06-15 13:05:22 -06:00
Alexei Baevski
c778a31e2b create examples dir and add conv lm + stories readme 2018-06-15 13:05:20 -06:00