[go: up one dir, main page]

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

flashlight Consolidation #146

Merged
merged 478 commits into from
Aug 21, 2020
Merged

flashlight Consolidation #146

merged 478 commits into from
Aug 21, 2020

Conversation

tlikhomanenko
Copy link
Contributor
@tlikhomanenko tlikhomanenko commented Aug 19, 2020

Reorganizing flashlight structure / components

Summary

  • moving https://github.com/facebookresearch/wav2letter history into flashlight
  • moving wav2letter folder into app/asr with fl::app::asr namespace
  • moving TDS and SpecAug layers from wav2letter into flashlight/contrib/ (serialization of TDS models and models with SpecAug layer now is broken)
  • moving wav2letter/src/libraries into lib, create its correspondent namespace fl::lib:
    • move featurization to audio folder with namespace fl::lib::audio
    • move decoder into text with namespace fl::lib::text
    • move asg criterion into sequence with namespace fl::lib::seq
  • create ext with namespace fl::ext for extensions to the core flashlight (like some distributed helper functions, additional functionality of arrayfire, etc.)
  • consistent structure of tests: folder test and mirroring structure of repo for tests
  • fixing cmake accordingly

Test Plan

Docker build is working, test passed there. CI is fixed too with new base images.

Wei-Ning Hsu and others added 30 commits August 23, 2019 16:39
Summary:
1. speed up beamSearch() in Seq2SeqCriterion by batching the beam for decodeStep()
2. experimental/lmAnalysis supports decoding with ASR or ASR+LM, and compute LM scores of the targets and the hypotheses
3. experimental/localPriorMatch includes complete codes for local prior match (regular/reverse KL) and ablation studies
4. experimental/localPriorMatchOss removes debugging messages and ablation studies from experimental/localPriorMatch for open sourcing
5. create a modified copy of Serialize in order to support serializing regular LMs (taking token IDs as input) and LMCritics (taking probability vectors as input)
Pull Request resolved: fairinternal/wav2letter#2

Reviewed By: jacobkahn

Differential Revision: D16967394

Pulled By: an918tw

fbshipit-source-id: 7418b85603f8b68d1ad6c02a8b92a855e20b1a26
Summary:
Removed <eos> in the end of prediction in `beamSearch` so that the beampath will have the same behavior as viterbi path when beamsize = 1. Also fixed some clang format issue in `Seq2SeqCriterion`.

