Commit Graph

2061 Commits

Author SHA1 Message Date
dianaml0
0dfd6b6240 Add linting with black (#2678)
Summary:
# Before submitting

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

## What does this PR do?
Fixes # (issue).

## 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/fairinternal/fairseq-py/pull/2678

Reviewed By: Mortimerp9

Differential Revision: D32653381

Pulled By: dianaml0

fbshipit-source-id: 2810d14867cd7d64f4d340740e2b590b82de47fe
2021-11-29 12:32:59 -08:00
Diana Liskovich
3dc1691df1 Add circleci config similar to one in gshard (#2677)
Summary:
# Before submitting

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

## What does this PR do?
Adds circleCI config to `main` similar to the one added in https://github.com/fairinternal/fairseq-py/issues/2455 by vedanuj
Splitting out changes in https://github.com/fairinternal/fairseq-py/issues/2570 to be cleaner.

## 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/fairinternal/fairseq-py/pull/2677

Reviewed By: Mortimerp9

Differential Revision: D32653411

Pulled By: dianaml0

fbshipit-source-id: 24950ecebfb569b552675e65bee1451b8070f8ee
2021-11-28 17:45:03 -08:00
dianaml0
2380a6e466 Add pre commit config and flake8 config (#2676)
Summary:
# Before submitting
Separating https://github.com/fairinternal/fairseq-py/issues/2212 into separate PR's to be cleaner.

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

## What does this PR do?
Fixes # (issue).

## 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/fairinternal/fairseq-py/pull/2676

Reviewed By: alexeib

Differential Revision: D32653505

Pulled By: dianaml0

fbshipit-source-id: fd338289d23b340ef56b0188f9c73b37c367d6ca
2021-11-24 18:03:37 -08:00
dianaml0
91f029380b Update python versions used for testing in main (#2679)
Summary:
New version of fairscale breaks with python3.6. Moving to higher versions of python.

# Before submitting

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

## What does this PR do?
Fixes # (issue).

## 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/fairinternal/fairseq-py/pull/2679

Reviewed By: alexeib

Differential Revision: D32653241

Pulled By: dianaml0

fbshipit-source-id: bb81023b967f7d585fe9fb808f65cfd60cf51490
2021-11-24 13:19:03 -08:00
Sam Shleifer
fb64e43c67 skip remainder batch (#2464)
Summary: Pull Request resolved: https://github.com/fairinternal/fairseq-py/pull/2464

Reviewed By: myleott

Differential Revision: D31742871

Pulled By: sshleifer

fbshipit-source-id: e5d29ca9d594abd92212eb24b60c991f2840a4e8
2021-11-24 07:50:50 -08:00
Arun Babu
7f5ec30b25 Update finetune.yaml (#2664)
Summary:
Fix a typo

# Before submitting

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

## What does this PR do?
Fixes # (issue).

## 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/fairinternal/fairseq-py/pull/2664

Reviewed By: alexeib

Differential Revision: D32577174

Pulled By: arbabu123

fbshipit-source-id: 9b65619843fd9684be319024ccc9e6b0681db7de
2021-11-19 19:49:59 -08:00
Yun Wang
bf61974ee8 Merge --use-ontology-for-* into --use-ontology
Summary:
There are three options for the ontology:
* `--use-ontology-for-training`
* `--use-ontology-for-validation`
* `--use-ontology-for-balancing`

The first two must always be set together.

In the past, I observed that it's best not to use ontology for data balancing even if we use ontology for training and validation. But now I no longer observe this.

Therefore, I'm merging all these three options into one (`--use-ontology`).

In addition, I'm also moving the logic of avoiding loading teacher models out of `checkpoint_utils.py`. If you want to load a student model without loading its teachers (e.g. for prediction only), specify `arg_overrides={"ignore_teachers": True}` when calling `load_model_ensemble`.

Reviewed By: xiaoxiao26

Differential Revision: D32518830

fbshipit-source-id: 103c6458f7927ec5ca7470109c8f956c00f514a2
2021-11-18 16:38:31 -08:00
Arun Babu
7105d7f4b1 attempt5 (#2658)
Summary:
# Before submitting

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

## What does this PR do?
Fixes # (issue).

## 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/fairinternal/fairseq-py/pull/2658

Reviewed By: ngoyal2707

Differential Revision: D32520446

Pulled By: arbabu123

fbshipit-source-id: a4cbc12624c9c8c1b5bc3d64eb47c2fdec01eb87
2021-11-17 20:56:37 -08:00
Arun Babu
30c912b73c Xlsr readme (#2652)
Summary:
# Before submitting

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

## What does this PR do?
Fixes # (issue).

## 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/fairinternal/fairseq-py/pull/2652

Reviewed By: michaelauli

Differential Revision: D32499609

Pulled By: arbabu123

fbshipit-source-id: 1d91f0c5dda8f4e0d0a8d3c8f4854188e91500c3
2021-11-17 11:37:27 -08:00
arbabu123
7fd6435520 Add activation checkpoint for wav2vec (#2545)
Summary:
# Before submitting

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

## What does this PR do?
Fixes # (issue).

## 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/fairinternal/fairseq-py/pull/2545

Reviewed By: alexeib

Differential Revision: D32150553

Pulled By: arbabu123

fbshipit-source-id: 1acff92dd69db128bc97ee36ca55b44dd59e08f5
2021-11-16 16:30:45 -08:00
Apoorv Vyas
89ec6e7eff Add "grouped_shuffling" for batch shuffling in groups of total workers (#2391)
Summary:
- Allows for faster training on multiple GPUs when batches are based on
sorted input sequences.

- Instead of shuffling batches randomly followed by distribution on
workers, we group the batches in sets of total workers and then shuffle
the groups. When the batches are sorted by length this ensures that each
worker receives similar length inputs.

# Before submitting

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

## What does this PR do?
Adds option "grouped_shuffling" to the dataclass to allow batches to be first grouped in set of total workers followed by shuffling of the groups. This reduces the sequence length discrepancy among the workers when the batches were created from inputs sorted by sequence lengths.

## 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/fairinternal/fairseq-py/pull/2391

Reviewed By: arbabu123

Differential Revision: D31352971

Pulled By: alexeib

fbshipit-source-id: c045bedecb03339c8eb46e7e8c9804a53b35615b
2021-11-16 13:53:00 -08:00
Apoorv Vyas
4ccb288ff5 Fix logits padding mask for wav2vec asr model (#2469)
Summary:
The logits were not correctly masked leading to significant WER
degradation for batched inference with padded inputs. This resolves it.
However there is minor degradation still from somewhere else.

# Before submitting

- [ ] 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/main/CONTRIBUTING.md)?
- [x] Did you make sure to update the docs?
- [ ] Did you write any new necessary tests?

## What does this PR do?
Fixes logits padding mask for wav2vec asr model.

## 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/fairinternal/fairseq-py/pull/2469

Reviewed By: arbabu123

Differential Revision: D32469676

Pulled By: alexeib

fbshipit-source-id: 154bb6523f9300e4b6c1cf2631424fd22f582bc5
2021-11-16 13:15:26 -08:00
Wei-Ning Hsu
eb2bed1154 update wav2vec readme for updated rw2v model (#2636)
Summary:
## What does this PR do?
- Update robust wav2vec2 fine-tuned checkpoints to include dictionary and w2v_args.
- Update README to point to the updated checkpoints

## 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/fairinternal/fairseq-py/pull/2636

Reviewed By: alexeib

Differential Revision: D32414361

Pulled By: wnhsu

fbshipit-source-id: e4bf41e78593cde8dc08a1bfacdd3ec5005e54bc
2021-11-13 12:11:48 -08:00
alexeib
68ce4c7f85 fix crash when num procs > 1 (#2623)
Summary:
this fixes a crash when using num_workers > 0 and num processes > 1 (e.g. by launching on slurm with tasks-per-node > 1 or using torch.distributed/torchrun with num gpus > 1). the root cause is some kind of bug in torch.split() that holds on to memory. when data loaders recycle, the program crashes when trying to release already released memory

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

Reviewed By: arbabu123

Differential Revision: D32342431

Pulled By: alexeib

fbshipit-source-id: 278c7e0b09cfd770f375865d472bc52fb5835bd2
2021-11-11 19:40:47 -08:00
Chau Tran
47c58f0858 wmt21 scripts and models (#2613)
Summary:
Pull Request resolved: https://github.com/fairinternal/fairseq-py/pull/2613

Pull Request resolved: https://github.com/pytorch/fairseq/pull/4009

add wmt21 models and scripts

Reviewed By: huihuifan

Differential Revision: D32311009

fbshipit-source-id: b269ce732ba9b02634947134d4f0cd774b565b2c
2021-11-10 04:14:52 -08:00
Vinayak Tantia
3a5838c320 Update implemention of SlowMo to its implementation in Fairscale (#3996)
Summary:
- [ ] 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/main/CONTRIBUTING.md)?
- [x] Did you make sure to update the docs?
- [x] Did you write any new necessary tests?

## What does this PR do?
SlowMo is being moved to [Fairscale](https://fairscale.readthedocs.io/en/latest/). This commit updates the implementation of SlowMo to the Fairscale version. It also adds tests for SlowMo.
Note: This PR is currently for review. It will be merged at a later date once SlowMo has been updated to Fairscale. SlowMo is being merged to Fairscale as part of [a PR](https://github.com/facebookresearch/fairscale/pull/378). So, once that PR is merged to Fairscale, this PR on Fairseq will be ready for merge

## 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/3996

Reviewed By: dianaml0

Differential Revision: D32280163

Pulled By: vtantia

fbshipit-source-id: 70c97b04a7cdc90ada7099375c2a31b0c978ba70
2021-11-09 09:44:45 -08:00
Changhan Wang
0b21875e45 add postnet to fastspeech2
Summary: add postnet to fastspeech2

Reviewed By: wnhsu

Differential Revision: D32162463

fbshipit-source-id: 0c07312985602b4332f73c89d1a536fac53b6a29
2021-11-04 12:32:04 -07:00
Changhan Wang
30dc8b7331 enable BPE-dropout / unigram sampling
Summary: enable BPE-dropout / unigram sampling

Reviewed By: yuntang

Differential Revision: D32162340

fbshipit-source-id: 3829e84fb572adeb7b0302ccfa15cbe88a782e3f
2021-11-04 09:26:56 -07:00
Changhan Wang
199733f4de improve audio_utils.read_from_stored_zip with mmap IO
Summary:
Improve audio_utils.read_from_stored_zip with mmap IO.

Benchmarking:
50k random read
- mmap 1.49 ms/item
- regular: 1.63 ms/item

Reviewed By: yuntang

Differential Revision: D32162298

fbshipit-source-id: 502f1dfafe32f425086e999e0b6d542eb3e9d8f0
2021-11-04 09:24:49 -07:00
Torge Berckmann
e69a7c1d8a Joint s2t fixes (#3940)
Summary:
# Before submitting

- [-] 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/main/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/3939
Fixes https://github.com/pytorch/fairseq/issues/3941

## PR review
Awaiting review.

## Did you have fun?
Of course!

Pull Request resolved: https://github.com/pytorch/fairseq/pull/3940

Reviewed By: yuntang

Differential Revision: D32102157

Pulled By: kahne

fbshipit-source-id: ec68dc3c7738473406b6a5ddabdb035e13a261b4
2021-11-03 19:51:28 -07:00
Sam Shleifer
7fb3792845 Fix einsum transpose (#2532)
Summary: Pull Request resolved: https://github.com/fairinternal/fairseq-py/pull/2532

Reviewed By: myleott

Differential Revision: D32049520

Pulled By: sshleifer

fbshipit-source-id: 9036c6db48c15e8a04a27a7d3660bdb2a248f0a5
2021-11-03 09:02:08 -07:00
Yossi Adi
c6360917ff Add a README for Textless NLP speech resynthesis (#3992)
Summary:
Pull Request resolved: https://github.com/pytorch/fairseq/pull/3992

## What does this PR do?
Add a readme pointing to the separate repo for the Textless NLP milestone https://github.com/fairinternal/fairseq-py/issues/2: speech resynthesis

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

Reviewed By: adiyoss, Abdel-rahmanMohamed

Differential Revision: D32068424

Pulled By: wnhsu

fbshipit-source-id: 9958c4d5aaf29a235e0af33d26b814120b4f688d
2021-11-03 08:59:34 -07:00
Elizabeth Salesky
d792b793a7 update mtedx bibtex to conf proceedings (#3984)
Summary:
## What does this PR do?
Updates the bibtex to cite the mtedx dataset in the speech-to-text example, now that mtedx has been published (Interspeech 2021)

Pull Request resolved: https://github.com/pytorch/fairseq/pull/3984

Reviewed By: yuntang

Differential Revision: D32102153

Pulled By: kahne

fbshipit-source-id: 1eea532e9032c116da447a4da30669305559a787
2021-11-02 13:06:45 -07:00
Evgeny Kharitonov
bba000d8ba Fixes for GSLM TTS Checkpoints (#2519)
Summary:
1. Add links to corresponding code_dict files, required by the TTS
checkpoints
2. synthesize_audio_from_units.py has code_dict path configurable
3. Removed links to 5000-unit models, as those will not be supported.

# Before submitting

- [x] Was this discussed/approved via a Github issue? (no need for typos, doc improvements)
Fixes https://github.com/pytorch/fairseq/issues/3970 and https://github.com/pytorch/fairseq/issues/3870
- [x] Did you read the [contributor guideline](https://github.com/pytorch/fairseq/blob/main/CONTRIBUTING.md)?
- [ ] Did you make sure to update the docs?
- [ ] Did you write any new necessary tests?
Manually verified CPC50 & 100, HUBERT 50-200

## What does this PR do?
Fixes issues 3970 and and 3870 in the public repo

1. Add links to corresponding code_dict files, required by the TTS checkpoints
2. synthesize_audio_from_units.py has code_dict path configurable
3. Removed links to 500-unit models, as those will not be supported.

## 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/fairinternal/fairseq-py/pull/2519

Reviewed By: wnhsu

Differential Revision: D32019362

Pulled By: eugene-kharitonov

fbshipit-source-id: a2a1db99898e4d025c5a1e439bd63264406aad0a
2021-10-29 13:41:04 -07:00
Changhan Wang
72e524b2fb add SNR and CER filtering to S^2; add S^2 citation
Summary: add SNR and CER filtering to S^2; add S^2 citation

Reviewed By: wnhsu

Differential Revision: D31566968

fbshipit-source-id: b8a651f4bf0dd088e2f03fb759d1869c6af7730f
2021-10-29 13:12:01 -07:00
Wei-Ning Hsu
265df7144c set num_update before loading state dict (#2491)
Summary:
## What does this PR do?
Set `model.num_updates` in `load_model_ensemble_and_task()` before loading `state_dict`, like what's done in `fairseq/trainer.py`, because a model's `state_dict` may depend on `num_update`.

## 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/fairinternal/fairseq-py/pull/2491

Reviewed By: xuqiantong

Differential Revision: D31863368

Pulled By: wnhsu

fbshipit-source-id: c70051f898819cc43b02c9f5765429e9f194aed5
2021-10-22 19:51:09 -07:00
Vimal Manohar
a38c86c09e Fix quantization with checkpoint wrapper
Summary: checkpoint wrapper deepcopy fix wasn't compatible with jitting. e.g f304176613

Reviewed By: diptanu

Differential Revision: D31839350

fbshipit-source-id: d3ae64ac42e82a5dd103a7e1c03f6a5fbe7234ee
2021-10-22 08:45:20 -07:00
Sam Shleifer
c5ff181125 NormFormer: flags and docs (#2460)
Summary: Pull Request resolved: https://github.com/fairinternal/fairseq-py/pull/2460

Reviewed By: myleott

Differential Revision: D31731798

Pulled By: sshleifer

fbshipit-source-id: 938456c17aa004cacffdcdd124aebe390da83d5f
2021-10-19 17:13:04 -07:00
Sam Shleifer
29be3fe141 --activation relu-squared (#2458)
Summary: Pull Request resolved: https://github.com/fairinternal/fairseq-py/pull/2458

Reviewed By: ngoyal2707

Differential Revision: D31721732

Pulled By: sshleifer

fbshipit-source-id: 620fbeece5ad4101baaf98cf2150027288ebad33
2021-10-18 08:26:22 -07:00
Vimal Manohar
1ef3d6a1a2 CPLTask for training with continuous pseudo labeling
Summary:
CPLTaskImpl provides implementation to augment existing tasks to take additional input of ema_model in its train_step and valid_step for continous pseudo-labeling (CPL) during training. It passes this ema_model to the criterion.

See Kaizen semi-supervised training paper for more details https://arxiv.org/abs/2106.07759.

This implementation also supports using CPLDataset which enables using unsupervised data only for `cpl_finetune_epoch > epochs >= cpl_start_epoch`. CPLDataset is like MultiCorpusDataset but ignores the unsupervised datasets while sampling.

Another addition in this diff is to skip dataset in MultiCorpusDataset if the sampling probability is 0.

Reviewed By: cruvadom

Differential Revision: D30701536

fbshipit-source-id: 1d840eacfd538ed7aed3baaefc8b254390642b45
2021-10-14 22:09:07 -07:00
Apoorv Vyas
f670d9f1f2 Fixes fp16 inference for speech recognition example (#2438)
Summary:
Currently the speech recognition fails for fp16 option as the input is
not converted to half. This fixes this issue.

# Before submitting

- [ ] 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/main/CONTRIBUTING.md)?
- [x] Did you make sure to update the docs?
- [ ] Did you write any new necessary tests?

## What does this PR do?
Fixes fp16 inference for speech recognition example.

## 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/fairinternal/fairseq-py/pull/2438

Reviewed By: apoorv2904, xuqiantong

Differential Revision: D31594529

Pulled By: alexeib

fbshipit-source-id: 75d1fe3f00b2e86381f28f79daea2cd516233e22
2021-10-14 21:09:02 -07:00
Diana Liskovich
92cae45425 Use safe_getattr and safe_hasattr (#3953)
Summary:
hasattr should not default to True if field doesn't exist

# Before submitting

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

## What does this PR do?
Fixes # (issue).

## 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/3953

Reviewed By: myleott, Lynx1820

Differential Revision: D31591929

Pulled By: dianaml0

fbshipit-source-id: f78397d2b06867c61fc04a6bd2aa9579265e2d21
2021-10-13 10:05:22 -07:00
Hu Xu
862efab86f MMPT bug fixes (#2428)
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/main/CONTRIBUTING.md)?
- [x] Did you make sure to update the docs?
- [ ] Did you write any new necessary tests?

## What does this PR do?
Fixes argument for `lr_scheduler.total_num_update`; missing import of `dsprocessor` for COIN; `vmasks` on demo inference; update README.md of fairseq for examples/MMPT.

## 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/fairinternal/fairseq-py/pull/2428

Reviewed By: berniebear

Differential Revision: D31528947

Pulled By: howardhsu

fbshipit-source-id: 1fecf34bdab82cbf6001e3905a532e4e6eb38e01
2021-10-10 02:21:43 -07:00
Wei-Ning Hsu
a61107ecb5 update code dict prep (#2424)
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/main/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/3930
https://github.com/pytorch/fairseq/issues/3795

## 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/fairinternal/fairseq-py/pull/2424

Reviewed By: Abdel-rahmanMohamed

Differential Revision: D31506758

Pulled By: wnhsu

fbshipit-source-id: 895c0b034637f081dccb9905f38aced8a18ce5ff
2021-10-08 13:00:37 -07:00
Kushal Lakhotia
027fc8e77e GSLM: Fix absence of code dict file for resynthesis (#3934)
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/main/CONTRIBUTING.md)?
- [ X] Did you make sure to update the docs?

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

Pull Request resolved: https://github.com/pytorch/fairseq/pull/3934

Reviewed By: Abdel-rahmanMohamed

Differential Revision: D31503773

Pulled By: wnhsu

fbshipit-source-id: dfb976e2f37d25282daca20c290a718ab8c27f64
2021-10-08 10:03:37 -07:00
erichan1
36eac86d6c Update README to match master->main branch change (#3922)
Summary:
Loading xlmr doesn't work because trying to pull from master branch, which has been changed to main.

Pull Request resolved: https://github.com/pytorch/fairseq/pull/3922

Reviewed By: erichan1

Differential Revision: D31415771

Pulled By: dianaml0

fbshipit-source-id: a4b1b533b5596a4d3556c97c2f15847e444aeea9
2021-10-07 12:17:47 -07:00
Qiantong Xu
ce6c9eeae1 added 2 new models (#2415)
Summary:
# Before submitting

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

## What does this PR do?
Fixes # (issue).

## 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/fairinternal/fairseq-py/pull/2415

Reviewed By: alexeib

Differential Revision: D31455210

Pulled By: xuqiantong

fbshipit-source-id: d3b45a3b60800f0fc5da0efeddbd8213dee4878f
2021-10-07 11:12:13 -07:00
Rengan Xu
ecea95c063 Alignment train optimization (#2200)
Summary:
Pull Request resolved: https://github.com/fairinternal/fairseq-py/pull/2200

The expected alignment for p-choose is the performance bottleneck that needs to be optimized. The solution is to implement a custom operator to reduce the kernel launch overhead, and optimize the implementations of some operations.

Some key optimizations:

* Use a contiguous alpha array to avoid array concatenation. The original version create an array for each slice of alpha and concat them in the end.
* Implement cumprod using prod operation directly. It used log-cumsum-exp operations before.
* Implement cumprod using cuda CUB library which is more efficient than scan operation in pytorch.

Reviewed By: cndn

Differential Revision: D30033767

fbshipit-source-id: 853c1c2d366838d6bcfa0863999f217a394e46a7
2021-10-06 16:49:16 -07:00
Qiantong Xu
dd3bd3c049 fix model link (#2408)
Summary:
# Before submitting

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

## What does this PR do?
Fixes # (issue).

## 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/fairinternal/fairseq-py/pull/2408

Reviewed By: alexeib

Differential Revision: D31422844

Pulled By: xuqiantong

fbshipit-source-id: 348050118621de922c08632ca7f31dedba109da1
2021-10-05 21:20:14 -07:00
Qiantong Xu
6639842016 zero-shot model release (#2407)
Summary:
# Before submitting

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

## What does this PR do?

zero-shot model release

## 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/fairinternal/fairseq-py/pull/2407

Reviewed By: alexeib

Differential Revision: D31417241

Pulled By: xuqiantong

fbshipit-source-id: 576644694638d3b2606f1751b74feb0531b50eb7
2021-10-05 18:31:47 -07:00
Jerry Zhang
35cc605b86 torch.quantization --> torch.ao.quantization in deeplearning/projects/fairseq-py
Summary:
codemod -m -d $dir --extensions py \
            'torch.quantization' \
            'torch.ao.quantization'

Reviewed By: z-a-f

Differential Revision: D31294192

fbshipit-source-id: fcad50d07a8397fc2ab8fd7188ab338f51f3ba10
2021-10-04 22:06:03 -07:00
Juan Miguel Pino
72bb4447d7 Bug fix for speech translation data preparation (#3921)
Summary:
Bug introduced in d974c709bf I believe.

Pull Request resolved: https://github.com/pytorch/fairseq/pull/3921

Reviewed By: kahne

Differential Revision: D31296530

Pulled By: jmp84

fbshipit-source-id: cd24728ef06575853579496a9062c3dbd5dd2e93
2021-10-01 19:21:17 -07:00
Po-Yao Huang
666d8c26e1 MMPT (#2373)
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/main/CONTRIBUTING.md)?
- [x] Did you make sure to update the docs?
- [x] Did you write any new necessary tests?

## What does this PR do?
Release the code and model for two of our papers at FAIR:
1. VideoCLIP: Contrastive Pre-training for Zero-shot Video-Text Understanding (Xu et. al., EMNLP 2021)
2. VLM: Task-agnostic Video-Language Model Pre-training for Video Understanding (Xu et. al., ACL Findings 2021)

## PR review
dianaml0 (Diana Liskovich, referred by Myle Ott)

## Did you have fun?
Yes! {emoji:1f44d}

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

Reviewed By: dianaml0

Differential Revision: D31278832

Pulled By: berniebear

fbshipit-source-id: b6a0fad4caf44b062be0c46c12842b26792b35a3
2021-09-30 14:14:19 -07:00
Yun Tang
c0d098eafa Update speech_text_joint_to_text example to the latest fairseq
Summary:
There are mismatches for the code in speech_text_joint_to_text example and the code in the latest fairseq codebase
1. import task class twice
2. newly added TransformerEncoderLayerBase is equal to TransformerEncoderLayer
3. Wav2VecEncoder API change (wav2vec2_asr.py)

Reviewed By: kahne

Differential Revision: D31299458

fbshipit-source-id: 6eb64e2692ca3c2729248d55ccefe74283fe4ef0
2021-09-30 10:02:43 -07:00
Myle Ott
f34abcf2b6 Use safe_getattr and safe_hasattr (#2347)
Summary:
We use omegaconf.DictConfig objects in non-strict mode, so hasattr behaves weirdly:
```
>>> import omegaconf
>>> omegaconf.__version__
'2.0.6'
>>> x = omegaconf.DictConfig({"a": 1})
>>> hasattr(x, "foo")
True
```

This violates some assumptions in various parts of the code. For example, previously this command was incorrectly missing the final layer norm due to upgrade logic that relied on `hasattr`, but is fixed after this diff:
```
CUDA_VISIBLE_DEVICES=0 python train.py --task dummy_lm --arch transformer_lm_gpt3_small --optimizer adam --lr 0.0001 --max-sentences 8 --log-format json --log-interval 1
```

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

Reviewed By: alexeib

Differential Revision: D31170584

Pulled By: myleott

fbshipit-source-id: bd767b7497794314f58f0f8073cdd4332b214006
2021-09-27 10:23:01 -07:00
Diana Liskovich
fcca32258c Update reference from master to main elsewhere in fbcode
Summary: Update reference from master to main elsewhere in fbcode

Reviewed By: alexeib

Differential Revision: D30938472

fbshipit-source-id: 243b98550207f241c9d3265bf3d4060350aaf0a8
2021-09-20 14:34:46 -07:00
freewym
3dd70d8c0d fix the problem that command line args for Transformer model do not o… (#3773)
Summary:
…verride the defaults

# 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)?
- [ ] 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/3761.

## 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/3773

Reviewed By: yuntang

Differential Revision: D30310383

Pulled By: kahne

fbshipit-source-id: cbfcbc032dbf53490a25ffdebe57f65c42d52e71
2021-09-20 12:37:00 -07:00
Diana Liskovich
5adfeaccf9 Rename references from master -> main in preparation for branch name change (#2297)
Summary:
# Before submitting

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

## What does this PR do?
Fixes # (issue).

## 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/fairinternal/fairseq-py/pull/2297

Reviewed By: alexeib

Differential Revision: D30906090

Pulled By: dianaml0

fbshipit-source-id: 941d30db7f766c9077a1b5bb2a04680f57e2e070
2021-09-20 08:29:38 -07:00
dianaml0
f6abcc2a67 update on branch renaming (#3879)
Summary:
# Before submitting

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

## What does this PR do?
Fixes # (issue).

## 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/3879

Reviewed By: myleott

Differential Revision: D30969142

Pulled By: dianaml0

fbshipit-source-id: 902154c03fd68ae6645d3e0ac07b7d729dfc7934
2021-09-16 10:03:02 -07:00
Xutai Ma
98d638c70c Mma refactor (#2087)
Summary:
Fixing issues ([3546](https://github.com/pytorch/fairseq/issues/3546)) with latency augmented training for mma due to the change of fairseq APIs

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

Reviewed By: hygong-fb

Differential Revision: D29851286

Pulled By: xutaima

fbshipit-source-id: 6c3077db06b89c23b312b28527d7395a725f3b3a
2021-09-15 01:49:45 -07:00