Commit Graph

2272 Commits

Author SHA1 Message Date
dianaml0
5f2515e676 Fix failing test (#3065)
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/3065

Reviewed By: Mortimerp9

Differential Revision: D34144674

Pulled By: dianaml0

fbshipit-source-id: 842b0d29c9c85d4b56b640f2823fcb4e3f912f98
2022-02-10 12:17:47 -08:00
Alban Desmaison
5551a1995b Change ParameterList and ParameterDict to be able to contain any kind of objects (#70499)
Summary:
The only difference with plain list/dict now is that nn.Parameters are
handled specially and registered as parameters properly.

test_nn and parametrization works locally.
Will see in CI if DP is fixed as well.

Tentative fix for https://github.com/pytorch/pytorch/issues/36035

Pull Request resolved: https://github.com/pytorch/pytorch/pull/70499

Reviewed By: jbschlosser, alexeib

Differential Revision: D34005332

Pulled By: albanD

fbshipit-source-id: 7e76b0873d0fec345cb537e2a6ecba0258e662b9
2022-02-09 10:47:56 -08:00
Sravya Popuri
8b02f00e8a fix s2s test - disable multitasking by setting multitask_config_yaml to None (#3059)
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/3059

Reviewed By: kahne

Differential Revision: D34083178

Pulled By: sravyapopuri388

fbshipit-source-id: a33af1696570be4826973b19fe34177bcf851e06
2022-02-09 10:05:22 -08:00
alexeib
327cff24a5 Create a separate EMA implementation for in-model tracking (#3036)
Summary:
ema.py initially used by data2vec was actually created for trainer-level ema tracking

since data2vec creates and uses ema tracking within the model, we will split ema into a different module-level implementation

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

Reviewed By: wnhsu

Differential Revision: D34034479

Pulled By: alexeib

fbshipit-source-id: f8c65552d446f1104c36380f5d1ff22a75e6e405
2022-02-07 15:38:52 -08:00
Sravya Popuri
11b2830d29 Refactor speech tests and add missing regression tests (#3001)
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/3001

Reviewed By: kahne

Differential Revision: D33904550

Pulled By: sravyapopuri388

fbshipit-source-id: f55f8121d83e5abebdfcf7ac90dcba39f65cafaf
2022-02-04 14:35:02 -08:00
Vimal Manohar
6b7a7d6457 Fix EMA GPU test
Summary: The GPU test was broken after D33809223 (1b61bbad32)

Reviewed By: cruvadom

Differential Revision: D33931570

fbshipit-source-id: 37962a437d8e25b1dafc58db0efa55c1afa5f3ee
2022-02-04 09:10:06 -08:00
Changhan Wang
53cc55c9c8 add BERTScore scorer
Summary: add BERTScore scorer

Reviewed By: yuntang

Differential Revision: D33881724

fbshipit-source-id: 89f7f7b71a9def28cd8b0366f540e445e74efabb
2022-02-03 14:39:09 -08:00
Wei-Ning Hsu
272c4c5197 Fix hubert (#3019)
Summary:
## PR review
1. Update HuBERT to work with the TransformerEncoder wav2vec2.py
2. Remove dictionary loading issue when loading fine-tuned HuBERT checkpoints to make the checkpoints self-contained
3. Add unit-test for HuBERT fine-tuned checkpoints
4. Avoid divide-by-zero error in infer.py when inference time is zero (e.g., when inferring just one utterance)

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

Reviewed By: andrewyeh

Differential Revision: D33970620

Pulled By: wnhsu

fbshipit-source-id: c523dd6ddb0f6a496be8b0b4b56f0c32c1d3dbc5
2022-02-03 10:17:10 -08:00
Pierre Andrews
f591cc94ca upgrade black for lints (#3004)
Summary:
This is the same as https://github.com/fairinternal/fairseq-py/issues/3003 but for main instead of gshard.

the lint test will run the latest version of black, which is 22.1.0 right now and seems to be incompatible with the 21.12b0 version that is setup in pre-commit. This means that some files were with valid format in the past, but are not anymore...

This PR formats these files with 22.1.0 and autoupdates pre-commit config to use that black version too.

(note: this is the second time it happens. a solution would be to pin the lint test to the same version as the one in the pre-commit hook and that was used to format everything clean so that we have a stable formating)

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

Reviewed By: dianaml0

Differential Revision: D33917490

Pulled By: Mortimerp9

fbshipit-source-id: d55e800b976f94545cdab4132daa7c45cbd0e34c
2022-02-02 04:31:33 -08:00
Wei-Ning Hsu
5d2be954bb add defaults again after importing user_module (#3007)
Summary:
## What does this PR do?
Default values for the configs imported from `user_dir` was not added properly.

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

Reviewed By: alexeib

Differential Revision: D33926315

Pulled By: wnhsu

fbshipit-source-id: 914eecec769964686342d66c96d6ba76f12e1277
2022-02-01 21:42:15 -08:00
Victoria X Lin
6b770134a2 Add citation details and other wording fixes to model card (#4172)
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/pytorch/fairseq/pull/4172

Reviewed By: punitkoura

Differential Revision: D33911169

Pulled By: todpole3

fbshipit-source-id: d3e111ab4b9a646e1799ad9335c70ec1ee8d25a4
2022-02-01 10:57:35 -08:00
Victoria X Lin
790f3be15a Add XGLM pre-training data format explaination (#4158)
Summary:
1. Add XGLM pre-training data format explanation
2. Add back pointer to pre-print

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

Reviewed By: xianxl

Differential Revision: D33825440

Pulled By: todpole3

fbshipit-source-id: 379aa55d55ef3c9016987d1f05de023b7a7aee04
2022-02-01 10:30:07 -08:00
Changhan Wang
d839d84f1e Miscellaneous S2T & S2 bug fixes
Summary: Miscellaneous S2T & S2 bug fixes

Reviewed By: yuntang

Differential Revision: D33469556

fbshipit-source-id: 430c2cad01dd7ea862a6c1564ad609887d66b788
2022-01-31 20:44:43 -08:00
Vimal Manohar
1b61bbad32 Fix broken EMA in fairseq
Summary: EMA broken since D33649708 (995c204337) due to indentation error.

Reviewed By: cruvadom

Differential Revision: D33809223

fbshipit-source-id: c6c4d0d327443bfea787817040e1832eef0f50e4
2022-01-27 13:02:58 -08:00
Wei-Ning Hsu
4a7835b794 Hubert unit test (#2766)
Summary:
## What does this PR do?
- Add unit test for HuBERT
- update model arg to comply with wav2vec to TranformerEncoder

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

Reviewed By: Abdel-rahmanMohamed

Differential Revision: D32965218

Pulled By: wnhsu

fbshipit-source-id: 036a1644179c35b875c9ba30d75b4ef039fb328f
2022-01-24 16:24:50 -08:00
Victoria X Lin
509e83e432 Add XGLM downstream task evaluation examples (#4154)
Summary:
1. Add XGLM downstream task evaluation examples
2. Add bibtex citation of XGLM arXiv paper

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

Reviewed By: xianxl

Differential Revision: D33748846

Pulled By: todpole3

fbshipit-source-id: ce4dfce2fccf92742f124f12a0d9a388280320fa
2022-01-24 16:24:47 -08:00
Tony Bruguier
5fd38e3d5b Fix breakage from D33649708
Summary: https://www.internalfb.com/diff/D33649708 (995c204337)?src_version_fbid=1030479880843010&dst_version_fbid=247617347518523&transaction_fbid=1601081576900014

Reviewed By: alexeib

Differential Revision: D33696937

fbshipit-source-id: 9a17610e3f4eb3dd2b2131a3f9fb42732a31b47f
2022-01-21 09:27:49 -08:00
alexeib
fc758bbf79 fix readme (#2939)
Summary:
minor fix

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

Reviewed By: michaelauli

Differential Revision: D33685330

Pulled By: alexeib

fbshipit-source-id: 4d6c6edb1fab9d0d56a6e03c0a2b43a864f1d07a
2022-01-20 08:48:41 -08:00
alexeib
c71870f370 Data2vec (#2936)
Summary:
new data2vec models

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

Reviewed By: jacobkahn

Differential Revision: D33674643

Pulled By: alexeib

fbshipit-source-id: 2c2b4fae541974587b50a78a44d34033e9b5192d
2022-01-20 08:28:47 -08:00
alexeib
995c204337 Data2vec prelim (#2929)
Summary:
Preliminaries for data2vec release, include some minor improvements and bug fixes

Most important change is that we now default to raising an exception when fields in config do not have a corresponding field in the model dataclass

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

Reviewed By: wnhsu

Differential Revision: D33649708

Pulled By: alexeib

fbshipit-source-id: 629bdb4c361550740b451c570c2005bb956c6fcb
2022-01-20 00:02:16 -08:00
Hongyu Gong
a59cea5944 attn head selection
Summary:
Add scripts for multihead attention selection in multilingual and multil-domain training from the following paper:
"Pay Better Attention to Attention: Head Selection in Multilingual and Multi-Domain Sequence Modeling", NeurIPS 2021.

Reviewed By: yuntang

Differential Revision: D31802221

fbshipit-source-id: 8c69b89bda29e6857bd3af02979c07e1b5cf49f1
2022-01-18 21:15:34 -08:00
Vimal Manohar
a075481d0d Decode using EMA model in IPL recipe
Summary: Add option to use the EMA model for decoding in transducer IPL recipe by passing --ipl-decode-ema. Note EMA should be enabled as in the diff D24238379 (8feccf9441) using options --store-ema --ema-start-update and --ema-decay.

Reviewed By: cruvadom

Differential Revision: D31983366

fbshipit-source-id: 2bf63b3f7d1b5fa8804b3a7e9bfab71a463ca957
2022-01-18 19:29:52 -08:00
Hongyu Gong
40eb7310be Code cleanup
Summary:
Add scripts for multihead attention selection in multilingual and multil-domain training from the following paper:
"Pay Better Attention to Attention: Head Selection in Multilingual and Multi-Domain Sequence Modeling", NeurIPS 2021.

Reviewed By: yuntang

Differential Revision: D31781212

fbshipit-source-id: 8e1a596826f682f80730c251ec31c68df0de6516
2022-01-18 16:50:41 -08:00
Liang Tan
1575f30dd0 Add ffn prune to fairseq
Summary:
Support FFN prune for Fairseq. For example, user can apply pruning on top of Roberta base model by specify the argument "--ffn-blocks-to-remove 1024". Also, user needs to provide a ckpt which is already pruned so that the pruned ckpt can be loaded correctly.
The idea of prune can be summarized as
Fine tune model (e.g. roberta encoder) on a certain datasets with regularization
After the model is trained. User could use _get_fc_rank and _prune_fc_layer functions to get the top X blocks with most importance in each transformer layer. Then user uses the rank to prune a new roberta encoder and save the pruned ckpt manually.
User will fine tune the the new roberta encoder via the ckpt saved above

Reviewed By: dianaml0

Differential Revision: D33525055

fbshipit-source-id: 5087140ee891d6ec9266726e3a477947c233412c
2022-01-14 16:26:59 -08:00
Vimal Manohar
cf8ff8c3c5 Add unittests for jitting EMA model
Summary: As title

Reviewed By: nayansinghal

Differential Revision: D32005717

fbshipit-source-id: ebdf1ed0e4a2b9fccffd841d0fa7be0b50ec6b79
2022-01-13 01:53:42 -08:00
Shagun Sodhani
fa7663c314 Update commands, checkpoints and contact info for shuffled word order paper (#4129)
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?

Update commands, checkpoints and contact info.

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

Reviewed By: dianaml0

Differential Revision: D33556233

Pulled By: shruti-bh

fbshipit-source-id: 3bad45b3e154fa11d4b13776d97408ce1a166113
2022-01-12 17:43:58 -08:00
Pierre Andrews
279796224f Preprocess Split (#2738)
Summary:
This is the equivalent to PR https://github.com/fairinternal/fairseq-py/issues/2697 but on top of main instead of gshard (cherry-picked and merged the squash):

* reorganize preprocess.py code a bit
* use Binarizers objects in the multiprocess code
* clean up the make_binary
* multiprocess logic
* learn to count
* format and doc string
* add basic test for vocab binarizer
* generalize to one line
* move multiprocess in binarizer

Testing:
```
python -m fairseq_cli.preprocess --only-source --trainpref ~/fixathon/small_vocab_test/train.in --destdir ~/fixathon/small_vocab_test/data-bin.cherry --workers 20
python -m fairseq_cli.preprocess --only-source --trainpref ~/fixathon/small_vocab_test/train.in --destdir ~/fixathon/small_vocab_test/data-bin.main --workers 20
```

```
 md5sum ~/fixathon/small_vocab_test/data-bin.cherry/train.bin == md5sum ~/fixathon/small_vocab_test/data-bin.main/train.bin
```

```
diff ~/fixathon/small_vocab_test/data-bin.main/dict.txt ~/fixathon/small_vocab_test/data-bin.cherry/dict.tx
```

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

Reviewed By: sshleifer, dianaml0

Differential Revision: D32830875

Pulled By: Mortimerp9

fbshipit-source-id: e7463d5cdd96a877691bf39666daa319ebb3dcb8
2022-01-11 11:56:46 -08:00
Liang Tan
b3fa5100c6 Add mha prune to fairseq
Summary:
Support multihead attention prune for Fairseq. For example, user can apply pruning on top of Roberta base model by specify the argument "--mha-heads-to-keep 8". Also, user needs to provide a ckpt which is already pruned so that the pruned ckpt can be loaded correctly.

The idea of prune can be summarized as
1. Fine tune model (e.g. roberta encoder) on a certain datasets with regularization
2. After the model is trained. User could use get_reserve_head_index and _adaptive_prune_heads functions to get the top X heads with most importance. Then user uses the rank to prune a new roberta encoder and save the pruned ckpt manually.
3. User will fine tune the the new roberta encoder via the ckpt saved above

To get rid of registering different pruned version of Roberta, I use the argument --mha-heads-to-keep to prune the Roberta model into a pruned version which matches the pruned ckpt.

Reviewed By: dianaml0

Differential Revision: D32449003

fbshipit-source-id: a952fd9ad723a6dbc5c2af574c42f2e9a1fa27dc
2022-01-11 10:09:07 -08:00
Sravya Popuri
da4851859b Benchmarking OSS (#2852)
Summary:
- The goal of this framework is to support benchmarking various speech to speech translation(S2ST) models in terms of runtime, max-memory consumption and total number of floating point operations(FLOPS).
- It is a generic framework and can be easily extended to support any fairseq models. To accurately benchmark the performance, core inference modules are re-implemented based on fairseq_cli/generate.py (core.py/Processing) and examples/speech_to_text/generate_waveform.py(core.py/SpeechGeneration.
- To ensure that the end to end models and cascaded models are compared fairly, for cascaded models we only consider the performance metrics for model inference at all stages ignoring any intermediate data and io processing consumption.
- We run all the benchmarking runs on CPU as it is generally used in production environment and also due to lack of good benchmarking library support for GPUs.

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

Reviewed By: an918tw

Differential Revision: D33398060

Pulled By: sravyapopuri388

fbshipit-source-id: cffa19820deaa4ee7f629845944cbb6223498f4d
2022-01-11 09:29:29 -08:00
Sravya Popuri
40ff55abbe conformer (#2859)
Summary:
**This PR**

- Adds conformer layer based on https://arxiv.org/pdf/2005.08100.pdf.
- Conformer implementation supports multihead attention based on 3 different positional embedding types - absolute positional embedding, relative positional encoding  and rotational positional embedding.
- Adds conformer encoder with conv1d subsampling, positional embedding followed by N conformer layers
- Adds S2T_Conformer model based on the conformer encoder and transformer decoder.
- Add conformer support in Wav2Vec2
- Add unit tests for core modules

**Verfication**

- Verified the set up on MUST-C En-De S2T, Covost2 Es-En S2T, Librispeech ASR to ensure the implementation is correct.
- For S2T setups, the performance is either similar to the transformer based models or better.
- Wav2vec2 pretraining and finetuning based on librispeech showed improvements over corresponding transformer baselines.
- [WIP] Experiment log: https://docs.google.com/document/d/1QI-ROWVenUEXPJoHTaKD85Fq7T8ZXNc8bc54MzgwJjA/edit#

**Next steps**
- Add regression tests
- Add README and open source checkpoints

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

Reviewed By: kahne

Differential Revision: D33434092

Pulled By: sravyapopuri388

fbshipit-source-id: 62f22b917a332481370750e04a439e05832a2282
2022-01-10 16:18:38 -08:00
Yun Tang
e69f1fa37f speech integration tests for jointly trained models
Summary: Add test for DualInputS2TTransformerModel at examples/speech_text_joint_to_text/models/s2t_dualinputtransformer.py

Reviewed By: kahne

Differential Revision: D33284188

fbshipit-source-id: c02b697fc7734425661e00bbb606852b5d94a587
2022-01-07 12:45:20 -08:00
Diana Liskovich
c9a8bea83f Formatting fix: get CI green (#2860)
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?
Applies `black` and `isort` to files

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

Reviewed By: Mortimerp9

Differential Revision: D33456637

Pulled By: dianaml0

fbshipit-source-id: 560b8d3a8f589cbecc92d0d21163596b5d47d609
2022-01-07 00:39:11 -08:00
Changhan Wang
1d5da6d5b9 add hub interface for S2T
Summary: add hub interface for S2T

Reviewed By: sravyapopuri388

Differential Revision: D33394412

fbshipit-source-id: bf844822261c213bafacd9b2c71d9d591bc0f3a6
2022-01-04 12:34:30 -08:00
Changhan Wang
43defa1bcb add hub interface for TTS
Summary: add hub interface for TTS

Reviewed By: pipibjc

Differential Revision: D33394399

fbshipit-source-id: 4efb5b08cf04ef77a469006f9822e22a27112ac6
2022-01-04 09:09:58 -08:00
Changhan Wang
ee177fc4fa add xm_transformer test; refactor speech tests
Summary: add xm_transformer test; refactor speech tests

Reviewed By: sravyapopuri388

Differential Revision: D33312231

fbshipit-source-id: a2b2695fc3c10d5420abbe23a4a3005777aa2ae1
2021-12-31 12:31:11 -08:00
Changhan Wang
59b3ada2e2 fix SacrebleuScorer.score()
Summary: fix SacrebleuScorer.score()

Reviewed By: sravyapopuri388

Differential Revision: D33311843

fbshipit-source-id: 8536baceab6ef2e7c9c4a9a8a005abaa6a9229f0
2021-12-30 22:14:33 -08:00
Changhan Wang
75f8fa29c6 update xm_transformer
Summary:
Update xm_transformer
- Added V1 arch (FFNs before/after convolutions in the adaptor, which didn't exist in the V0/ACL paper arch)
- Added args for gradient checkpointing and fully sharded data parallele

Reviewed By: sravyapopuri388

Differential Revision: D33144404

fbshipit-source-id: 548c917824ebd2aa926c83d5ba62fbf648cf4b97
2021-12-30 18:49:32 -08:00
Changhan Wang
6a183f37a0 add strict option to checkpoint_utils. load_pretrained_component_from_model()
Summary: Add strict option to checkpoint_utils. load_pretrained_component_from_model()

Reviewed By: sravyapopuri388

Differential Revision: D33304224

fbshipit-source-id: 2284a21dfea7810ec212f15daadeeeb45c6dca1b
2021-12-30 18:38:12 -08:00
Liang Tan
2762a1cfef Add regularization for multihead attention module and ffn module
Summary: [Fairseq] Add regularization for multihead attention module and ffn module

Reviewed By: dianaml0

Differential Revision: D32441521

fbshipit-source-id: c648c1f8ec1a3310ba90c4952cdd40a21b959d26
2021-12-30 02:02:05 -08:00
Diana Liskovich
7fddb9d960 lint fixes (#2834)
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?
Applied `black` and `isort` to fix failing CI

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

Reviewed By: vedanuj

Differential Revision: D33262876

Pulled By: dianaml0

fbshipit-source-id: 03215c276fcddda9f7c78971bf6ed7c5ac21b2ee
2021-12-29 11:50:55 -08:00
Ann Lee
5cd7a21cc1 S2ST oss (#2756)
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?
Releasing code, model & recipe for the work "Direct speech-to-speech translation with discrete units".
Main changes:
1. examples/speech_to_speech
2. tasks/speech_to_speech
3. data/audio/speech_to_speech_dataset
4. models/speech_to_speech
5. criterions/speech_to_speech_criterion

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

Reviewed By: sravyapopuri388, kahne

Differential Revision: D32923969

Pulled By: an918tw

fbshipit-source-id: 838ba42457f4684e9767d15b5b514681a9572b39
2021-12-28 08:07:55 -08:00
Changhan Wang
87d0ede93c fix evaluation tokenizer for sacrebleu >= 2.0.0
Summary: fix evaluation tokenizer for sacrebleu >= 2.0.0

Reviewed By: sravyapopuri388

Differential Revision: D33306119

fbshipit-source-id: c0d0d45df201de7a869aae1680b7ae49b590414a
2021-12-24 00:07:30 -08:00
Changhan Wang
0b128f4217 update ignore_prefix_size in label_smoothed_cross_entropy
Summary:
update ignore_prefix_size in label_smoothed_cross_entropy
- lprobs is always B x T x C in the current models
- lprobs.batch_first was default to `False` which contradicts the fact above

Reviewed By: sravyapopuri388

Differential Revision: D33304121

fbshipit-source-id: 9391b48c7036642d9741d254b03c46389a4fe584
2021-12-23 23:43:13 -08:00
Changhan Wang
ca36b437e4 add METEOR scorer; fix chrF scorer config
Summary: add METEOR scorer; fix chrF scorer config

Reviewed By: hygong-fb

Differential Revision: D33273312

fbshipit-source-id: 3fcb5b2479fb6cc90e9f0235886c658e0c586fba
2021-12-22 15:45:43 -08:00
Gerard I. Gállego
98ebe4f1ad Fix bugs in MuST-C preprocessing (#3887)
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)?
- [ ] 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/3882
Fixes https://github.com/pytorch/fairseq/issues/3884

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

Reviewed By: yuntang

Differential Revision: D33152073

Pulled By: kahne

fbshipit-source-id: 7f5c90a9876320e7c5c406ed032681452c7c5056
2021-12-21 18:18:16 -08:00
Xian Li
7f3967805f add readme for xglm models (#2808)
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?
Add readme and task for xglm models.

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

Reviewed By: punitkoura

Differential Revision: D33237928

Pulled By: xianxl

fbshipit-source-id: 7773cf56e896210dab1f4311ae69f0e00c6d9aff
2021-12-20 13:05:17 -08:00
Myle Ott
00b6adfbdc Add README for Efficient Large Scale Language Modeling with Mixtures of Experts (#2823)
Summary: Pull Request resolved: https://github.com/fairinternal/fairseq-py/pull/2823

Reviewed By: artetxem

Differential Revision: D33236555

Pulled By: myleott

fbshipit-source-id: 44dfa4b4ce44ad4ffdead2b707b187f181ef77a2
2021-12-20 11:01:23 -08:00
Diana Liskovich
a54021305d formatting fix (#2816)
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?
fix `black` failures

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

Reviewed By: alexeib

Differential Revision: D33172615

Pulled By: dianaml0

fbshipit-source-id: 36b141f42941670f1bfa981041d878042feb0428
2021-12-16 16:11:19 -08:00
Shreyan Bakshi
1e4055da7d Fix Tracing mode TS export for LayerNorm layer
Summary: When under TorchScript Tracing (instead of only doing this for Scripting) we set `export=True` for `LayerNorm` as `FusedLayerNorm `doesn't work with JIT yet (see `torch.jit.unused decorator`).

Reviewed By: cndn

Differential Revision: D33103054

fbshipit-source-id: f8c24a4a30a89dd4c70b19362fd60c51fcb9a1f0
2021-12-16 12:55:57 -08:00
Yun Tang
86f20c7762 Merge STPT: Step 2
Summary: Add data class TransformEosConcatLangPairDataset

Reviewed By: kahne

Differential Revision: D33084736

fbshipit-source-id: 851446429920ac89b0b1418a9f42a010a8c42867
2021-12-16 10:03:22 -08:00