**Facebook:** Also updated some functions under `experimental/` to make sure local prior match experiments will still run the same. Edited `TARGETS` files so that we can correctly build all binaries for running local prior match experiments on the FB cluster. (Decided not to fix the clang format under `experimental/localPriorMatch*` for now, since that'll involve many lines of changes and make this diff harder to review. We will clean up things there in the future when preparing for oss release.)

Reviewed By: jacobkahn

Differential Revision: D16996677

fbshipit-source-id: bee545f507db5e0fde219fcbdfdb400af4e05063
Summary:
Breaks devfair build
Pull Request resolved: flashlight/wav2letter#380

Reviewed By: jacobkahn

Differential Revision: D17000125

Pulled By: vineelpratap

fbshipit-source-id: ecdd7bb639f082a049a4104a7b915501618a6313
Summary:
Extend the functionality of seq2seq criterion to enhance performance.
- Number of RNN layers
- RNN dropout
- Number of attention round, following https://arxiv.org/pdf/1904.11660.pdf

Reviewed By: an918tw

Differential Revision: D16845587

fbshipit-source-id: a9d23d6e1d1804be3d9be39c6d57479e630971f4
Summary:
URL encode paths to models with `+` in the name

Fix link to paper pages from top-level READMEs

Fixes flashlight/wav2letter#387

Reviewed By: tlikhomanenko

Differential Revision: D17094016

fbshipit-source-id: bc188bf9b8e16d19b57f595c7fb302782a8fcdf6
…aths stored in the models

Summary:
Fixes for the issues flashlight/wav2letter#389 and flashlight/wav2letter#390
- add tokens, lexicon and data paths to overwrite those flags from the models in decoder configs
- fix encoding while reading a file generated by the wordpiece library
- adding `--minloglevel=0` flag in docs for runing in the docker to have full log printed on the screen
- remove `--listdata` flag

Reviewed By: vineelpratap

Differential Revision: D17103073

fbshipit-source-id: 574a1161b805185f5179e28a7383ccf9e1c859a2
Summary:
Adding one flag `uselexicon` to help select decoder type.
Since we recently converged to use `listdataset` in all cases, previous hacky selection way (using flag `lexicon`) is no longer feasible.

Reviewed By: vineelpratap, tlikhomanenko

Differential Revision: D17117951

fbshipit-source-id: 03d5d4433741a449749ea67cc41540b3d39380d3
Summary: Support both clang and gcc

Reviewed By: jacobkahn

Differential Revision: D16192971

fbshipit-source-id: 3bfb68ca31dc7226f96de31e5974a57fce933ff6
Summary:
ATLAS `cblas.h` doesn't wrap its stuff in `#ifdef __cplusplus extern "C" {` whereas OpenBLAS and MKL BLAS do. This causes linker issues when including ATLAS `cblas.h`. Fix this by wrapping it in `extern "C"` ourselves.

This should fix building with ATLAS while leaving OpenBLAS and MKL builds unchanged.

Reviewed By: vineelpratap

Differential Revision: D17123062

fbshipit-source-id: b945e7ead4a191edac7e4f1a644ed4c838934575
Summary:
In order to foster healthy open source communities, we're adopting the
[Contributor Covenant](https://www.contributor-covenant.org/). It has been
built by open source community members and represents a shared understanding of
what is expected from a healthy community.

Reviewed By: josephsavona, danobi, rdzhabarov

Differential Revision: D17104640

fbshipit-source-id: d210000de686c5f0d97d602b50472d5869bc6a49
Summary:
- fix with respect to commit 5a5d731 (uselexicon is not fixed in one place in that commit)
- update docs

Reviewed By: xuqiantong

Differential Revision: D17134351

fbshipit-source-id: b64e39c2f4d9b50744ad029ce1bc9de0b6a4a66c
Summary:
- remove deprecated flag `listdata` from training configs in recipes
- fix paths to WSJ discs in the READMEs

Reviewed By: an918tw

Differential Revision: D17169285

fbshipit-source-id: 58ee962c759b3b99f06615a6b0c5de3937172d0b
Summary:
Thanks an918tw for pointing this bug introduced in 1545c7e.

Preserve ordering of spellings in lexicon (as in the original paper).
- During training we sample spelling taking mostly the first segmentaiton.
- This affects for the total length of the sequence

Reviewed By: an918tw

Differential Revision: D17188028

fbshipit-source-id: 49f6a927ef85ca93338895034da9f076fe298d7e
Summary: title

Reviewed By: an918tw

Differential Revision: D17187418

fbshipit-source-id: e21a49b519cdc1f0106334cacbfe022438240d40
Summary: Remove restrictions on dtype, device, contiguous in ASGLoss. Provided tensors will now be automatically cast to the correct dtype/device and ensured contiguous.

Reviewed By: vineelpratap

Differential Revision: D17127212

fbshipit-source-id: 5d6efcc17e78c8cbd3d6c489ad605c38caf40f16
Summary:
- rename scripts -> utilities (for open source cycle)
- releasing the script for official Librispeech LM and fixing the path to prepare LM (fixes for issue flashlight/wav2letter#398)
- fixing kenlm command for conv_glu/wsj recipe

Reviewed By: jacobkahn

Differential Revision: D17264456

fbshipit-source-id: 7dba908db9e28c14e0a94dc1cba5b95bd05a8293
Summary:
All steps and pre-trained models to reproduce paper [Who Needs Words? Lexicon-Free Speech Recognition](https://arxiv.org/abs/1904.04479)
- data preparation
- architectures for acoustic models and ConvLMs
- training parameters and learninig rate schedules
- decoding configs
- evaluation of upper and lower bounds on word perplexity for character-level language models.

Reviewed By: syhw

Differential Revision: D16807964

fbshipit-source-id: 1f3fbdc151ad25b2bbe123c98f431da7294dd3df
Summary: Pull Request resolved: flashlight/wav2letter#399

Reviewed By: jacobkahn

Differential Revision: D17345944

Pulled By: xuqiantong

fbshipit-source-id: d6360d965e369008fb2ab17bd89073c553851e45
Summary:
- fix cmake in Dockerfiles: `DW2L_CRITERION_BACKEND` -> `W2L_LIBRARIES_USE_CUDA`
- add more docs on arch

Reviewed By: jacobkahn

Differential Revision: D17348466

fbshipit-source-id: fc72492521299c10c13346cc8f8bf0664c10c14b
…kend

Summary:
- change base CUDA image (change kenlm build, add python libs and openblas deps)
- add python bindings installation inside main CUDA dockerfile

Reviewed By: jcai1

Differential Revision: D17360397

fbshipit-source-id: 011047f4100549c3a9c8e2a04b833cffb8137a41
Summary:
- fix "+" to "%2B" in the file name for acoustic model
Pull Request resolved: flashlight/wav2letter#408

Differential Revision: D17552215

Pulled By: an918tw

fbshipit-source-id: 35e982ee676acd49f5ca2c06501684d92f65608b
Summary:
This line throws an error "IndexError: tuple index out of range" in python3.6.

Presumably a different version of python was originally used which didn't have this error.
Pull Request resolved: flashlight/wav2letter#409

Differential Revision: D17572324

Pulled By: an918tw

fbshipit-source-id: f31ade8b08b207bf8f9e0063e5f9127a02f2628e
Summary:
Hello! Thank you for excellent library!

When I was running train flow for the first time according to examples from https://github.com/facebookresearch/wav2letter/blob/master/docs/train.md - everything was looking fine, everything started, in logs as well everything was good at the start - arch loaded, nothing failed. And I left it to train for a night. I was surprised in the morning when I found out (reading source code) that I failed to provide list file path and provided directory path in `--train` flag, and it was silently ignored. My model trained whole night with 0 examples; it did 20k+ epochs successfully with zero loss and everything.

I want to change README a bit and to throw an error if no examples found.
Pull Request resolved: flashlight/wav2letter#411

Differential Revision: D17590810

Pulled By: an918tw

fbshipit-source-id: 11772ee859eef8834d2e8c60af54b4c8d5e160e9
Summary: cosine lr schedule for w2l.

Reviewed By: VitaliyLi, jacobkahn

Differential Revision: D17669680

fbshipit-source-id: 78d9bb2a1e4999dbe907f7e16289fe5b4e54d504
Summary:
Implement the multihead attention as described in [1] with some variations.
* If `keyValue == true`, we split the encoder output into key & value separately.
* If `keyValue == false`, we use the full encoder output as the basis for both key & value.
* If `splitInput == false`, we apply `numHeads` linear transforms on the full query (from state), key, and value to generate multiple (query, key, vector) sets for computing attention.
* If `splitInput == true`, we split the query, key, and value into `numHeads` segments to generate multiple (query, key, vector) sets for computing attention.

In total four modes, i.e. four different (`keyValue`, `splitInput`) combinations, are supported.

**Note: at this moment multihead attention doesn't work with some existing modules due to their respective assumptions.**
Some examples are:
* `Seq2SeqCriterion::decodeBatchStep`
* `MedianWindow`

[1] Vaswani, Ashish, et al. "Attention is all you need." Advances in Neural Information Processing Systems. 2017.

Reviewed By: xuqiantong, awni

Differential Revision: D14731210

fbshipit-source-id: f8516f6172b9dee56bfc24d103d51cb939f55c9c
Summary:
When using wav2letter inside another project, CMAKE_SOURCE_DIR
corresponds to the top-level of the entire project, which is not
wav2letter's top-level! PROJECT_SOURCE_DIR corresponds to the
directory where the project() was last called, which should always
correspond to wav2letter's top-level directory.
Pull Request resolved: flashlight/wav2letter#432

Reviewed By: vineelpratap

Differential Revision: D18162911

Pulled By: jacobkahn

fbshipit-source-id: ab5a0785f9d3285dcc16a6734b5cc21fa75c635c
Summary:
When building gflags from source with either --config debug or
CMAKE_BUILD_TYPE=Debug, gflags's library will be libgflags_debug.a,
instead of libgflags.a. This change allows the wav2letter build to
find that library successfully.

Source:

https://github.com/gflags/gflags/blob/0b7f8db2c6b1b0b2451da0923a9ab09cc610e8d1/CMakeLists.txt#L412
Pull Request resolved: flashlight/wav2letter#433

Reviewed By: vineelpratap

Differential Revision: D18162909

Pulled By: jacobkahn

fbshipit-source-id: 2c5f90a70adb4ea21c4aafbd91da15cadbdf7141
Summary:
Adds support for Memcache to cache Everstore handles and ranges in front of `W2lEverstoreReader`, and adds `--use_memcache` for internal runs, which queries the `datatype::MemcacheDataType` accordingly.

Cache lookups are only supports cache lookups for single handles - doesn't support multi-handle lookup. There's apparently no benefit to batch lookups in the cache, so we'll stick with this for now (this is also what `W2lEverstoreReader` expects, since each thread reads a handle.

We'll do some diagnostics/performance analysis before landing and after D17865315 is committed.

### Cache Keys

If the key has an offset and a length:
```
wav2letter:<everstore handle>:<audio offset>:<audio length>:c1
```
if the key has no offset/length:
```
wav2letter:audio:<everstore handle>:c1
```

Since we'll never read overlapping regions of audio from Everstore or the cache (everything is disjoint), it's most efficient to cache the range read from Everstore using a key that's range-aware, since that's how we'll interact with that data in the future.

Reviewed By: edenzik

Differential Revision: D17865397

fbshipit-source-id: e4d4891e8b9f95846b0768116848ef95cace4328
Summary: warp-ctc works only for label length < 639 and throws "unknown_error" if the label length is larger than that. Throw a more readable error in this case.

Reviewed By: xuqiantong

Differential Revision: D18343656

fbshipit-source-id: 897f8ab1618129a02e7a3142f1bbf192a5ebe6a4
Summary: Decoder: accumulate scores in double.

Reviewed By: jacobkahn

Differential Revision: D18716957

fbshipit-source-id: a35e2eefe99a00a68cc5dd5e7eecc0bf9cf17921
@facebook-github-bot facebook-github-bot added the CLA Signed Do not delete this pull request or issue due to inactivity. label Aug 19, 2020
@jacobkahn jacobkahn changed the title History move flashlight Consolidation Aug 20, 2020
tlikhomanenko pushed a commit to flashlight/wav2letter that referenced this pull request Aug 20, 2020
- move w2l history into flahslight
- reorganize structure there
- preserve in current repo only recipes (will revisit them a bit later)
@jacobkahn jacobkahn merged commit cc7f807 into master Aug 21, 2020
@jacobkahn jacobkahn deleted the history_move branch December 28, 2020 18:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed Do not delete this pull request or issue due to inactivity. fh:direct-merge-enabled
Projects
None yet
Development

Successfully merging this pull request may close these issues.