1. 29 Jul, 2019 1 commit
    • Naman Goyal's avatar
      adding glue data preprocessing scripts (#771) · 138dc8e4
      Naman Goyal authored
      Summary:
      1) Added glue data pre-processing script.
      2) updated README with usage.
      
      TODO:
      1) releasing fairseq dictionary and remove hardcoded path.
      2) remove hard-coded path for bpe-encoding,
      
      myleott what do you recommend for above TODOs?
      Pull Request resolved: https://github.com/fairinternal/fairseq-py/pull/771
      
      Reviewed By: myleott
      
      Differential Revision: D16547679
      
      Pulled By: myleott
      
      fbshipit-source-id: 6a6562d9b6215523d048fdf3daee63ffac21e231
      138dc8e4
  2. 24 Jul, 2019 1 commit
    • Spencer Poff's avatar
      check save_dir before beginning training · b49ea81c
      Spencer Poff authored
      Summary: I sadly discovery that my checkpoint directory wasn't globally readable after 8 hours of training. Adding this check at the beginning of train loop to keep that from happening again!
      
      Reviewed By: myleott
      
      Differential Revision: D16455394
      
      fbshipit-source-id: 35959aa058150b2afb63710c468d01ebc8a12b0c
      b49ea81c
  3. 02 Jul, 2019 1 commit
    • Xutai Ma's avatar
      add --max-tokens-valid option for validation · bccfddbb
      Xutai Ma authored
      Summary: Add the max-token-valid option. Sometime a separate max batch tokens for validation may be helpful, for example when there is a long sequence in validation set thats larger than max_tokens (it's rare in MT but could happen in ASR or AST).
      
      Reviewed By: myleott
      
      Differential Revision: D16076951
      
      fbshipit-source-id: ae7f4218594580b9450a8196d7afa1e7e2018aee
      bccfddbb
  4. 30 Jun, 2019 1 commit
  5. 26 Jun, 2019 1 commit
    • Liang Wang's avatar
      FIx dataset loading when there are multiple valid subsets (#835) · 8b514b9f
      Liang Wang authored
      Summary:
      When we have multiple valid subsets, say `valid`, `valid1` and `valid2`, if `combine=True` holds, when loading `valid` subset, it will try to locate and load `valid`, `valid1`, `valid2`... and then combine them into one dataset. Set `combine` to `False` solves this issue.
      
      In my experiment, I have 3 valid subsets with 3000, 5000 and 8701 examples, with argument `--valid-subset valid,valid1,valid2`, the log is as follows:
      
      ```
      ......
      | ./mix_data/bin valid src-trg 3000 examples
      | ./mix_data/bin valid1 src-trg 5000 examples
      | ./mix_data/bin valid2 src-trg 7801 examples
      | ./mix_data/bin valid1 src-trg 5000 examples
      | ./mix_data/bin valid2 src-trg 7801 examples
      ......
      ```
      
      As shown above, `valid1` and `valid2` subsets are incorrectly loaded twice.
      Pull Request resolved: https://github.com/pytorch/fairseq/pull/835
      
      Differential Revision: D16006343
      
      Pulled By: myleott
      
      fbshipit-source-id: ece7fee3a00f97a6b3409defbf7f7ffaf0a54fdc
      8b514b9f
  6. 21 May, 2019 1 commit
  7. 20 May, 2019 2 commits
  8. 17 May, 2019 1 commit
  9. 14 May, 2019 1 commit
    • Dmytro Okhonko's avatar
      Move save/load checkpoint functions to utils · cd1e5c09
      Dmytro Okhonko authored
      Summary:
      Move `load_checkpoint`, `save_checkpoint` and `reload_train` from train.py to checkpoint_utils.py
      Move `get_perplexity` from train.py to utils.py.
      This will make train.py lighter and allow us to reuse all this utils functionality when fairseq is used as external library.
      
      Reviewed By: myleott
      
      Differential Revision: D15289607
      
      fbshipit-source-id: 4b7c95225ac22e402bcda3497811361809110df1
      cd1e5c09
  10. 08 May, 2019 2 commits
    • Myle Ott's avatar
      Cleanup LM + Flake8 · f2563c21
      Myle Ott authored
      Summary: Pull Request resolved: https://github.com/pytorch/fairseq/pull/720
      
      Differential Revision: D15259091
      
      Pulled By: myleott
      
      fbshipit-source-id: 06a35996c06ccddb49fdc9e01e348ff3c9da334e
      f2563c21
    • Jay Mahadeokar's avatar
      bugfix data not in args · 6a7eb6ce
      Jay Mahadeokar authored
      Summary:
      D15214049 introduced a bug such that if a tasks args does not contain data, then it will give error
      ```
      File "/data/users/jaym/fbsource/fbcode/buck-out/dev/gen/deeplearning/projects/fairspeq/train#link-tree/train.py", line 119, in reload_train
         if len(args.data.split(":")) == 1:
      AttributeError: 'Namespace' object has no attribute 'data'
      ```
      
      This diff checks if data is in args to avoid above error.
      
      Reviewed By: myleott, jmp84
      
      Differential Revision: D15253373
      
      fbshipit-source-id: 14fb9ad878ee50f1b7583349bb17e29c03c40815
      6a7eb6ce
  11. 06 May, 2019 1 commit
    • Naman Goyal's avatar
      allowing sharded dataset (#696) · 0add50c2
      Naman Goyal authored
      
      
      Summary:
      Co-authored-by: default avatarmyleott <myleott@fb.com>
      
      Changing `data` to be `str` with colon separated list for loading sharded datasets. This change is useful for loading large datasets that cannot fit into, memory. The large dataset can be sharded and then each shard is loaded in one epoch in roudrobin manner.
      
      For example, if there are `5` shards of data and `10` epochs then the shards will be iterated upon `[0, 1, 2, 3, 4, 0, 1, 2, 3, 4]`.
      
      myleott We need to look into `translation.py` as it currently already expects a list and then concats the datasets.
      Pull Request resolved: https://github.com/pytorch/fairseq/pull/696
      
      Differential Revision: D15214049
      
      fbshipit-source-id: 03e43a7b69c7aefada2ca668abf1eac1969fe013
      0add50c2
  12. 05 May, 2019 2 commits
  13. 04 May, 2019 1 commit
  14. 02 May, 2019 2 commits
  15. 30 Apr, 2019 1 commit
  16. 24 Apr, 2019 1 commit
  17. 15 Apr, 2019 1 commit
    • freewym's avatar
      fix checkpoint timer (#634) · de8aeab5
      freewym authored
      Summary:
      If arg.keep_interval_updates or args.keep_last_epochs > 0, `checkpoints` would refer to a list of checkpoint files to be removed, which can be empty. So moved the logging code to the right position.
      Pull Request resolved: https://github.com/pytorch/fairseq/pull/634
      
      Differential Revision: D14933655
      
      Pulled By: myleott
      
      fbshipit-source-id: 68182ee99d9701e1536833d31e0a7c5d2eb2d679
      de8aeab5
  18. 09 Apr, 2019 1 commit
    • Kartikay Khandelwal's avatar
      Fix save_dir creation while training on multiple nodes (#626) · 94e9d77c
      Kartikay Khandelwal authored
      Summary:
      Pull Request resolved: https://github.com/pytorch/fairseq/pull/626
      
      While training a model on multiple GPUs, the current fairseq train workflow fails while creating the directory from which to load a checkpoint. This seems to be happening because multiple nodes attempt to create the same directory thus causing some weird interaction with os.makedirs option "exist_ok=True". Fixing this by making sure only rank 0 creates this directory.
      
      Reviewed By: myleott
      
      Differential Revision: D14841304
      
      fbshipit-source-id: c9b73ba804de97e2cb19a616189fefce476d8c74
      94e9d77c
  19. 07 Apr, 2019 1 commit
    • Haoran Li's avatar
      move distributed_init after get_batch_iterator · 34028c63
      Haoran Li authored
      Summary: There are constantly wait timeout issue for using multiple nodes, even setting copylocallytempdir:/ doesn't help, eg f105637629. It seems to be working after I moved distributed_init after get_batch_iterator, eg f106520580
      
      Reviewed By: myleott
      
      Differential Revision: D14817769
      
      fbshipit-source-id: edbb101a28d8082241c7bdd8c5500c9dad27647c
      34028c63
  20. 02 Apr, 2019 2 commits
  21. 12 Mar, 2019 1 commit
    • Dmytro Okhonko's avatar
      Handle 3+ dimensional input in sequence_generator + nits · 860010e9
      Dmytro Okhonko authored
      Summary: sequence_generator assumes that model input is 2d tensor of longs. But it can be something like 3d tensor of floats and we should be able to handle this as long as first dimension is batch size followed by source lengths.
      
      Reviewed By: myleott
      
      Differential Revision: D14420044
      
      fbshipit-source-id: bf8b1e42ad1873f7b803c1a377b0af21648db015
      860010e9
  22. 11 Mar, 2019 1 commit
  23. 04 Mar, 2019 1 commit
  24. 26 Feb, 2019 2 commits
  25. 09 Feb, 2019 1 commit
    • Myle Ott's avatar
      Add fairseq to PyPI (#495) · fbd4cef9
      Myle Ott authored
      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
      fbd4cef9
  26. 05 Feb, 2019 1 commit
  27. 30 Jan, 2019 1 commit
    • Myle Ott's avatar
      Do distributed init after data loading · ec6f8ef9
      Myle Ott authored
      Summary:
      FACEBOOK
      
      This switches back to torch.multiprocessing.spawn, instead of directly calling fb_train.par using a subprocess.Process. This has the advantage that exceptions are propagated properly. It also moves the distributed_init part to happen after data loading, which gets around the timeout issue.
      
      The downside of this approach is that it's not so easy to pipe stdout to multiple places, which was nice when using the sweep.py scripts. I'm still working on a fix for that.
      
      Reviewed By: rutyrinott, ngoyal2707
      
      Differential Revision: D13873224
      
      fbshipit-source-id: 08d593233b8d23590c01c723363630a79804a8b0
      ec6f8ef9
  28. 25 Jan, 2019 1 commit
  29. 24 Jan, 2019 1 commit
  30. 16 Jan, 2019 1 commit
    • Davide Caroselli's avatar
      FIX: '--user-dir' on multi-gpu (#449) · 7853818c
      Davide Caroselli authored
      Summary:
      On a multi-gpu training scenario, the `train.py` script spawns new processes with `torch.multiprocessing.spawn`. Unfortunately those child processes don't inherit the modules imported with `--user-dir`.
      
      This pull request fixes this problem: custom module import in now explicit on every `main()` function.
      Pull Request resolved: https://github.com/pytorch/fairseq/pull/449
      
      Differential Revision: D13676922
      
      Pulled By: myleott
      
      fbshipit-source-id: 520358d66155697885b878a37e7d0484bddbc1c6
      7853818c
  31. 09 Jan, 2019 1 commit
  32. 05 Jan, 2019 1 commit
  33. 28 Dec, 2018 1 commit
  34. 07 Dec, 2018 1 commit
    • Halil Akin's avatar
      Take a dummy train step under OOM to keep multiprocessing in sync · 6c006a34
      Halil Akin authored
      Summary: This is not a guaranteed solution (since processes may still get out of sync if OOM happens after an all_gather/all_reduce has been done) - but should still make multiprocessing training more robust in practice since it seems we usually OOM early enough.
      
      Reviewed By: myleott
      
      Differential Revision: D13086018
      
      fbshipit-source-id: feb1b01c2eb8818797cfdabc0faac8056ba1b4ee
      6c006a34