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

merging main to asr_normalize #6676

Merged
merged 62 commits into from
May 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
d4711c4
Add FastConformer Hybrid ASR models for EN, ES, IT, DE, PL, HR, UA, B…
github-actions[bot] May 4, 2023
46bc357
Add scores for FastConformer models (#6557) (#6558)
github-actions[bot] May 4, 2023
f495887
Fix fp16 (#6543) (#6544)
github-actions[bot] May 4, 2023
fa2de0a
Patch transcribe and support offline transcribe for hybrid model (#65…
github-actions[bot] May 4, 2023
8d1901b
Fix notebook bad json (#6561)
titu1994 May 4, 2023
bbeabca
Change Megatron Enc Dec model to use persistent_workers (#6548) (#6552)
github-actions[bot] May 4, 2023
76ee4c3
Make KenLM with PC for AggregateTokenizer and merge it (#6081)
karpnv May 4, 2023
6593652
temp rtd fix (#6568) (#6569)
github-actions[bot] May 4, 2023
7e0ab3f
[TTS] Add script for mapping speaker names to indices (#6509)
rlangman May 5, 2023
0084c04
whitespace (#6574)
karpnv May 5, 2023
fd6c75e
Update manifest.py for speedup (#6565) (#6573)
github-actions[bot] May 5, 2023
f1a3e75
More streaming conformer export fixes (#6567) (#6578)
github-actions[bot] May 5, 2023
84cdcb6
user selected max_seq_len should be less than model's max_seq_len (#6…
github-actions[bot] May 5, 2023
3161c61
Framework for PEFT via mixins (#6391)
arendu May 5, 2023
da6bbec
cache and reuse inputs (#6422) (#6452)
github-actions[bot] May 7, 2023
1d813a3
Add patches for Virtual Parallel conversion (#6589)
titu1994 May 8, 2023
0d17944
Pass `.scale` instead of scaler object to core (#6551)
github-actions[bot] May 8, 2023
292e100
Documentation for ASR-TTS models (#6594) (#6595)
github-actions[bot] May 8, 2023
588dbe1
[TTS] Fix aligner nan loss in fp32 (#6435)
hsiehjackson May 8, 2023
e781b4d
Update SDP docs (#6485) (#6596)
github-actions[bot] May 8, 2023
c3deeac
Bug/typo fixes (#6599)
Kipok May 9, 2023
06b0d34
Manual garbage collection with an interval (#6469) (#6482)
github-actions[bot] May 9, 2023
24c7b4b
Make tensor split contiguous (#6580) (#6593)
github-actions[bot] May 9, 2023
4920333
[ASR] Fix for old models in change_attention_model (#6608)
sam1373 May 10, 2023
fa89ba5
Update manifest.py to use os.path for get_full_path (#6598)
stevehuang52 May 10, 2023
f7989f7
Cherry pick commits in #6601 to main (#6611)
fayejf May 10, 2023
2f8c1f0
Create dummy iters to satisy len checks (#6600) (#6603)
github-actions[bot] May 10, 2023
2eb0d75
add GPT eval mode fix for interleaved to main (#6610)
aklife97 May 10, 2023
c21f299
Fix batch size reconf for T5 FT for multi-validation (#6582) (#6588)
github-actions[bot] May 10, 2023
e6ee331
Not doing CastToFloat by default (#6524) (#6563)
github-actions[bot] May 10, 2023
13e7ddb
Turn autocast off when precision is fp32 (#6576)
github-actions[bot] May 10, 2023
5e6705f
update core commit hash in readme (#6622) (#6623)
github-actions[bot] May 10, 2023
ca9cbbb
add hat image to docs (#6619) (#6621)
github-actions[bot] May 11, 2023
1d80c62
Allow indices exchange via distributed (#6618) (#6624)
github-actions[bot] May 11, 2023
3fb6b87
Offline and streaming inference support for hybrid model (#6570)
fayejf May 11, 2023
0ccb944
Patch decoding for PC models (#6630) (#6631)
github-actions[bot] May 11, 2023
8cd5ed6
Fix wer.py where 'errors' variable was not set (#6633) (#6634)
github-actions[bot] May 11, 2023
4d8651d
Restore GPT support for interleaved pipeline parallelism (#6528) (#6613)
timmoon10 May 11, 2023
dfb61eb
bugfix (#6636)
fayejf May 11, 2023
149f02f
Disable interctc tests (#6638)
Kipok May 11, 2023
a7b4de2
Add megatron_core to requirements (#6639) (#6640)
github-actions[bot] May 11, 2023
32bea29
Remove from jenkins (#6642)
github-actions[bot] May 11, 2023
f8e46a9
sft model can use this script for eval (#6637)
arendu May 12, 2023
232f9de
[TTS] Fix TTS audio preprocessing bugs (#6628)
rlangman May 12, 2023
2b4e946
Move black parameters to pyproject.toml (#6647)
artbataev May 12, 2023
58b2160
ASR-TTS Models: Support hybrid RNNT-CTC, improve docs. (#6620)
artbataev May 12, 2023
88816f0
fix conversion and eval (#6648)
arendu May 13, 2023
9b9ed6e
Confidence ensembles implementation (#6614)
Kipok May 15, 2023
90156b1
Patch memory used for NeMo Megatron models (#6615)
titu1994 May 15, 2023
cfff834
handle artifacts when path is dir (#6658)
arendu May 16, 2023
609c7b7
remove upgrading setuptools in reinstall.sh (#6659)
XuesongYang May 16, 2023
623c37e
merge lora weights into base model (#6597)
arendu May 16, 2023
d810e1b
upgrade to 23.04 (#6660)
ericharper May 16, 2023
fa3dca7
Merge r1.18.0 bugfixes and doc updates to main (#6655)
ericharper May 16, 2023
e199549
Confidence ensembles: fix issues and add tuning functionality (#6657)
Kipok May 16, 2023
29c8ac3
[TTS] Implement new TextToSpeech dataset (#6575)
rlangman May 16, 2023
78e5a2e
Dialogue dataset (#6654)
yidong72 May 16, 2023
1a34379
Add support for RNNT/hybrid models to partial transcribe (#6609)
stevehuang52 May 16, 2023
e9fcc41
eval_beamsearch_ngram.py with hybrid ctc (#6656)
karpnv May 17, 2023
78fe893
fix bucketing bug issue for picking new bucket (#6663)
nithinraok May 17, 2023
8aa80ee
minor fix for missing chat attr (#6671)
arendu May 18, 2023
4c6e2bc
[TTS] Add callback for saving audio during FastPitch training (#6665)
rlangman May 18, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,4 @@ repos:
hooks:
- id: black
name: Format code
args: [--skip-string-normalization, --line-length=119]
additional_dependencies: ['click==8.0.2']
9 changes: 2 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

ARG BASE_IMAGE=nvcr.io/nvidia/pytorch:23.03-py3
ARG BASE_IMAGE=nvcr.io/nvidia/pytorch:23.04-py3

# build an image that includes only the nemo dependencies, ensures that dependencies
# are included first for optimal caching, and useful for building a development
Expand Down Expand Up @@ -43,11 +43,6 @@ RUN apt-get update && \
rm -rf /var/lib/apt/lists/*

WORKDIR /workspace/
# Install Megatron-core
RUN git clone https://github.com/NVIDIA/Megatron-LM.git && \
cd Megatron-LM && \
git checkout 3db2063b1ff992a971ba18f7101eecc9c4e90f03 && \
pip install -e .

WORKDIR /tmp/
# TODO: Remove once this Apex commit (2/24/23) is included in PyTorch
Expand Down Expand Up @@ -94,7 +89,7 @@ COPY . .

# start building the final container
FROM nemo-deps as nemo
ARG NEMO_VERSION=1.18.0
ARG NEMO_VERSION=1.19.0

# Check that NEMO_VERSION is set. Build will fail without this. Expose NEMO and base container
# version information as runtime environment variable for introspection purposes
Expand Down
58 changes: 24 additions & 34 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
pipeline {
agent {
docker {
image 'pytorch_23.03:apex_57057e2fcf1c084c0fcc818f55c0ff6ea1b24ae2'
args '--device=/dev/nvidia0 --gpus all --user 0:128 -v /home/TestData:/home/TestData -v $HOME/.cache:/root/.cache --shm-size=8g'
image 'nvcr.io/nvidia/pytorch:23.04-py3'
args '--device=/dev/nvidia0 --gpus all --user 0:128 -v /home/TestData:/home/TestData -v $HOME/.cache:/root/.cache --shm-size=8g --env TRANSFORMERS_OFFLINE=1'
}
}
options {
Expand Down Expand Up @@ -57,16 +57,6 @@ pipeline {
}
}

// TODO: remove when pip package is available
stage('Megatron Core installation') {
steps {
sh 'git clone https://github.com/NVIDIA/Megatron-LM.git && \
cd Megatron-LM && \
git checkout 3db2063b1ff992a971ba18f7101eecc9c4e90f03 && \
pip install -e .'
}
}

stage('PyTorch Lightning version') {
steps {
sh 'python -c "import pytorch_lightning; print(pytorch_lightning.__version__)"'
Expand Down Expand Up @@ -1014,7 +1004,7 @@ pipeline {
// TODO: pleasefixme @redoctopus
// stage('ByT5G2P training, evaluation and inference') {
// steps {
// sh 'TRANSFORMERS_OFFLINE=0 && cd examples/tts/g2p && \
// sh 'TRANSFORMERS_OFFLINE=1 && cd examples/tts/g2p && \
// TIME=`date +"%Y-%m-%d-%T"` && OUTPUT_DIR_T5=output_byt5_${TIME} && \
// python g2p_train_and_evaluate.py \
// train_manifest=/home/TestData/g2p/g2p.json \
Expand Down Expand Up @@ -1158,7 +1148,7 @@ pipeline {
parallel {
stage('Dialogue: Intent and slot classification using GPT') {
steps {
sh 'TRANSFORMERS_OFFLINE=0 && cd examples/nlp/dialogue && \
sh 'TRANSFORMERS_OFFLINE=1 && cd examples/nlp/dialogue && \
python dialogue.py \
model.dataset.data_dir=/home/TestData/nlp/sgd_small \
model.language_model.lm_checkpoint=/home/TestData/nlp/gpt2/pytorch_model.bin\
Expand All @@ -1185,7 +1175,7 @@ pipeline {
}
stage('Intent and slot classification using SGDQA') {
steps {
sh 'TRANSFORMERS_OFFLINE=0 && cd examples/nlp/dialogue && \
sh 'TRANSFORMERS_OFFLINE=1 && cd examples/nlp/dialogue && \
python dialogue.py \
model.dataset.data_dir=/home/TestData/nlp/sgd_small \
model.dataset.dialogues_example_dir=sgd_gen_bert_outputs \
Expand All @@ -1208,7 +1198,7 @@ pipeline {
}
stage('Intent and slot classification using IntentSlotClassificationModel') {
steps {
sh 'TRANSFORMERS_OFFLINE=0 && cd examples/nlp/dialogue && \
sh 'TRANSFORMERS_OFFLINE=1 && cd examples/nlp/dialogue && \
python dialogue.py \
model.dataset.data_dir=/home/TestData/nlp/processed_assistant \
model.dataset.dialogues_example_dir=sgd_gen_bert_intent_classification_outputs \
Expand All @@ -1230,7 +1220,7 @@ pipeline {
}
stage('Intent classification using ZeroShotIntentModel') {
steps {
sh 'TRANSFORMERS_OFFLINE=0 && cd examples/nlp/dialogue && \
sh 'TRANSFORMERS_OFFLINE=1 && cd examples/nlp/dialogue && \
python dialogue.py \
do_training=False \
model.dataset.data_dir=/home/TestData/nlp/drive_thru_revised \
Expand All @@ -1255,7 +1245,7 @@ pipeline {
}
stage('Design Intent classification using ZeroShotIntentModel') {
steps {
sh 'TRANSFORMERS_OFFLINE=0 && cd examples/nlp/dialogue && \
sh 'TRANSFORMERS_OFFLINE=1 && cd examples/nlp/dialogue && \
python dialogue.py \
do_training=False \
model.dataset.data_dir=/home/TestData/nlp/design_dataset \
Expand All @@ -1281,7 +1271,7 @@ pipeline {
}
stage('Design Intent classification using ZeroShotIntentModel BART Classifier') {
steps {
sh 'TRANSFORMERS_OFFLINE=0 && cd examples/nlp/dialogue && \
sh 'TRANSFORMERS_OFFLINE=1 && cd examples/nlp/dialogue && \
python dialogue.py \
do_training=False \
model.dataset.data_dir=/home/TestData/nlp/design_dataset \
Expand All @@ -1300,7 +1290,7 @@ pipeline {
}
stage('Design Intent classification using DialogueNearestNeighbourModel') {
steps {
sh 'TRANSFORMERS_OFFLINE=0 && cd examples/nlp/dialogue && \
sh 'TRANSFORMERS_OFFLINE=1 && cd examples/nlp/dialogue && \
python dialogue.py \
do_training=False \
model.dataset.data_dir=/home/TestData/nlp/design_dataset \
Expand Down Expand Up @@ -1329,7 +1319,7 @@ pipeline {
parallel {
stage('Dialogue: Answer Extender using DialogueS2SGenerationModel') {
steps {
sh 'TRANSFORMERS_OFFLINE=0 && cd examples/nlp/dialogue && \
sh 'TRANSFORMERS_OFFLINE=1 && cd examples/nlp/dialogue && \
python dialogue.py \
do_training=False \
model.dataset.data_dir=/home/TestData/nlp/ms-marco-qa \
Expand All @@ -1354,7 +1344,7 @@ pipeline {
}
stage('Dialogue: SGD Based Answer Extender using DialogueS2SGenerationModel') {
steps {
sh 'TRANSFORMERS_OFFLINE=0 && cd examples/nlp/dialogue && \
sh 'TRANSFORMERS_OFFLINE=1 && cd examples/nlp/dialogue && \
python dialogue.py \
do_training=False \
model.dataset.data_dir=/home/TestData/nlp/sgd_small \
Expand Down Expand Up @@ -1395,7 +1385,7 @@ pipeline {
// parallel {
// stage('Dialogue: Answer Extender using DialogueGPTGenerationModel') {
// steps {
// sh 'TRANSFORMERS_OFFLINE=0 && cd examples/nlp/dialogue && \
// sh 'TRANSFORMERS_OFFLINE=1 && cd examples/nlp/dialogue && \
// python dialogue.py \
// do_training=False \
// model.dataset.data_dir=/home/TestData/nlp/ms-marco-qa \
Expand Down Expand Up @@ -1425,7 +1415,7 @@ pipeline {
parallel {
stage('Dialogue: Answer Extender using DialogueGPTGenerationModel') {
steps {
sh 'TRANSFORMERS_OFFLINE=0 && cd examples/nlp/dialogue && \
sh 'TRANSFORMERS_OFFLINE=1 && cd examples/nlp/dialogue && \
python dialogue.py \
do_training=False \
model.dataset.data_dir=/home/TestData/nlp/ms-marco-qa \
Expand Down Expand Up @@ -1549,7 +1539,7 @@ pipeline {
stage('BERT SQUAD 1.1') {
// Cannot do fast_dev_run because squad needs whole dev dataset
steps {
sh 'TRANSFORMERS_OFFLINE=0 && cd examples/nlp/question_answering && \
sh 'TRANSFORMERS_OFFLINE=1 && cd examples/nlp/question_answering && \
python question_answering.py \
model.train_ds.file=/home/TestData/nlp/squad_mini/v1.1/train-v1.1.json \
model.dataset.use_cache=false \
Expand All @@ -1574,7 +1564,7 @@ pipeline {
stage('BERT SQUAD 2.0') {
// Cannot do fast_dev_run because squad needs whole dev dataset
steps {
sh 'TRANSFORMERS_OFFLINE=0 && cd examples/nlp/question_answering && \
sh 'TRANSFORMERS_OFFLINE=1 && cd examples/nlp/question_answering && \
python question_answering.py \
model.train_ds.file=/home/TestData/nlp/squad_mini/v2.0/train-v2.0.json \
model.dataset.use_cache=false \
Expand Down Expand Up @@ -1608,7 +1598,7 @@ pipeline {
stage('BART SQUAD 1.1') {
// Cannot do fast_dev_run because squad needs whole dev dataset
steps {
sh 'TRANSFORMERS_OFFLINE=0 && cd examples/nlp/question_answering && \
sh 'TRANSFORMERS_OFFLINE=1 && cd examples/nlp/question_answering && \
python question_answering.py \
model.train_ds.file=/home/TestData/nlp/squad_mini/v1.1/train-v1.1.json \
model.dataset.use_cache=false \
Expand All @@ -1634,7 +1624,7 @@ pipeline {
stage('BART SQUAD 2.0') {
// Cannot do fast_dev_run because squad needs whole dev dataset
steps {
sh 'TRANSFORMERS_OFFLINE=0 && cd examples/nlp/question_answering && \
sh 'TRANSFORMERS_OFFLINE=1 && cd examples/nlp/question_answering && \
python question_answering.py \
model.train_ds.file=/home/TestData/nlp/squad_mini/v2.0/train-v2.0.json \
model.dataset.use_cache=false \
Expand Down Expand Up @@ -1669,7 +1659,7 @@ pipeline {
stage('GPT2 SQUAD 1.1') {
// Cannot do fast_dev_run because squad needs whole dev dataset
steps {
sh 'TRANSFORMERS_OFFLINE=0 && cd examples/nlp/question_answering && \
sh 'TRANSFORMERS_OFFLINE=1 && cd examples/nlp/question_answering && \
python question_answering.py \
model.train_ds.file=/home/TestData/nlp/squad_mini/v1.1/train-v1.1.json \
model.dataset.use_cache=false \
Expand All @@ -1695,7 +1685,7 @@ pipeline {
stage('GPT2 SQUAD 2.0') {
// Cannot do fast_dev_run because squad needs whole dev dataset
steps {
sh 'TRANSFORMERS_OFFLINE=0 && cd examples/nlp/question_answering && \
sh 'TRANSFORMERS_OFFLINE=1 && cd examples/nlp/question_answering && \
python question_answering.py \
model.train_ds.file=/home/TestData/nlp/squad_mini/v2.0/train-v2.0.json \
model.dataset.use_cache=false \
Expand Down Expand Up @@ -3809,8 +3799,8 @@ assert_frame_equal(training_curve, gt_curve, rtol=1e-3, atol=1e-3)"'''
stage('L2: Megatron T5 with KERPLE Pretraining and Resume Training TP=2') {
when {
anyOf {
branch 'r1.18.0'
changeRequest target: 'r1.18.0'
branch 'main'
changeRequest target: 'main'
}
}
failFast true
Expand Down Expand Up @@ -4016,7 +4006,7 @@ assert_frame_equal(training_curve, gt_curve, rtol=1e-3, atol=1e-3)"'''
sh "rm -rf examples/nlp/language_modeling/t5_index_mappings"
}
}

stage('L2: Megatron T5 Prompt Learning TP1 PP1') {
when {
anyOf {
Expand Down Expand Up @@ -4101,7 +4091,7 @@ assert_frame_equal(training_curve, gt_curve, rtol=1e-3, atol=1e-3)"'''
}
}
}

// TODO: add when https://github.com/NVIDIA/apex/pull/1596 is merged
// stage('L2: Megatron T5 Prompt Learning TP1 PP2') {
// when {
Expand Down
18 changes: 5 additions & 13 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ Key Features
* `Text Processing (text normalization and inverse text normalization) <https://docs.nvidia.com/deeplearning/nemo/user-guide/docs/en/main/nlp/text_normalization/intro.html>`_
* `CTC-Segmentation tool <https://docs.nvidia.com/deeplearning/nemo/user-guide/docs/en/main/tools/ctc_segmentation.html>`_
* `Speech Data Explorer <https://docs.nvidia.com/deeplearning/nemo/user-guide/docs/en/main/tools/speech_data_explorer.html>`_: a dash-based tool for interactive exploration of ASR/TTS datasets
* `Speech Data Processor <https://docs.nvidia.com/deeplearning/nemo/user-guide/docs/en/stable/tools/speech_data_processor.html>`_


Built for speed, NeMo can utilize NVIDIA's Tensor Cores and scale out training to multiple GPUs and multiple nodes.
Expand Down Expand Up @@ -235,8 +236,8 @@ Note that RNNT requires numba to be installed from conda.

NeMo Megatron
~~~~~~~~~~~~~
NeMo Megatron training requires NVIDIA Apex and Megatron-core to be installed.
Install them manually if not using the NVIDIA PyTorch container.
NeMo Megatron training requires NVIDIA Apex to be installed.
Install it manually if not using the NVIDIA PyTorch container.

To install Apex, run

Expand All @@ -247,15 +248,6 @@ To install Apex, run
git checkout 57057e2fcf1c084c0fcc818f55c0ff6ea1b24ae2
pip install -v --disable-pip-version-check --no-cache-dir --global-option="--cpp_ext" --global-option="--cuda_ext" --global-option="--fast_layer_norm" --global-option="--distributed_adam" --global-option="--deprecated_fused_adam" ./

To install Megatron-core, run

.. code-block:: bash

git clone https://github.com/NVIDIA/Megatron-LM.git
cd Megatron-LM
git checkout 3db2063b1ff992a971ba18f7101eecc9c4e90f03
pip install -e .

It is highly recommended to use the NVIDIA PyTorch or NeMo container if having issues installing Apex or any other dependencies.

While installing Apex, it may raise an error if the CUDA version on your system does not match the CUDA version torch was compiled with.
Expand Down Expand Up @@ -309,13 +301,13 @@ To build a nemo container with Dockerfile from a branch, please run
DOCKER_BUILDKIT=1 docker build -f Dockerfile -t nemo:latest .


If you chose to work with main branch, we recommend using NVIDIA's PyTorch container version 23.03-py3 and then installing from GitHub.
If you chose to work with main branch, we recommend using NVIDIA's PyTorch container version 23.04-py3 and then installing from GitHub.

.. code-block:: bash

docker run --gpus all -it --rm -v <nemo_github_folder>:/NeMo --shm-size=8g \
-p 8888:8888 -p 6006:6006 --ulimit memlock=-1 --ulimit \
stack=67108864 --device=/dev/snd nvcr.io/nvidia/pytorch:23.03-py3
stack=67108864 --device=/dev/snd nvcr.io/nvidia/pytorch:23.04-py3

Examples
--------
Expand Down
18 changes: 18 additions & 0 deletions docs/source/asr/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ Model Classes
:members: setup_training_data, setup_optimization, setup_validation_data, setup_test_data, register_artifact


.. autoclass:: nemo.collections.asr.models.hybrid_asr_tts_models.ASRWithTTSModel
:show-inheritance:
:members: from_asr_config, from_pretrained_models, save_asr_model_to, setup_training_data


Modules
-------

Expand Down Expand Up @@ -131,6 +136,19 @@ Character Encoding Datasets
:show-inheritance:
:members:


Text-to-Text Datasets for Hybrid ASR-TTS models
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. autoclass:: nemo.collections.asr.data.text_to_text.TextToTextDataset
:show-inheritance:
:members:

.. autoclass:: nemo.collections.asr.data.text_to_text.TextToTextIterableDataset
:show-inheritance:
:members:


Subword Encoding Datasets
~~~~~~~~~~~~~~~~~~~~~~~~~

Expand Down
Loading