diff --git a/.dockerignore b/.dockerignore
new file mode 100644
index 0000000000000000000000000000000000000000..14f5114d01be349d8328bcbbfab08ca0c0a9ba98
--- /dev/null
+++ b/.dockerignore
@@ -0,0 +1,19 @@
+__pycache__
+*.pyc
+*.pyo
+*.pyd
+.Python
+env
+pip-log.txt
+pip-delete-this-directory.txt
+.tox
+.coverage
+.coverage.*
+.cache
+nosetests.xml
+coverage.xml
+*,cover
+*.log
+.git
+**/*.nemo
+**/*.ckpt
diff --git a/.gitattributes b/.gitattributes
index c7d9f3332a950355d5a77d85000f05e6f45435ea..5d51b4e71dbb8419c4700c911ee5ef682e339314 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -32,3 +32,14 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text
*tfevents* filter=lfs diff=lfs merge=lfs -text
+docs/source/nlp/dialogue_UML.png filter=lfs diff=lfs merge=lfs -text
+docs/source/nlp/nemo_megatron/images/ddp.gif filter=lfs diff=lfs merge=lfs -text
+docs/source/nlp/nemo_megatron/images/pnom.gif filter=lfs diff=lfs merge=lfs -text
+docs/source/nlp/nemo_megatron/images/pp.gif filter=lfs diff=lfs merge=lfs -text
+docs/source/nlp/nemo_megatron/images/tp.gif filter=lfs diff=lfs merge=lfs -text
+docs/source/tts/images/fastpitch_model.png filter=lfs diff=lfs merge=lfs -text
+docs/source/tts/images/radaligner_model.png filter=lfs diff=lfs merge=lfs -text
+docs/source/tts/images/tacotron2_model.png filter=lfs diff=lfs merge=lfs -text
+docs/source/tts/images/waveglow_model.png filter=lfs diff=lfs merge=lfs -text
+examples/nlp/language_modeling/nemo_2b_bf16_tp1.nemo filter=lfs diff=lfs merge=lfs -text
+tools/speech_data_explorer/screenshot.png filter=lfs diff=lfs merge=lfs -text
diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md
new file mode 100644
index 0000000000000000000000000000000000000000..5aedacf07f1b8b3877a51ef392a87c04dffb97a2
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/bug_report.md
@@ -0,0 +1,42 @@
+---
+name: Bug report
+about: Create a report to help us improve
+title: ''
+labels: bug
+assignees: ''
+
+---
+
+**Describe the bug**
+
+A clear and concise description of what the bug is.
+
+**Steps/Code to reproduce bug**
+
+Please list *minimal* steps or code snippet for us to be able to reproduce the bug.
+
+A helpful guide on on how to craft a minimal bug report http://matthewrocklin.com/blog/work/2018/02/28/minimal-bug-reports.
+
+
+**Expected behavior**
+
+A clear and concise description of what you expected to happen.
+
+**Environment overview (please complete the following information)**
+
+ - Environment location: [Bare-metal, Docker, Cloud(specify cloud provider - AWS, Azure, GCP, Collab)]
+ - Method of NeMo install: [pip install or from source]. Please specify exact commands you used to install.
+ - If method of install is [Docker], provide `docker pull` & `docker run` commands used
+
+**Environment details**
+
+If NVIDIA docker image is used you don't need to specify these.
+Otherwise, please provide:
+- OS version
+- PyTorch version
+- Python version
+
+**Additional context**
+
+Add any other context about the problem here.
+Example: GPU model
diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md
new file mode 100644
index 0000000000000000000000000000000000000000..e56d0d05e0c272143d5915f8af3660e9b32b32da
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/feature_request.md
@@ -0,0 +1,25 @@
+---
+name: Feature request
+about: Suggest an idea for this project
+title: ''
+labels: feature request
+assignees: okuchaiev
+
+---
+
+**Is your feature request related to a problem? Please describe.**
+
+A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
+
+**Describe the solution you'd like**
+
+A clear and concise description of what you want to happen.
+Provide a code snippet on how new APIs/changes would be used by others.
+
+**Describe alternatives you've considered**
+
+A clear and concise description of any alternative solutions or features you've considered.
+
+**Additional context**
+
+Add any other context or screenshots about the feature request here.
diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md
new file mode 100644
index 0000000000000000000000000000000000000000..6858131a81f84e964a587ada2be4f3818e03f30b
--- /dev/null
+++ b/.github/PULL_REQUEST_TEMPLATE.md
@@ -0,0 +1,39 @@
+# What does this PR do ?
+
+Add a one line overview of what this PR aims to accomplish.
+
+**Collection**: [Note which collection this PR will affect]
+
+# Changelog
+- Add specific line by line info of high level changes in this PR.
+
+# Usage
+* You can potentially add a usage example below
+
+```python
+# Add a code snippet demonstrating how to use this
+```
+
+# Before your PR is "Ready for review"
+**Pre checks**:
+- [ ] Make sure you read and followed [Contributor guidelines](https://github.com/NVIDIA/NeMo/blob/main/CONTRIBUTING.md)
+- [ ] Did you write any new necessary tests?
+- [ ] Did you add or update any necessary documentation?
+- [ ] Does the PR affect components that are optional to install? (Ex: Numba, Pynini, Apex etc)
+ - [ ] Reviewer: Does the PR have correct import guards for all optional libraries?
+
+**PR Type**:
+- [ ] New Feature
+- [ ] Bugfix
+- [ ] Documentation
+
+If you haven't finished some of the above items you can still open "Draft" PR.
+
+
+## Who can review?
+
+Anyone in the community is free to review the PR once the checks have passed.
+[Contributor guidelines](https://github.com/NVIDIA/NeMo/blob/main/CONTRIBUTING.md) contains specific people who can review PRs to various areas.
+
+# Additional Information
+* Related to # (issue)
diff --git a/.github/labeler.yml b/.github/labeler.yml
new file mode 100644
index 0000000000000000000000000000000000000000..e0e6691b14c623b2cbde9df1b7c4520e89d7f77d
--- /dev/null
+++ b/.github/labeler.yml
@@ -0,0 +1,33 @@
+ASR:
+- nemo/collections/asr/**/*
+- examples/asr/**/*
+- tutorials/asr/**/*
+- docs/source/asr/**/*
+
+NLP:
+- nemo/collections/nlp/**/*
+- examples/nlp/**/*
+- tutorials/nlp/**/*
+- docs/source/nlp/**/*
+
+Speaker Tasks:
+- examples/speaker_tasks/**/*
+- tutorials/speaker_tasks/**/*
+
+TTS:
+- nemo/collections/tts/**/*
+- examples/tts/**/*
+- tutorials/tts/**/*
+- docs/source/tts/**/*
+
+core:
+- nemo/core/**/*
+
+common:
+- nemo/collections/common/**/*
+
+CI:
+- .github/**/*
+- Jenkinsfile
+- Dockerfile
+- ci.groovy
diff --git a/.github/workflows/blossom-ci.yml b/.github/workflows/blossom-ci.yml
new file mode 100644
index 0000000000000000000000000000000000000000..bdfb24c4b1e5d31c7858f5f9c103166750697ede
--- /dev/null
+++ b/.github/workflows/blossom-ci.yml
@@ -0,0 +1,104 @@
+# Copyright (c) 2020-2021, NVIDIA CORPORATION.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# A workflow to trigger ci on hybrid infra (github + self hosted runner)
+name: Blossom-CI
+on:
+ issue_comment:
+ types: [created]
+ workflow_dispatch:
+ inputs:
+ platform:
+ description: 'runs-on argument'
+ required: false
+ args:
+ description: 'argument'
+ required: false
+jobs:
+ Authorization:
+ name: Authorization
+ runs-on: blossom
+ outputs:
+ args: ${{ env.args }}
+
+ # This job only runs for pull request comments
+ if: |
+ contains( 'okuchaiev,ericharper,titu1994,MaximumEntropy,nithinraok,redoctopus,yidong72,SeanNaren,yzhang123,ekmb,arendu,', format('{0},', github.actor)) &&
+ github.event.comment.body == '/blossom-ci'
+ steps:
+ - name: Check if comment is issued by authorized person
+ run: blossom-ci
+ env:
+ OPERATION: 'AUTH'
+ REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ REPO_KEY_DATA: ${{ secrets.BLOSSOM_KEY }}
+
+ Vulnerability-scan:
+ name: Vulnerability scan
+ needs: [Authorization]
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout code
+ uses: actions/checkout@v2
+ with:
+ repository: ${{ fromJson(needs.Authorization.outputs.args).repo }}
+ ref: ${{ fromJson(needs.Authorization.outputs.args).ref }}
+ lfs: 'true'
+
+ # repo specific steps
+ #- name: Setup java
+ # uses: actions/setup-java@v1
+ # with:
+ # java-version: 1.8
+
+ # add blackduck properties https://synopsys.atlassian.net/wiki/spaces/INTDOCS/pages/631308372/Methods+for+Configuring+Analysis#Using-a-configuration-file
+ #- name: Setup blackduck properties
+ # run: |
+ # PROJECTS=$(mvn -am dependency:tree | grep maven-dependency-plugin | awk '{ out="com.nvidia:"$(NF-1);print out }' | grep rapids | xargs | sed -e 's/ /,/g')
+ # echo detect.maven.build.command="-pl=$PROJECTS -am" >> application.properties
+ # echo detect.maven.included.scopes=compile >> application.properties
+
+ - name: Run blossom action
+ uses: NVIDIA/blossom-action@main
+ env:
+ REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ REPO_KEY_DATA: ${{ secrets.BLOSSOM_KEY }}
+ with:
+ args1: ${{ fromJson(needs.Authorization.outputs.args).args1 }}
+ args2: ${{ fromJson(needs.Authorization.outputs.args).args2 }}
+ args3: ${{ fromJson(needs.Authorization.outputs.args).args3 }}
+
+ Job-trigger:
+ name: Start ci job
+ needs: [Vulnerability-scan]
+ runs-on: blossom
+ steps:
+ - name: Start ci job
+ run: blossom-ci
+ env:
+ OPERATION: 'START-CI-JOB'
+ CI_SERVER: ${{ secrets.CI_SERVER }}
+ REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+
+ Upload-Log:
+ name: Upload log
+ runs-on: blossom
+ if : github.event_name == 'workflow_dispatch'
+ steps:
+ - name: Jenkins log for pull request ${{ fromJson(github.event.inputs.args).pr }} (click here)
+ run: blossom-ci
+ env:
+ OPERATION: 'POST-PROCESSING'
+ CI_SERVER: ${{ secrets.CI_SERVER }}
+ REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
diff --git a/.github/workflows/changelog-build.yml b/.github/workflows/changelog-build.yml
new file mode 100644
index 0000000000000000000000000000000000000000..7e16c344acb861a1c136444084f863d3f6784049
--- /dev/null
+++ b/.github/workflows/changelog-build.yml
@@ -0,0 +1,47 @@
+name: 'Changelog Build (Release)'
+
+on:
+ push:
+ tags:
+ - '*'
+
+jobs:
+ changelog:
+ if: startsWith(github.ref, 'refs/tags/')
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v2
+ with:
+ fetch-depth: 0 # Required due to the way Git works, without it this action won't be able to find any or the correct tags
+
+ - name: Get Previous tag
+ id: previous_tag
+ # git for-each-ref --sort=-creatordate --format '%(refname)' refs/tags ==> refs/tags/vX.Y.Z in descending order of date
+ # awk 'FNR == 2 {print substr($1, 11, length($1))}') ==> Selects the 2nd tag from the list, then strips the /refs/tags/ part of the tag
+ # set-output name=tag_name:: ==> Takes the clean tag vX.Y.Z and sets it to steps.previous_tag.outputs.tag_name
+ run: |
+ echo "::set-output name=tag_name::$(git for-each-ref --sort=-creatordate --format '%(refname)' refs/tags | awk 'FNR == 2 {print substr($1, 11, length($1))}')"
+ echo ${{ steps.previous_tag.outputs.tag_name }}
+
+ - name: Build Changelog
+ id: github_tag
+ uses: mikepenz/release-changelog-builder-action@v3.3.1
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ with:
+ # Configuration file is setup with filters for domains
+ # owner:repo must point to current repo
+ # fromTag: Auto resolved from historical tag order (previous tag compared to current tag)
+ # toTag: Current tag reference
+ configuration: ".github/workflows/config/changelog-config.json"
+ owner: "NVIDIA"
+ repo: "NeMo"
+ ignorePreReleases: "false"
+ failOnError: "false"
+ fromTag: ${{ steps.previous_tag.outputs.tag_name }}
+ toTag: ${{ github.ref_name }}
+
+ - name: Print Changelog
+ run: |
+ echo "${{steps.github_tag.outputs.changelog}}"
+ echo "--- DONE ---"
diff --git a/.github/workflows/cherry-pick-release-commit.yml b/.github/workflows/cherry-pick-release-commit.yml
new file mode 100644
index 0000000000000000000000000000000000000000..3c82269cb9a672dc21e874a8bcd2ee9c737517c3
--- /dev/null
+++ b/.github/workflows/cherry-pick-release-commit.yml
@@ -0,0 +1,28 @@
+name: Create PR to main with cherry-pick from release
+
+on:
+ pull_request_target:
+ branches:
+ - 'r*.*.*'
+ types: ["closed"]
+
+jobs:
+ cherry-pick-release-commit:
+ name: Cherry-pick release commit
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v3
+ with:
+ fetch-depth: 0
+ - name: github-cherry-pick-action v1.0.3
+ uses: carloscastrojumo/github-cherry-pick-action@bb0869df47c27be4ae4c7a2d93d22827aa5a0054
+ with:
+ branch: main
+ labels: |
+ cherry-pick
+ reviewers: |
+ ${{ github.event.pull_request.user.login }}
+
+env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
\ No newline at end of file
diff --git a/.github/workflows/close-inactive-issue-pr.yml b/.github/workflows/close-inactive-issue-pr.yml
new file mode 100644
index 0000000000000000000000000000000000000000..c71997e4b9bf8ec40ff3cbe4220216650acaf726
--- /dev/null
+++ b/.github/workflows/close-inactive-issue-pr.yml
@@ -0,0 +1,25 @@
+name: Stale-Close-Inactive-Issues-PRs
+on:
+ schedule:
+ - cron: "30 1 * * *"
+
+jobs:
+ close-issues:
+ runs-on: ubuntu-latest
+ permissions:
+ issues: write
+ pull-requests: write
+ steps:
+ - uses: actions/stale@v6
+ with:
+ operations-per-run: 100
+ days-before-issue-stale: 30
+ days-before-issue-close: 7
+ stale-issue-label: "stale"
+ stale-issue-message: "This issue is stale because it has been open for 30 days with no activity. Remove stale label or comment or this will be closed in 7 days."
+ close-issue-message: "This issue was closed because it has been inactive for 7 days since being marked as stale."
+ days-before-pr-stale: 14
+ days-before-pr-close: 7
+ stale-pr-message: "This PR is stale because it has been open for 14 days with no activity. Remove stale label or comment or update or this will be closed in 7 days."
+ close-pr-message: "This PR was closed because it has been inactive for 7 days since being marked as stale."
+ repo-token: ${{ secrets.GITHUB_TOKEN }}
diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml
new file mode 100644
index 0000000000000000000000000000000000000000..673687412096eabbe60d57ad39142cff6a5d2719
--- /dev/null
+++ b/.github/workflows/codeql.yml
@@ -0,0 +1,74 @@
+# For most projects, this workflow file will not need changing; you simply need
+# to commit it to your repository.
+#
+# You may wish to alter this file to override the set of languages analyzed,
+# or to provide custom queries or build logic.
+#
+# ******** NOTE ********
+# We have attempted to detect the languages in your repository. Please check
+# the `language` matrix defined below to confirm you have the correct set of
+# supported CodeQL languages.
+#
+name: "CodeQL"
+
+on:
+ push:
+ branches: [ "main", "[rv][0-9]*", "gh-pages-src" ]
+ pull_request:
+ # The branches below must be a subset of the branches above
+ branches: [ "main" ]
+ schedule:
+ - cron: '19 1 * * 4'
+
+jobs:
+ analyze:
+ name: Analyze
+ runs-on: ubuntu-latest
+ permissions:
+ actions: read
+ contents: read
+ security-events: write
+
+ strategy:
+ fail-fast: false
+ matrix:
+ language: [ 'python' ]
+ # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
+ # Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
+
+ steps:
+ - name: Checkout repository
+ uses: actions/checkout@v3
+
+ # Initializes the CodeQL tools for scanning.
+ - name: Initialize CodeQL
+ uses: github/codeql-action/init@v2
+ with:
+ languages: ${{ matrix.language }}
+ # If you wish to specify custom queries, you can do so here or in a config file.
+ # By default, queries listed here will override any specified in a config file.
+ # Prefix the list here with "+" to use these queries and those in the config file.
+
+ # Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
+ queries: security-and-quality # security-extended,
+
+
+ # Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java).
+ # If this step fails, then you should remove it and run the build manually (see below)
+ - name: Autobuild
+ uses: github/codeql-action/autobuild@v2
+
+ # ℹ️ Command-line programs to run using the OS shell.
+ # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
+
+ # If the Autobuild fails above, remove it and uncomment the following three lines.
+ # modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
+
+ # - run: |
+ # echo "Run, Build Application using script"
+ # ./location_of_script_within_repo/buildscript.sh
+
+ - name: Perform CodeQL Analysis
+ uses: github/codeql-action/analyze@v2
+ with:
+ category: "/language:${{matrix.language}}"
diff --git a/.github/workflows/config/changelog-config.json b/.github/workflows/config/changelog-config.json
new file mode 100644
index 0000000000000000000000000000000000000000..fe18f8ac0681a46532957d7f4c19ca87c8125515
--- /dev/null
+++ b/.github/workflows/config/changelog-config.json
@@ -0,0 +1,134 @@
+{
+ "categories": [
+ {
+ "title": "## ASR \n\nChangelog
\n\n \n\n",
+ "labels": ["asr"],
+ "exclude_labels": ["cherry-pick"]
+ },
+ {
+ "title": "## TTS \n\nChangelog
\n\n \n\n",
+ "labels": ["tts"],
+ "exclude_labels": ["cherry-pick"]
+ },
+ {
+ "title": "## NLP / NMT \n\nChangelog
\n\n \n\n",
+ "labels": ["nlp", "nmt", "megatron"],
+ "exclude_labels": ["cherry-pick"]
+ },
+ {
+ "title": "## Text Normalization / Inverse Text Normalization \n\nChangelog
\n\n \n\n",
+ "labels": ["tn", "itn"],
+ "exclude_labels": ["cherry-pick"]
+ },
+ {
+ "title": "## NeMo Tools \n\nChangelog
\n\n \n\n",
+ "labels": ["tools"],
+ "exclude_labels": ["cherry-pick"]
+ },
+ {
+ "title": "## Export \n\nChangelog
\n\n \n\n",
+ "labels": ["export"],
+ "exclude_labels": ["cherry-pick"]
+ },
+ {
+ "title": "## Documentation \n\nChangelog
\n\n \n\n",
+ "labels": ["docs"],
+ "exclude_labels": ["cherry-pick"]
+ },
+ {
+ "title": "## Bugfixes \n\nChangelog
\n\n \n\n",
+ "labels": ["bug"],
+ "exclude_labels": ["cherry-pick"]
+ },
+ {
+ "title": "## Cherrypick \n\nChangelog
\n\n \n\n",
+ "labels": ["cherry-pick"],
+ "exclude_labels": ["cherry-pick"]
+ }
+ ],
+ "ignore_labels": [
+ "ignore"
+ ],
+ "sort": "ASC",
+ "template": "\n${{CHANGELOG}}\nUncategorized:\n${{UNCATEGORIZED}}\n\n",
+ "pr_template": "- ${{TITLE}} by @${{AUTHOR}} :: PR: #${{NUMBER}}",
+ "empty_template": "${{OWNER}}\n${{REPO}}\n${{FROM_TAG}}\n${{TO_TAG}}",
+ "label_extractor": [
+ {
+ "pattern": "(.*tts.*)|(.*g2p.*)",
+ "target": "tts",
+ "flags": "gimu",
+ "on_property": ["title", "body"]
+ },
+ {
+ "pattern": "(.*asr.*)|(.*ctc.*)|(.*rnnt.*)|(.*transducer.*)|(.*dali.*)|(.*k2.*)",
+ "target": "asr",
+ "flags": "gimu",
+ "on_property": ["title", "body"]
+ },
+ {
+ "pattern": "(.*nlp.*)|(.*punctuation.*)|(.*capitalization.*)|(.*entity.*)|(.*glue.*)|(.*entity.*)|(.*retrieval.*)|(.*entity.*)|(.*intent.*)|(.*slot.*)|(.*entity.*)|(.*language.*)|(.*qa.*)|(.*token class.*)|(.*text class.*)",
+ "target": "nlp",
+ "flags": "gimu",
+ "on_property": ["title", "body"]
+ },
+ {
+ "pattern": "(.*nmt.*)|(.*bignlp.*)|(.*megatron.*)|(.*machine.*)|(.*translation.*)|(.*gpt.*)",
+ "target": "nmt",
+ "flags": "gimu",
+ "on_property": ["title", "body"]
+ },
+ {
+ "pattern": "(.*tn.*)|(.*itn.*)|(.*text norm.*)",
+ "target": "tn",
+ "flags": "gimu",
+ "on_property": ["title", "body"]
+ },
+ {
+ "pattern": "(.*sde.*)|(.*ctc segment.*)",
+ "target": "tools",
+ "flags": "gimu",
+ "on_property": ["title", "body"]
+ },
+ {
+ "pattern": "(.*trt.*)|(.*onnx.*)|(.*export.*)",
+ "target": "export",
+ "flags": "gimu",
+ "on_property": ["title", "body"]
+ },
+ {
+ "pattern": "(.*\\[x\\] Documentation.*)",
+ "target": "docs",
+ "flags": "gmu",
+ "on_property": ["title", "body"]
+ },
+ {
+ "pattern": "(.*\\[x\\] Bugfix.*)|(.*patch.*)",
+ "target": "bug",
+ "flags": "gmu",
+ "on_property": ["title", "body"]
+ },
+ {
+ "pattern": "(.*cherry-pick.*)|(.*cherrypick.*)",
+ "target": "cherrypick",
+ "flags": "gimu",
+ "on_property": ["title", "body"]
+ }
+ ],
+ "duplicate_filter": {
+ "pattern": ".+",
+ "on_property": "title",
+ "method": "match"
+ },
+ "transformers": [
+ ],
+ "max_tags_to_fetch": 100,
+ "max_pull_requests": 500,
+ "max_back_track_time_days": 365,
+ "exclude_merge_branches": [
+ ],
+ "tag_resolver": {
+ "method": "semver"
+ }
+}
+
diff --git a/.github/workflows/gh-docs.yml b/.github/workflows/gh-docs.yml
new file mode 100644
index 0000000000000000000000000000000000000000..6f8e8ea1e3e1a13f0d307705b3435c9d5a0ee04d
--- /dev/null
+++ b/.github/workflows/gh-docs.yml
@@ -0,0 +1,38 @@
+name: gh-docs-build
+on:
+ push:
+ pull_request:
+ paths:
+ - "**"
+
+# Set the access for individual scopes
+permissions: write-all
+
+jobs:
+ deploy:
+ runs-on: ubuntu-latest
+
+ container:
+ image: squidfunk/mkdocs-material
+
+ steps:
+ - uses: actions/checkout@v3
+ if: github.event.repository.fork == false
+ with:
+ ref: gh-pages-src
+
+ - name: "Correct github config"
+ if: github.event.repository.fork == false
+ run: |
+ git config --global --add safe.directory "$GITHUB_WORKSPACE"
+ git config --global user.name "${GITHUB_ACTOR}"
+ git config --global user.email "${GITHUB_ACTOR}@users.noreply.${GITHUB_DOMAIN:-"github.com"}"
+ remote_repo="https://x-access-token:${GITHUB_TOKEN}@${GITHUB_DOMAIN:-"github.com"}/${GITHUB_REPOSITORY}.git"
+ echo "${remote_repo}"
+ git remote rm origin
+ git remote add origin "${remote_repo}"
+
+ - name: "Deploy Github Page"
+ continue-on-error: true
+ run: mkdocs gh-deploy --force
+
diff --git a/.github/workflows/import-test.yml b/.github/workflows/import-test.yml
new file mode 100644
index 0000000000000000000000000000000000000000..5fc34347710d8601b8e3ba5c86290f8554ff0b4b
--- /dev/null
+++ b/.github/workflows/import-test.yml
@@ -0,0 +1,63 @@
+name: CI-Import-Check
+
+on:
+ push:
+ pull_request:
+ paths:
+ - "**"
+
+jobs:
+ ci-import-check:
+ runs-on: ubuntu-latest
+
+ # Check https://hub.docker.com/r/pytorch/pytorch/tags for latest tags
+ container:
+ image: pytorch/pytorch:1.11.0-cuda11.3-cudnn8-runtime
+
+ steps:
+ - uses: actions/checkout@v2
+
+ - name: Update base dependencies
+ run: |
+ apt-get update && apt-get install -y build-essential
+ apt-get install -y libsndfile1 make
+
+ - name: Install nemo dependencies
+ id: nemo-wheel
+ run: |
+ # install test requirements
+ pip install -r requirements/requirements_test.txt
+ # Build nemo as a wheel
+ pip install build
+ python -m build --no-isolation --wheel
+ # Preserve wheel location
+ DIST_FILE=$(find ./dist -name "*.whl" | head -n 1)
+ echo "::set-output name=DIST_FILE::${DIST_FILE}"
+
+ - name: Test ASR Domain Imports
+ run: |
+ # Install NeMo Domain
+ pip install "${{ steps.nemo-wheel.outputs.DIST_FILE }}[asr]"
+ # Run import checks
+ python tests/core_ptl/check_imports.py --domain "asr"
+ # Uninstall NeMo
+ pip uninstall -y nemo_toolkit
+
+ - name: Test TTS Domain Imports
+ run: |
+ # Install NeMo Domain
+ pip install "${{ steps.nemo-wheel.outputs.DIST_FILE }}[tts]"
+ # Run import checks
+ python tests/core_ptl/check_imports.py --domain "tts"
+ # Uninstall NeMo
+ pip uninstall -y nemo_toolkit
+
+ - name: Test NLP Domain Imports
+ run: |
+ # Install NeMo Domain
+ pip install "${{ steps.nemo-wheel.outputs.DIST_FILE }}[nlp]"
+ # Run import checks
+ python tests/core_ptl/check_imports.py --domain "nlp"
+ # Uninstall NeMo
+ pip uninstall -y nemo_toolkit
+
diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml
new file mode 100644
index 0000000000000000000000000000000000000000..680f9d187a3b77819a0e87e5d3c0fca965d74831
--- /dev/null
+++ b/.github/workflows/labeler.yml
@@ -0,0 +1,14 @@
+name: "Pull Request Labeler"
+on:
+- pull_request_target
+
+jobs:
+ triage:
+ permissions:
+ contents: read
+ pull-requests: write
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/labeler@v4
+ with:
+ repo-token: "${{ secrets.GITHUB_TOKEN }}"
\ No newline at end of file
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000000000000000000000000000000000000..1ff2a92cac64c41cc2b62fe4c08737989e61c56a
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,181 @@
+# log and data files
+*.model
+*.pkl
+#*.ipynb
+output
+result
+*.pt
+tests/data/asr
+.DS_Store
+bert.pt.json
+work
+runs
+fastspeech_output
+.hydra
+.bash_history.local
+
+# Byte-compiled / optimized / DLL files
+__pycache__/
+*.py[cod]
+*$py.class
+**.pyc
+
+# C extensions
+*.so
+
+# Distribution / packaging
+.idea
+.Python
+wandb
+build/
+develop-eggs/
+dist/
+downloads/
+eggs/
+.eggs/
+lib/
+lib64/
+#parts/
+sdist/
+var/
+wheels/
+pip-wheel-metadata/
+share/python-wheels/
+*.egg-info/
+.installed.cfg
+*.egg
+MANIFEST
+
+# PyInstaller
+# Usually these files are written by a python script from a template
+# before PyInstaller builds the exe, so as to inject date/other infos into it.
+*.manifest
+*.spec
+
+# Installer logs
+pip-log.txt
+pip-delete-this-directory.txt
+
+# Unit test / coverage reports
+htmlcov/
+.tox/
+.nox/
+.coverage
+.coverage.*
+.cache
+nosetests.xml
+coverage.xml
+*.cover
+.hypothesis/
+.pytest_cache/
+
+# Translations
+*.mo
+*.pot
+
+# Django stuff:
+*.log
+local_settings.py
+db.sqlite3
+
+# Flask stuff:
+instance/
+.webassets-cache
+
+# Scrapy stuff:
+.scrapy
+
+# Sphinx documentation
+docs/build
+
+# PyBuilder
+target/
+
+# Jupyter Notebook
+.ipynb_checkpoints
+
+# Override Jupyter in Github Language states for more accurate estimate of repo code.
+# Reference: https://github.com/github/linguist/blob/master/docs/overrides.md#generated-code
+*.ipynb linguist-generated
+
+# IPython
+profile_default/
+ipython_config.py
+
+# pyenv
+.python-version
+
+# pipenv
+# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
+# However, in case of collaboration, if having platform-specific dependencies or dependencies
+# having no cross-platform support, pipenv may install dependencies that don’t work, or not
+# install all needed dependencies.
+#Pipfile.lock
+
+# celery beat schedule file
+celerybeat-schedule
+
+# SageMath parsed files
+*.sage.py
+
+# Environments
+.env
+.venv
+env/
+venv/
+ENV/
+env.bak/
+venv.bak/
+
+# VSCode project settins
+.vscode/
+
+# Spyder project settings
+.spyderproject
+.spyproject
+
+# Rope project settings
+.ropeproject
+
+# mkdocs documentation
+/site
+/docs/html
+/docs/docs_zh/zh
+
+# mypy
+.mypy_cache/
+.dmypy.json
+dmypy.json
+
+# Pyre type checker
+.pyre/
+
+# Emacs backup files
+*~
+
+cifar-10-batches-py
+*.tar.gz
+
+# Test data.
+tests/.data
+tests/data
+
+# outputs folder
+examples/*/outputs
+examples/*/NeMo_experiments
+examples/*/nemo_experiments
+examples/*/.hydra
+examples/*/wandb
+examples/*/data
+wandb
+dump.py
+
+docs/sources/source/test_build/
+
+# Checkpoints, config files and temporary files created in tutorials.
+examples/neural_graphs/*.chkpt
+examples/neural_graphs/*.yml
+
+.hydra/
+nemo_experiments/
+
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
new file mode 100644
index 0000000000000000000000000000000000000000..fd89d3983cc551081d065456f36f1e5bd5c61e8d
--- /dev/null
+++ b/.pre-commit-config.yaml
@@ -0,0 +1,47 @@
+# Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+default_language_version:
+ python: python3
+
+ci:
+ autofix_prs: true
+ autoupdate_commit_msg: '[pre-commit.ci] pre-commit suggestions'
+ autoupdate_schedule: quarterly
+
+repos:
+ - repo: https://github.com/pre-commit/pre-commit-hooks
+ rev: v4.3.0
+ hooks:
+ - id: check-yaml
+ - id: check-case-conflict
+ - id: detect-private-key
+ - id: check-added-large-files
+ args: ['--maxkb=1000']
+ - id: requirements-txt-fixer
+
+ - repo: https://github.com/PyCQA/isort
+ rev: 5.12.0
+ hooks:
+ - id: isort
+ name: Format imports
+ exclude: docs/
+
+ - repo: https://github.com/psf/black
+ rev: 19.10b0
+ hooks:
+ - id: black
+ name: Format code
+ args: [--skip-string-normalization, --line-length=119]
+ additional_dependencies: ['click==8.0.2']
diff --git a/.readthedocs.yml b/.readthedocs.yml
new file mode 100644
index 0000000000000000000000000000000000000000..226be6a7eab01dbec87fb57678afa0f1b46f658a
--- /dev/null
+++ b/.readthedocs.yml
@@ -0,0 +1,31 @@
+# =============================================================================
+# Copyright (c) 2020 NVIDIA. All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# =============================================================================
+
+# Read the Docs configuration file
+# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
+
+# Required field.
+version: 2
+
+# Build documentation in the docs/ directory with Sphinx.
+sphinx:
+ configuration: docs/source/conf.py
+
+# Set the version of Python and requirements required to build your docs
+python:
+ version: 3.8
+ install:
+ - requirements: requirements/requirements_docs.txt
diff --git a/CITATION.cff b/CITATION.cff
new file mode 100644
index 0000000000000000000000000000000000000000..436750dd0af057b8c4d701cfb2a01a4ca0d4365a
--- /dev/null
+++ b/CITATION.cff
@@ -0,0 +1,41 @@
+cff-version: 1.2.0
+message: "If you use this software, please cite it as below."
+title: "NeMo: a toolkit for Conversational AI and Large Language Models"
+url: https://nvidia.github.io/NeMo/
+repository-code: https://github.com/NVIDIA/NeMo
+authors:
+ - family-names: Harper
+ given-names: Eric
+ - family-names: Majumdar
+ given-names: Somshubra
+ - family-names: Kuchaiev
+ given-names: Oleksii
+ - family-names: Jason
+ given-names: Li
+ - family-names: Zhang
+ given-names: Yang
+ - family-names: Bakhturina
+ given-names: Evelina
+ - family-names: Noroozi
+ given-names: Vahid
+ - family-names: Subramanian
+ given-names: Sandeep
+ - family-names: Nithin
+ given-names: Koluguri
+ - family-names: Jocelyn
+ given-names: Huang
+ - family-names: Jia
+ given-names: Fei
+ - family-names: Balam
+ given-names: Jagadeesh
+ - family-names: Yang
+ given-names: Xuesong
+ - family-names: Livne
+ given-names: Micha
+ - family-names: Dong
+ given-names: Yi
+ - family-names: Naren
+ given-names: Sean
+ - family-names: Ginsburg
+ given-names: Boris
+
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
new file mode 100644
index 0000000000000000000000000000000000000000..621a37a171b7bb06a10491350697cdd671aa7a11
--- /dev/null
+++ b/CONTRIBUTING.md
@@ -0,0 +1,79 @@
+# Contributions are welcome!
+
+We do all of NeMo's development in the open. Contributions from NeMo community are welcome.
+
+
+# Pull Requests (PR) Guidelines
+
+**Send your PRs to the `main` branch**
+
+1) Make sure your PR does one thing. Have a clear answer to "What does this PR do?".
+2) Read General Principles and style guide below
+3) Make sure you sign your commits. E.g. use ``git commit -s`` when before your commit
+4) Make sure all unittests finish successfully before sending PR ``pytest`` or (if yor dev box does not have GPU) ``pytest --cpu`` from NeMo's root folder
+5) Send your PR and request a review
+
+## Unit tests
+Quick tests (locally, while developing)
+```
+pytest
+# If you don't have NVIDIA GPU do:
+# pytest --cpu
+```
+Full tests, including pre-trained model downloads
+```
+pytest --with_downloads
+```
+
+## Whom should you ask for review:
+1. For changes to NeMo's core: @ericharper, @titu1994, @blisc, or @okuchaiev
+1. For changes to NeMo's ASR collection: @titu1994, @redoctopus, @jbalam-nv, or @okuchaiev
+1. For changes to NeMo's NLP collection: @MaximumEntropy, @ericharper, @ekmb, @yzhang123, @VahidooX, @vladgets, or @okuchaiev
+1. For changes to NeMo's TTS collection: @blisc, or @okuchaiev
+
+Note that some people may self-assign to review your PR - in which case, please wait for them to add a review.
+
+Your pull requests must pass all checks and peer-review before they can be merged.
+
+# General principles
+1. **User-oriented**: make it easy for end users, even at the cost of writing more code in the background
+1. **Robust**: make it hard for users to make mistakes.
+1. **Well-tested**: please add simple, fast unittests. Consider adding CI tests for end-to-end functionality.
+1. **Reusable**: for every piece of code, think about how it can be reused in the future and make it easy to be reused.
+1. **Readable**: code should be easier to read.
+1. **Legal**: if you copy even one line of code from the Internet, make sure that the code allows the license that NeMo supports. Give credit and link back to the code.
+1. **Sensible**: code should make sense. If you think a piece of code might be confusing, write comments.
+
+## Class naming conventions
+* No “I”, “Interface”, “NM” nor “NeMo” pre/postfixes anywhere
+* Core interfaces have simple names: Typing, Cloud, Serialization, FileIO*
+* Core classes have the simplest names ever: NeuralModule, Model, Graph, Dataset, Loss, Module*
+* Abstract classes in the Model hierarchy have Model postfix
+* A config class for MyModel should be called MyModelConfig
+* Leaf Neural Module classes have simple names without any postfixes (e.g. AudioPreprocess)
+* Leaf Datasets have Dataset postfix (e.g. AudioToSpeechLabelDataset)
+* Leaf Losses have Loss postfix (e.g. CTCLoss)
+* Leaf Models do not have any postfix, just name (e.g. QuartzNet)
+
+## Python style
+We use ``black`` as our style guide. To check whether your code will pass style check (from the NeMo's repo folder) run:
+``python setup.py style`` and if it does not pass run ``python setup.py style --fix``.
+
+1. Include docstrings for every class and method exposed to the user.
+1. Use Python 3 type hints for every class and method exposed to the user.
+1. Avoid wild import: ``from X import *`` unless in ``X.py``, ``__all__`` is defined.
+1. Minimize the use of ``**kwargs``.
+1. ``RaiseError`` is preferred to ``assert``. Write: ```if X: raise Error``` instead of ```assert X```.
+1. Classes are preferred to standalone methods.
+1. Methods should be atomic. A method shouldn't be longer than 75 lines, e.g. can be fit into the computer screen without scrolling.
+1. If a method has arguments that don't fit into one line, each argument should be in its own line for readability.
+1. Add ``__init__.py`` for every folder.
+1. F-strings are prefered to formatted strings.
+1. Loggers are preferred to print. In NeMo, you can use logger from ``from nemo.utils import logging``
+1. Private functions (functions start with ``_``) shouldn't be called outside its host file.
+1. If a comment lasts multiple lines, use ``'''`` instead of ``#``.
+
+# Collections
+Collection is a logical grouping of related Neural Modules. It is a grouping of modules that share a domain area or semantics.
+When contributing module to a collection, please make sure it belongs to that category.
+If you would like to start a new one and contribute back to the platform, you are very welcome to do so.
diff --git a/Dockerfile b/Dockerfile
new file mode 100644
index 0000000000000000000000000000000000000000..434ecb0abd1df8a93ba123cff8dcd9ca0e464237
--- /dev/null
+++ b/Dockerfile
@@ -0,0 +1,127 @@
+# syntax=docker/dockerfile:experimental
+
+# Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+ARG BASE_IMAGE=nvcr.io/nvidia/pytorch:23.02-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
+# image (by specifying build target as `nemo-deps`)
+FROM ${BASE_IMAGE} as nemo-deps
+
+# dependency flags; should be declared after FROM
+# torchaudio: not required by default
+ARG REQUIRE_TORCHAUDIO=false
+# k2: not required by default
+ARG REQUIRE_K2=false
+# ais cli: not required by default, install only if required
+ARG REQUIRE_AIS_CLI=false
+
+# Ensure apt-get won't prompt for selecting options
+ENV DEBIAN_FRONTEND=noninteractive
+# libavdevice-dev rerquired for latest torchaudio
+RUN apt-get update && \
+ apt-get upgrade -y && \
+ apt-get install -y \
+ libsndfile1 sox \
+ libfreetype6 \
+ swig \
+ ffmpeg \
+ libavdevice-dev && \
+ rm -rf /var/lib/apt/lists/*
+
+WORKDIR /tmp/
+
+# TODO: Remove once this Apex commit (2/24/23) is included in PyTorch
+# container
+RUN git clone https://github.com/NVIDIA/apex.git && \
+ cd apex && \
+ git checkout 03c9d80ed54c0eaa5b581bf42ceca3162f085327 && \
+ pip3 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" ./
+
+# uninstall stuff from base container
+RUN pip3 uninstall -y sacrebleu torchtext
+
+# build torchaudio
+WORKDIR /tmp/torchaudio_build
+COPY scripts/installers /tmp/torchaudio_build/scripts/installers/
+RUN INSTALL_MSG=$(/bin/bash /tmp/torchaudio_build/scripts/installers/install_torchaudio_latest.sh); INSTALL_CODE=$?; \
+ echo ${INSTALL_MSG}; \
+ if [ ${INSTALL_CODE} -ne 0 ]; then \
+ echo "torchaudio installation failed"; \
+ if [ "${REQUIRE_TORCHAUDIO}" = true ]; then \
+ exit ${INSTALL_CODE}; \
+ else echo "Skipping failed torchaudio installation"; fi \
+ else echo "torchaudio installed successfully"; fi
+
+# install nemo dependencies
+WORKDIR /tmp/nemo
+COPY requirements .
+RUN for f in $(ls requirements*.txt); do pip3 install --disable-pip-version-check --no-cache-dir -r $f; done
+
+# install k2, skip if installation fails
+COPY scripts /tmp/nemo/scripts/
+RUN INSTALL_MSG=$(/bin/bash /tmp/nemo/scripts/speech_recognition/k2/setup.sh); INSTALL_CODE=$?; \
+ echo ${INSTALL_MSG}; \
+ if [ ${INSTALL_CODE} -ne 0 ]; then \
+ echo "k2 installation failed"; \
+ if [ "${REQUIRE_K2}" = true ]; then \
+ exit ${INSTALL_CODE}; \
+ else echo "Skipping failed k2 installation"; fi \
+ else echo "k2 installed successfully"; fi
+
+# copy nemo source into a scratch image
+FROM scratch as nemo-src
+COPY . .
+
+# start building the final container
+FROM nemo-deps as nemo
+ARG NEMO_VERSION=1.17.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
+RUN /usr/bin/test -n "$NEMO_VERSION" && \
+ /bin/echo "export NEMO_VERSION=${NEMO_VERSION}" >> /root/.bashrc && \
+ /bin/echo "export BASE_IMAGE=${BASE_IMAGE}" >> /root/.bashrc
+
+# Install NeMo
+RUN --mount=from=nemo-src,target=/tmp/nemo cd /tmp/nemo && pip install ".[all]"
+
+# Check install
+RUN python -c "import nemo.collections.nlp as nemo_nlp" && \
+ python -c "import nemo.collections.tts as nemo_tts" && \
+ python -c "import nemo_text_processing.text_normalization as text_normalization"
+
+
+# copy scripts/examples/tests into container for end user
+WORKDIR /workspace/nemo
+COPY scripts /workspace/nemo/scripts
+COPY examples /workspace/nemo/examples
+COPY tests /workspace/nemo/tests
+COPY tutorials /workspace/nemo/tutorials
+# COPY README.rst LICENSE /workspace/nemo/
+
+RUN printf "#!/bin/bash\njupyter lab --no-browser --allow-root --ip=0.0.0.0" >> start-jupyter.sh && \
+ chmod +x start-jupyter.sh
+
+# If required, install AIS CLI
+RUN if [ "${REQUIRE_AIS_CLI}" = true ]; then \
+ INSTALL_MSG=$(/bin/bash scripts/installers/install_ais_cli_latest.sh); INSTALL_CODE=$?; \
+ echo ${INSTALL_MSG}; \
+ if [ ${INSTALL_CODE} -ne 0 ]; then \
+ echo "AIS CLI installation failed"; \
+ exit ${INSTALL_CODE}; \
+ else echo "AIS CLI installed successfully"; fi \
+ else echo "Skipping AIS CLI installation"; fi
diff --git a/Jenkinsfile b/Jenkinsfile
new file mode 100644
index 0000000000000000000000000000000000000000..3082cb1aad73c4c1a12f6b7aa2c7ae8ccb2b1d97
--- /dev/null
+++ b/Jenkinsfile
@@ -0,0 +1,4447 @@
+pipeline {
+ agent {
+ docker {
+ image 'pytorch_23.02:apex_eec72500b073581edf1bc9183f0337338478ba9b_te_f06e2d85619376b9db0ca86847df2f1a5cb71388'
+ args '--device=/dev/nvidia0 --gpus all --user 0:128 -v /home/TestData:/home/TestData -v $HOME/.cache:/root/.cache --shm-size=8g'
+ }
+ }
+ options {
+ timeout(time: 2, unit: 'HOURS')
+ disableConcurrentBuilds(abortPrevious: true)
+ }
+
+ stages {
+
+ stage('Add git safe directory'){
+ steps{
+ sh 'git config --global --add safe.directory /var/lib/jenkins/workspace/NeMo_$GIT_BRANCH'
+ sh 'git config --global --add safe.directory /raid/JenkinsWorkDir/workspace/NeMo_$GIT_BRANCH'
+ sh 'git config --global --add safe.directory /mnt/D3/JenkinsWorkDir/workspace/NeMo_$GIT_BRANCH'
+ }
+ }
+
+ stage('nvidia-smi'){
+ steps{
+ sh 'nvidia-smi'
+ }
+ }
+
+ stage('PyTorch version') {
+ steps {
+ sh 'python -c "import torch; print(torch.__version__)"'
+ sh 'python -c "import torchvision; print(torchvision.__version__)"'
+ }
+ }
+
+ stage('Install test requirements') {
+ steps {
+ sh 'apt-get update && apt-get install -y bc && pip install -r requirements/requirements_test.txt'
+ }
+ }
+
+ stage('Code formatting checks') {
+ steps {
+ sh 'python setup.py style'
+ }
+ }
+
+ stage('Copyright Headers check') {
+ steps {
+ sh 'python tests/check_copyright_header.py --dir .'
+ }
+ }
+
+ stage('NeMo Installation') {
+ steps {
+ sh './reinstall.sh release'
+ }
+ }
+
+
+ stage('PyTorch Lightning version') {
+ steps {
+ sh 'python -c "import pytorch_lightning; print(pytorch_lightning.__version__)"'
+ }
+ }
+
+ stage('PyTorch Lightning DDP Checks') {
+ steps {
+ sh 'CUDA_VISIBLE_DEVICES="0,1" python "tests/core_ptl/check_for_ranks.py"'
+ }
+ }
+
+ stage('Basic Import Checks') {
+ steps {
+ sh 'python -c "import nemo.collections.asr as nemo_asr"'
+ sh 'python -c "import nemo.collections.nlp as nemo_nlp"'
+ sh 'python -c "import nemo.collections.tts as nemo_tts"'
+ }
+ }
+ stage('L0: Unit Tests GPU') {
+ steps {
+ sh 'NEMO_NUMBA_MINVER=0.53 pytest -m "not pleasefixme" --with_downloads'
+ }
+ }
+
+ stage('L0: Unit Tests CPU') {
+ when {
+ anyOf {
+ branch 'r1.17.0'
+ changeRequest target: 'r1.17.0'
+ }
+ }
+ steps {
+ sh 'CUDA_VISIBLE_DEVICES="" NEMO_NUMBA_MINVER=0.53 pytest -m "not pleasefixme" --cpu --with_downloads --relax_numba_compat'
+ }
+ }
+
+ stage('L2: ASR dev run') {
+ when {
+ anyOf {
+ branch 'r1.17.0'
+ changeRequest target: 'r1.17.0'
+ }
+ }
+ failFast true
+ parallel {
+ stage('Speech to Text') {
+ steps {
+ sh 'python examples/asr/asr_ctc/speech_to_text_ctc.py \
+ model.train_ds.manifest_filepath=/home/TestData/an4_dataset/an4_train.json \
+ model.validation_ds.manifest_filepath=/home/TestData/an4_dataset/an4_val.json \
+ trainer.devices=[0] \
+ trainer.accelerator="gpu" \
+ +trainer.fast_dev_run=True \
+ exp_manager.exp_dir=examples/asr/speech_to_text_results'
+ sh 'rm -rf examples/asr/speech_to_text_results'
+ }
+ }
+
+ stage('L2: Speech to Text WPE - CitriNet') {
+ steps {
+ sh 'python examples/asr/asr_ctc/speech_to_text_ctc_bpe.py \
+ --config-path="../conf/citrinet/" --config-name="config_bpe" \
+ model.train_ds.manifest_filepath=/home/TestData/an4_dataset/an4_train.json \
+ model.validation_ds.manifest_filepath=/home/TestData/an4_dataset/an4_val.json \
+ model.tokenizer.dir="/home/TestData/asr_tokenizers/an4_wpe_128/" \
+ model.tokenizer.type="wpe" \
+ trainer.devices=[1] \
+ trainer.accelerator="gpu" \
+ +trainer.fast_dev_run=True \
+ exp_manager.exp_dir=examples/asr/speech_to_text_wpe_results'
+ sh 'rm -rf examples/asr/speech_to_text_wpe_results'
+ }
+ }
+
+ stage('L2: Speech Pre-training - CitriNet') {
+ steps {
+ sh 'python examples/asr/speech_pretraining/speech_pre_training.py \
+ --config-path="../conf/ssl/citrinet/" --config-name="citrinet_ssl_ci" \
+ model.train_ds.manifest_filepath=/home/TestData/an4_dataset/an4_train.json \
+ model.validation_ds.manifest_filepath=/home/TestData/an4_dataset/an4_val.json \
+ trainer.devices=[1] \
+ trainer.accelerator="gpu" \
+ +trainer.fast_dev_run=True \
+ exp_manager.exp_dir=examples/asr/speech_pre_training_results'
+ sh 'rm -rf examples/asr/speech_pre_training_results'
+ }
+ }
+
+ stage('L2: Speech Pre-training - Wav2Vec') {
+ steps {
+ sh 'python examples/asr/speech_pretraining/speech_pre_training.py \
+ --config-path="../conf/ssl/wav2vec/" --config-name="wav2vec_ci" \
+ model.train_ds.manifest_filepath=/home/TestData/an4_dataset/an4_train.json \
+ model.validation_ds.manifest_filepath=/home/TestData/an4_dataset/an4_val.json \
+ trainer.devices=[1] \
+ trainer.accelerator="gpu" \
+ +trainer.fast_dev_run=True \
+ exp_manager.exp_dir=examples/asr/speech_pre_training_results'
+ sh 'rm -rf examples/asr/speech_pre_training_results'
+ }
+ }
+
+ stage('L2: Speech to Text WPE - Conformer') {
+ steps {
+ sh 'python examples/asr/asr_ctc/speech_to_text_ctc_bpe.py \
+ --config-path="../conf/conformer" --config-name="conformer_ctc_bpe" \
+ model.train_ds.manifest_filepath=/home/TestData/an4_dataset/an4_train.json \
+ model.validation_ds.manifest_filepath=/home/TestData/an4_dataset/an4_val.json \
+ model.tokenizer.dir="/home/TestData/asr_tokenizers/an4_wpe_128/" \
+ model.tokenizer.type="wpe" \
+ model.train_ds.batch_size=4 \
+ model.validation_ds.batch_size=4 \
+ trainer.devices=[1] \
+ trainer.accelerator="gpu" \
+ +trainer.fast_dev_run=True \
+ exp_manager.exp_dir=examples/asr/speech_to_text_wpe_conformer_results'
+ sh 'rm -rf examples/asr/speech_to_text_wpe_conformer_results'
+ }
+ }
+ }
+ }
+
+ stage('L2: ASR dev run - part two') {
+ when {
+ anyOf {
+ branch 'r1.17.0'
+ changeRequest target: 'r1.17.0'
+ }
+ }
+ failFast true
+ parallel {
+ stage('L2: Speech to Text WPE - Squeezeformer') {
+ steps {
+ sh 'python examples/asr/asr_ctc/speech_to_text_ctc_bpe.py \
+ --config-path="../conf/squeezeformer" --config-name="squeezeformer_ctc_bpe" \
+ model.train_ds.manifest_filepath=/home/TestData/an4_dataset/an4_train.json \
+ model.validation_ds.manifest_filepath=/home/TestData/an4_dataset/an4_val.json \
+ model.tokenizer.dir="/home/TestData/asr_tokenizers/an4_wpe_128/" \
+ model.tokenizer.type="wpe" \
+ model.encoder.d_model=144 \
+ model.train_ds.batch_size=4 \
+ model.validation_ds.batch_size=4 \
+ trainer.devices=[0] \
+ trainer.accelerator="gpu" \
+ +trainer.fast_dev_run=True \
+ exp_manager.exp_dir=examples/asr/speech_to_text_wpe_squeezeformer_results'
+ sh 'rm -rf examples/asr/speech_to_text_wpe_squeezeformer_results'
+ }
+ }
+ }
+ }
+
+ stage('L2: Speech to Text EMA') {
+ when {
+ anyOf {
+ branch 'r1.17.0'
+ changeRequest target: 'r1.17.0'
+ }
+ }
+ steps {
+ sh 'python examples/asr/asr_ctc/speech_to_text_ctc.py \
+ model.train_ds.manifest_filepath=/home/TestData/an4_dataset/an4_train.json \
+ model.validation_ds.manifest_filepath=/home/TestData/an4_dataset/an4_val.json \
+ trainer.devices=2 \
+ trainer.accelerator="gpu" \
+ +trainer.fast_dev_run=True \
+ +exp_manager.ema.enable=True \
+ exp_manager.exp_dir=examples/asr/speech_to_text_results'
+ sh 'rm -rf examples/asr/speech_to_text_results'
+ }
+
+ }
+
+ stage('L2: Speaker dev run') {
+ when {
+ anyOf {
+ branch 'r1.17.0'
+ changeRequest target: 'r1.17.0'
+ }
+ }
+ failFast true
+ parallel {
+ stage('Speaker Recognition') {
+ steps {
+ sh 'python examples/speaker_tasks/recognition/speaker_reco.py \
+ model.train_ds.batch_size=10 \
+ model.validation_ds.batch_size=2 \
+ model.train_ds.manifest_filepath=/home/TestData/an4_speaker/train.json \
+ model.validation_ds.manifest_filepath=/home/TestData/an4_speaker/dev.json \
+ model.decoder.num_classes=2 \
+ trainer.max_epochs=10 \
+ trainer.devices=[1] \
+ trainer.accelerator="gpu" \
+ +trainer.fast_dev_run=True \
+ exp_manager.exp_dir=examples/speaker_tasks/recognition/speaker_recognition_results'
+ sh 'rm -rf examples/speaker_tasks/recognition/speaker_recognition_results'
+ }
+ }
+
+ stage('Speaker Diarization') {
+ steps {
+ sh 'python examples/speaker_tasks/diarization/neural_diarizer/multiscale_diar_decoder.py \
+ model.diarizer.speaker_embeddings.model_path=titanet_large \
+ model.train_ds.batch_size=5 \
+ model.validation_ds.batch_size=5 \
+ model.train_ds.emb_dir=examples/speaker_tasks/diarization/speaker_diarization_results \
+ model.validation_ds.emb_dir=examples/speaker_tasks/diarization/speaker_diarization_results \
+ model.train_ds.manifest_filepath=/home/TestData/an4_diarizer/simulated_train/msdd_data.50step.json \
+ model.validation_ds.manifest_filepath=/home/TestData/an4_diarizer/simulated_valid/msdd_data.50step.json \
+ trainer.devices=[1] \
+ trainer.accelerator="gpu" \
+ +trainer.fast_dev_run=True \
+ exp_manager.exp_dir=examples/speaker_tasks/diarization/speaker_diarization_results'
+ sh 'rm -rf examples/speaker_tasks/diarization/speaker_diarization_results'
+ }
+ }
+
+ stage('Speech to Label') {
+ steps {
+ sh 'python examples/asr/speech_classification/speech_to_label.py \
+ model.train_ds.manifest_filepath=/home/TestData/speech_commands/train_manifest.json \
+ model.validation_ds.manifest_filepath=/home/TestData/speech_commands/test_manifest.json \
+ model.test_ds.manifest_filepath=/home/TestData/speech_commands/test_manifest.json \
+ trainer.devices=[1] \
+ trainer.accelerator="gpu" \
+ +trainer.fast_dev_run=True \
+ model.preprocessor._target_=nemo.collections.asr.modules.AudioToMelSpectrogramPreprocessor \
+ ~model.preprocessor.window_size \
+ ~model.preprocessor.window_stride \
+ ~model.preprocessor.window \
+ ~model.preprocessor.n_mels \
+ ~model.preprocessor.n_mfcc \
+ ~model.preprocessor.n_fft \
+ exp_manager.exp_dir=examples/asr/speech_to_label_results'
+ sh 'rm -rf examples/asr/speech_to_label_results'
+ }
+ }
+
+ stage('Speaker Diarization with ASR Inference') {
+ steps {
+ sh 'python examples/speaker_tasks/diarization/clustering_diarizer/offline_diar_with_asr_infer.py \
+ diarizer.manifest_filepath=/home/TestData/an4_diarizer/an4_manifest.json \
+ diarizer.speaker_embeddings.model_path=/home/TestData/an4_diarizer/spkr.nemo \
+ diarizer.speaker_embeddings.parameters.save_embeddings=True \
+ diarizer.speaker_embeddings.parameters.window_length_in_sec=[1.5] \
+ diarizer.speaker_embeddings.parameters.shift_length_in_sec=[0.75] \
+ diarizer.speaker_embeddings.parameters.multiscale_weights=[1.0] \
+ diarizer.asr.model_path=QuartzNet15x5Base-En \
+ diarizer.asr.parameters.asr_based_vad=True \
+ diarizer.out_dir=examples/speaker_tasks/diarization/speaker_diarization_asr_results'
+ sh 'rm -rf examples/speaker_tasks/diarization/speaker_diarization_asr_results'
+ }
+ }
+
+ stage('Clustering Diarizer Inference') {
+ steps {
+ sh 'python examples/speaker_tasks/diarization/clustering_diarizer/offline_diar_infer.py \
+ diarizer.manifest_filepath=/home/TestData/an4_diarizer/an4_manifest.json \
+ diarizer.speaker_embeddings.model_path=/home/TestData/an4_diarizer/spkr.nemo \
+ diarizer.speaker_embeddings.parameters.save_embeddings=True \
+ diarizer.speaker_embeddings.parameters.window_length_in_sec=1.5 \
+ diarizer.speaker_embeddings.parameters.shift_length_in_sec=0.75 \
+ diarizer.speaker_embeddings.parameters.multiscale_weights=null \
+ diarizer.vad.model_path=/home/TestData/an4_diarizer/MatchboxNet_VAD_3x2.nemo \
+ diarizer.out_dir=examples/speaker_tasks/diarization/clustering_diarizer_results'
+ sh 'rm -rf examples/speaker_tasks/diarization/clustering_diarizer_results'
+ }
+ }
+
+ stage('Neural Diarizer Inference') {
+ steps {
+ sh 'python examples/speaker_tasks/diarization/neural_diarizer/multiscale_diar_decoder_infer.py \
+ diarizer.manifest_filepath=/home/TestData/an4_diarizer/an4_manifest.json \
+ diarizer.msdd_model.model_path=/home/TestData/an4_diarizer/diar_msdd_telephonic.nemo \
+ diarizer.speaker_embeddings.parameters.save_embeddings=True \
+ diarizer.vad.model_path=/home/TestData/an4_diarizer/MatchboxNet_VAD_3x2.nemo \
+ diarizer.out_dir=examples/speaker_tasks/diarization/neural_diarizer_results'
+ sh 'rm -rf examples/speaker_tasks/diarization/neural_diarizer_results'
+ }
+ }
+
+ stage('Multispeaker ASR Data Simulation') {
+ steps {
+ sh 'python tools/speech_data_simulator/multispeaker_simulator.py \
+ --config-path=conf --config-name=data_simulator.yaml \
+ data_simulator.random_seed=42 \
+ data_simulator.manifest_filepath=/home/TestData/LibriSpeechShort/dev-clean-align-short.json \
+ data_simulator.outputs.output_dir=./test_simulator \
+ data_simulator.session_config.num_sessions=2 \
+ data_simulator.session_config.session_length=60'
+ sh 'rm -rf ./test_simulator'
+ }
+ }
+ }
+ }
+ // TODO: Enable test after 21.08 container is used.
+ // stage('L2: ASR DALI dev run') {
+ // when {
+ // anyOf {
+ // branch 'r1.17.0'
+ // changeRequest target: 'r1.17.0'
+ // }
+ // }
+ // failFast true
+ // parallel {
+ // stage('Speech to Text - DALI AudioToMelSpectrogramPreprocessor') {
+ // steps {
+ // sh 'python examples/asr/asr_ctc/speech_to_text_ctc.py \
+ // model.train_ds.manifest_filepath=/home/TestData/an4_dataset/an4_train.json \
+ // +model.train_ds.use_dali=True \
+ // model.validation_ds.manifest_filepath=/home/TestData/an4_dataset/an4_val.json \
+ // +model.validation_ds.use_dali=True \
+ // trainer.devices=[0] \
+ // trainer.accelerator="gpu" \
+ // +trainer.fast_dev_run=True \
+ // exp_manager.exp_dir=examples/asr/speech_to_text_results'
+ // sh 'rm -rf examples/asr/speech_to_text_results'
+ // }
+ // }
+ // stage('Speech to Text BPE - DALI AudioToMelSpectrogramPreprocessor') {
+ // steps {
+ // sh 'python examples/asr/asr_ctc/speech_to_text_bpe.py \
+ // --config-path="../conf/citrinet/" --config-name="config_bpe" \
+ // model.tokenizer.dir="/home/TestData/asr_tokenizers/an4_wpe_128/" \
+ // model.tokenizer.type="wpe" \
+ // model.train_ds.manifest_filepath=/home/TestData/an4_dataset/an4_train.json \
+ // +model.train_ds.use_dali=True \
+ // model.validation_ds.manifest_filepath=/home/TestData/an4_dataset/an4_val.json \
+ // +model.validation_ds.use_dali=True \
+ // trainer.devices=[0] \
+ // trainer.accelerator="gpu" \
+ // +trainer.fast_dev_run=True \
+ // exp_manager.exp_dir=examples/asr/speech_to_text_wpe_results'
+ // sh 'rm -rf examples/asr/speech_to_text_wpe_results'
+ // }
+ // }
+ // // TODO: This would fail due to an unnecessary torchaudio import.
+ // // To be enabled once torchaudio is available in the container used for CI
+ // // stage('Speech to Text - DALI AudioToMFCCPreprocessor') {
+ // // steps {
+ // // sh 'python examples/asr/asr_ctc/speech_to_text_ctc.py \
+ // // model.train_ds.manifest_filepath=/home/TestData/an4_dataset/an4_train.json \
+ // // +model.train_ds.use_dali=True \
+ // // model.validation_ds.manifest_filepath=/home/TestData/an4_dataset/an4_val.json \
+ // // +model.validation_ds.use_dali=True \
+ // // model.preprocessor._target_=nemo.collections.asr.modules.AudioToMFCCPreprocessor \
+ // // ~model.preprocessor.normalize \
+ // // ~model.preprocessor.features \
+ // // ~model.preprocessor.frame_splicing \
+ // // ~model.preprocessor.dither \
+ // // ~model.preprocessor.stft_conv \
+ // // +model.n_mels=64 \
+ // // +model.n_mfcc=64 \
+ // // trainer.devices=[1] \
+ // // trainer.accelerator="gpu" \
+ // // +trainer.fast_dev_run=True \
+ // // exp_manager.exp_dir=examples/asr/speech_to_text_results'
+ // // sh 'rm -rf examples/asr/speech_to_text_results'
+ // // }
+ // // }
+ // }
+ // }
+
+ // TODO: Add back once CI is updated
+ // stage('L2: ASR RNNT dev run') {
+ // when {
+ // anyOf {
+ // branch 'r1.17.0'
+ // changeRequest target: 'r1.17.0'
+ // }
+ // }
+ // failFast true
+ // parallel {
+ // stage('Speech to Text - RNNT') {
+ // steps {
+ // sh 'STRICT_NUMBA_COMPAT_CHECK=false python examples/asr/asr_transducer/speech_to_text_rnnt.py \
+ // --config-path="../conf/contextnet_rnnt/" --config-name="config_rnnt.yaml" \
+ // model.train_ds.manifest_filepath=/home/TestData/an4_dataset/an4_train.json \
+ // model.validation_ds.manifest_filepath=/home/TestData/an4_dataset/an4_val.json \
+ // model.train_ds.batch_size=2 \
+ // model.validation_ds.batch_size=2 \
+ // trainer.devices=[0] \
+ // trainer.accelerator="gpu" \
+ // +trainer.fast_dev_run=True \
+ // exp_manager.exp_dir=examples/asr/speech_to_text_rnnt_results'
+ // sh 'rm -rf examples/asr/speech_to_text_rnnt_results'
+ // }
+ // }
+ // stage('L2: Speech to Text RNNT WPE') {
+ // steps {
+ // sh 'STRICT_NUMBA_COMPAT_CHECK=false python examples/asr/asr_transducer/speech_to_text_rnnt_bpe.py \
+ // --config-path="../conf/contextnet_rnnt/" --config-name="config_rnnt_bpe.yaml" \
+ // model.train_ds.manifest_filepath=/home/TestData/an4_dataset/an4_train.json \
+ // model.validation_ds.manifest_filepath=/home/TestData/an4_dataset/an4_val.json \
+ // model.train_ds.batch_size=2 \
+ // model.validation_ds.batch_size=2 \
+ // model.tokenizer.dir="/home/TestData/asr_tokenizers/an4_wpe_128/" \
+ // model.tokenizer.type="wpe" \
+ // trainer.devices=[0] \
+ // trainer.accelerator="gpu" \
+ // +trainer.fast_dev_run=True \
+ // exp_manager.exp_dir=examples/asr/speech_to_text_rnnt_wpe_results'
+ // sh 'rm -rf examples/asr/speech_to_text_rnnt_wpe_results'
+ // }
+ // }
+ // stage('L3: Speech to Text Hybrid Transducer-CTC WPE') {
+ // steps {
+ // sh 'STRICT_NUMBA_COMPAT_CHECK=false python examples/asr/asr_hybrid_transducer_ctc/speech_to_text_hybrid_rnnt_ctc_bpe.py \
+ // --config-path="../conf/conformer/hybrid_transducer_ctc/conformer_hybrid_transducer_ctc/" --config-name="conformer_hybrid_transducer_ctc_bpe.yaml" \
+ // model.train_ds.manifest_filepath=/home/TestData/an4_dataset/an4_train.json \
+ // model.validation_ds.manifest_filepath=/home/TestData/an4_dataset/an4_val.json \
+ // model.encoder.n_layers= 2 \
+ // model.train_ds.batch_size=2 \
+ // model.validation_ds.batch_size=2 \
+ // model.tokenizer.dir="/home/TestData/asr_tokenizers/an4_wpe_128/" \
+ // model.tokenizer.type="wpe" \
+ // trainer.devices=[0] \
+ // trainer.accelerator="gpu" \
+ // +trainer.fast_dev_run=True \
+ // exp_manager.exp_dir=examples/asr/speech_to_text_hybrid_transducer_ctc_wpe_results'
+ // sh 'rm -rf examples/asr/speech_to_text_hybrid_transducer_ctc_wpe_results'
+ // }
+ // }
+ // }
+ // }
+
+ // stage('L2: Hybrid ASR RNNT-CTC dev run') {
+ // when {
+ // anyOf {
+ // branch 'r1.17.0'
+ // changeRequest target: 'r1.17.0'
+ // }
+ // }
+ // failFast true
+ // parallel {
+ // stage('Speech to Text Hybrid Transducer-CTC WPE') {
+ // steps {
+ // sh 'STRICT_NUMBA_COMPAT_CHECK=false python examples/asr/asr_hybrid_transducer_ctc/speech_to_text_hybrid_rnnt_ctc_bpe.py \
+ // --config-path="../conf/conformer/hybrid_transducer_ctc/conformer_hybrid_transducer_ctc/" --config-name="conformer_hybrid_transducer_ctc_bpe.yaml" \
+ // model.train_ds.manifest_filepath=/home/TestData/an4_dataset/an4_train.json \
+ // model.validation_ds.manifest_filepath=/home/TestData/an4_dataset/an4_val.json \
+ // model.encoder.n_layers= 2 \
+ // model.train_ds.batch_size=2 \
+ // model.validation_ds.batch_size=2 \
+ // model.tokenizer.dir="/home/TestData/asr_tokenizers/an4_wpe_128/" \
+ // model.tokenizer.type="wpe" \
+ // trainer.devices=[0] \
+ // trainer.accelerator="gpu" \
+ // +trainer.fast_dev_run=True \
+ // exp_manager.exp_dir=examples/asr/speech_to_text_hybrid_transducer_ctc_wpe_results'
+ // sh 'rm -rf examples/asr/speech_to_text_hybrid_transducer_ctc_wpe_results'
+ // }
+ // }
+ // }
+ // }
+
+ stage('L2: ASR Multi-dataloader dev run') {
+ when {
+ anyOf {
+ branch 'r1.17.0'
+ changeRequest target: 'r1.17.0'
+ }
+ }
+ failFast true
+ parallel {
+ stage('Speech to Text multi-dataloader') {
+ steps {
+ sh 'python examples/asr/asr_ctc/speech_to_text_ctc.py \
+ model.train_ds.manifest_filepath=/home/TestData/an4_dataset/an4_train.json \
+ model.validation_ds.manifest_filepath=[/home/TestData/an4_dataset/an4_val.json,/home/TestData/an4_dataset/an4_val.json] \
+ trainer.devices=[0] \
+ trainer.accelerator="gpu" \
+ trainer.max_epochs=1 \
+ trainer.max_steps=1 \
+ +trainer.num_sanity_val_steps=1 \
+ exp_manager.exp_dir=examples/asr/speech_to_text_results'
+ sh 'rm -rf examples/asr/speech_to_text_results'
+ }
+ }
+
+ stage('Speech to Label multi-dataloader') {
+ steps {
+ sh 'python examples/asr/speech_classification/speech_to_label.py \
+ model.train_ds.manifest_filepath=/home/TestData/speech_commands/train_manifest.json \
+ model.validation_ds.manifest_filepath=[/home/TestData/speech_commands/test_manifest.json,/home/TestData/speech_commands/test_manifest.json] \
+ trainer.devices=[1] \
+ trainer.accelerator="gpu" \
+ trainer.max_epochs=1 \
+ trainer.max_steps=1 \
+ +trainer.num_sanity_val_steps=1 \
+ model.preprocessor._target_=nemo.collections.asr.modules.AudioToMelSpectrogramPreprocessor \
+ ~model.preprocessor.window_size \
+ ~model.preprocessor.window_stride \
+ ~model.preprocessor.window \
+ ~model.preprocessor.n_mels \
+ ~model.preprocessor.n_mfcc \
+ ~model.preprocessor.n_fft \
+ exp_manager.exp_dir=examples/asr/speech_to_label_results'
+ sh 'rm -rf examples/asr/speech_to_label_results'
+ }
+ }
+ }
+ }
+
+ stage('L2: ASR Adapters') {
+ when {
+ anyOf {
+ branch 'r1.17.0'
+ changeRequest target: 'r1.17.0'
+ }
+ }
+ failFast true
+ parallel {
+ stage('Linear Adapters') {
+ steps {
+ sh 'python examples/asr/asr_adapters/train_asr_adapter.py \
+ model.pretrained_model="stt_en_conformer_ctc_small" \
+ model.adapter.adapter_name="an4" \
+ model.adapter.linear.in_features=176 \
+ model.train_ds.manifest_filepath=/home/TestData/an4_dataset/an4_train.json \
+ model.validation_ds.manifest_filepath=/home/TestData/an4_dataset/an4_val.json \
+ trainer.max_steps=5 \
+ trainer.devices=[0] \
+ trainer.accelerator="gpu" \
+ +trainer.fast_dev_run=True \
+ exp_manager.exp_dir=examples/asr/speech_to_text_adapters_results'
+ sh 'rm -rf examples/asr/speech_to_text_adapters_results'
+ }
+ }
+ stage('RelPos MHA Adapters') {
+ steps {
+ sh 'python examples/asr/asr_adapters/train_asr_adapter.py \
+ model.pretrained_model="stt_en_conformer_ctc_small" \
+ model.adapter.adapter_name="encoder:an4" \
+ model.adapter.adapter_type="tiny_attn" \
+ model.adapter.tiny_attn.n_feat=176 \
+ model.train_ds.manifest_filepath=/home/TestData/an4_dataset/an4_train.json \
+ model.validation_ds.manifest_filepath=/home/TestData/an4_dataset/an4_val.json \
+ trainer.max_steps=5 \
+ trainer.devices=[0] \
+ trainer.accelerator="gpu" \
+ +trainer.fast_dev_run=True \
+ exp_manager.exp_dir=examples/asr/speech_to_text_adapters_mha_results'
+ sh 'rm -rf examples/asr/speech_to_text_adapters_mha_results'
+ }
+ }
+
+ }
+ }
+ stage('L2: Megatron T5 Adapter PP=2') {
+ when {
+ anyOf {
+ branch 'r1.17.0'
+ changeRequest target: 'r1.17.0'
+ }
+ }
+ failFast true
+ parallel{
+ stage('T5 Adapter tuning & inference TP=1 PP=2') {
+ steps {
+ sh "python examples/nlp/language_modeling/tuning/megatron_t5_adapter_tuning.py \
+ --config-name=megatron_t5_adapter_tuning_config \
+ name='test_tp1_pp2' \
+ exp_manager.exp_dir='examples/adapter_tuning' \
+ trainer.devices=2 \
+ trainer.max_steps=1 \
+ trainer.val_check_interval=1 \
+ trainer.max_epochs=null \
+ model.data.num_workers=1 \
+ model.tensor_model_parallel_size=1 \
+ model.pipeline_model_parallel_size=2 \
+ model.language_model_path='/home/TestData/nlp/megatron_t5/8m/megatron_t5_8m_tp1_pp2.nemo' \
+ model.existing_tasks=[] \
+ model.new_tasks=['rte'] \
+ model.data.train_ds=['/home/TestData/nlp/prompt_learning/rte_CI_test.jsonl'] \
+ model.data.validation_ds=['/home/TestData/nlp/prompt_learning/rte_CI_test.jsonl'] \
+ model.global_batch_size=4"
+ sh "python examples/nlp/language_modeling/tuning/megatron_t5_adapter_eval.py \
+ --config-name=megatron_t5_adapter_inference \
+ adapter_model_file='examples/adapter_tuning/test_tp1_pp2.nemo' \
+ language_model_path='/home/TestData/nlp/megatron_t5/8m/megatron_t5_8m_tp1_pp2.nemo' \
+ trainer.devices=2 \
+ data.num_workers=1 \
+ tensor_model_parallel_size=1 \
+ pipeline_model_parallel_size=2 \
+ data.global_batch_size=2 \
+ data.micro_batch_size=2 \
+ data.test_ds=['/home/TestData/nlp/prompt_learning/rte_CI_test.jsonl'] \
+ pred_file_path='examples/adapter_tuning/test_tp1_pp2/preds.txt'"
+ sh "rm -rf examples/adapter_tuning/test_tp1_pp2.nemo"
+ sh "rm -rf examples/adapter_tuning/test_tp1_pp2"
+ }
+ }
+ }
+ }
+ stage('L2: Megatron T5 Adapter TP=2') {
+ when {
+ anyOf {
+ branch 'r1.17.0'
+ changeRequest target: 'r1.17.0'
+ }
+ }
+ failFast true
+ parallel{
+ stage('T5 Adapter tuning & inference TP=2 PP=1') {
+ steps {
+ sh "python examples/nlp/language_modeling/tuning/megatron_t5_adapter_tuning.py \
+ --config-name=megatron_t5_adapter_tuning_config \
+ name='test_tp2_pp1' \
+ exp_manager.exp_dir='examples/adapter_tuning' \
+ trainer.devices=2 \
+ trainer.max_steps=1 \
+ trainer.val_check_interval=1 \
+ trainer.max_epochs=null \
+ model.data.num_workers=1 \
+ model.tensor_model_parallel_size=2 \
+ model.language_model_path='/home/TestData/nlp/megatron_t5/8m/megatron_t5_8m_tp2.nemo' \
+ model.existing_tasks=[] \
+ model.new_tasks=['rte'] \
+ model.data.train_ds=['/home/TestData/nlp/prompt_learning/rte_CI_test.jsonl'] \
+ model.data.validation_ds=['/home/TestData/nlp/prompt_learning/rte_CI_test.jsonl'] \
+ model.global_batch_size=4"
+ sh "python examples/nlp/language_modeling/tuning/megatron_t5_adapter_eval.py \
+ --config-name=megatron_t5_adapter_inference \
+ adapter_model_file='examples/adapter_tuning/test_tp2_pp1.nemo' \
+ language_model_path='/home/TestData/nlp/megatron_t5/8m/megatron_t5_8m_tp2.nemo' \
+ trainer.devices=2 \
+ tensor_model_parallel_size=2 \
+ data.global_batch_size=2 \
+ data.micro_batch_size=2 \
+ data.num_workers=1 \
+ data.test_ds=['/home/TestData/nlp/prompt_learning/rte_CI_test.jsonl'] \
+ pred_file_path='examples/adapter_tuning/test_tp2_pp1/preds.txt'"
+ sh "rm -rf examples/adapter_tuning/test_tp2_pp1.nemo"
+ sh "rm -rf examples/adapter_tuning/test_tp2_pp1"
+ }
+ }
+ }
+ }
+ stage('L2: Megatron T5 IA3 PP=2') {
+ when {
+ anyOf {
+ branch 'r1.17.0'
+ changeRequest target: 'r1.17.0'
+ }
+ }
+ failFast true
+ parallel{
+ stage('T5 IA3 tuning & inference TP=1 PP=2') {
+ steps {
+ sh "python examples/nlp/language_modeling/tuning/megatron_t5_ia3_tuning.py \
+ --config-name=megatron_t5_ia3_tuning_config \
+ name='test_tp1_pp2' \
+ exp_manager.exp_dir='examples/ia3_tuning' \
+ trainer.devices=2 \
+ trainer.max_steps=1 \
+ trainer.val_check_interval=1 \
+ trainer.max_epochs=null \
+ model.data.num_workers=1 \
+ model.tensor_model_parallel_size=1 \
+ model.pipeline_model_parallel_size=2 \
+ model.language_model_path='/home/TestData/nlp/megatron_t5/8m/megatron_t5_8m_tp1_pp2.nemo' \
+ model.existing_tasks=[] \
+ model.new_tasks=['rte'] \
+ model.data.train_ds=['/home/TestData/nlp/prompt_learning/rte_CI_test.jsonl'] \
+ model.data.validation_ds=['/home/TestData/nlp/prompt_learning/rte_CI_test.jsonl'] \
+ model.global_batch_size=4"
+ sh "python examples/nlp/language_modeling/tuning/megatron_t5_ia3_eval.py \
+ --config-name=megatron_t5_ia3_inference \
+ adapter_model_file='examples/ia3_tuning/test_tp1_pp2.nemo' \
+ language_model_path='/home/TestData/nlp/megatron_t5/8m/megatron_t5_8m_tp1_pp2.nemo' \
+ trainer.devices=2 \
+ data.num_workers=1 \
+ tensor_model_parallel_size=1 \
+ pipeline_model_parallel_size=2 \
+ data.global_batch_size=2 \
+ data.micro_batch_size=2 \
+ data.test_ds=['/home/TestData/nlp/prompt_learning/rte_CI_test.jsonl'] \
+ pred_file_path='examples/ia3_tuning/test_tp1_pp2/preds.txt'"
+ sh "rm -rf examples/ia3_tuning/test_tp1_pp2.nemo"
+ sh "rm -rf examples/ia3_tuning/test_tp1_pp2"
+ }
+ }
+ }
+ }
+ stage('L2: Megatron T5 IA3 TP=2') {
+ when {
+ anyOf {
+ branch 'r1.17.0'
+ changeRequest target: 'r1.17.0'
+ }
+ }
+ failFast true
+ parallel{
+ stage('T5 IA3 tuning & inference TP=2 PP=1') {
+ steps {
+ sh "python examples/nlp/language_modeling/tuning/megatron_t5_ia3_tuning.py \
+ --config-name=megatron_t5_ia3_tuning_config \
+ name='test_tp2_pp1' \
+ exp_manager.exp_dir='examples/ia3_tuning' \
+ trainer.devices=2 \
+ trainer.max_steps=1 \
+ trainer.val_check_interval=1 \
+ trainer.max_epochs=null \
+ model.data.num_workers=1 \
+ model.tensor_model_parallel_size=2 \
+ model.language_model_path='/home/TestData/nlp/megatron_t5/8m/megatron_t5_8m_tp2.nemo' \
+ model.existing_tasks=[] \
+ model.new_tasks=['rte'] \
+ model.data.train_ds=['/home/TestData/nlp/prompt_learning/rte_CI_test.jsonl'] \
+ model.data.validation_ds=['/home/TestData/nlp/prompt_learning/rte_CI_test.jsonl'] \
+ model.global_batch_size=4"
+ sh "python examples/nlp/language_modeling/tuning/megatron_t5_ia3_eval.py \
+ --config-name=megatron_t5_ia3_inference \
+ adapter_model_file='examples/ia3_tuning/test_tp2_pp1.nemo' \
+ language_model_path='/home/TestData/nlp/megatron_t5/8m/megatron_t5_8m_tp2.nemo' \
+ trainer.devices=2 \
+ data.num_workers=1 \
+ tensor_model_parallel_size=2 \
+ data.global_batch_size=2 \
+ data.micro_batch_size=2 \
+ data.test_ds=['/home/TestData/nlp/prompt_learning/rte_CI_test.jsonl'] \
+ pred_file_path='examples/ia3_tuning/test_tp2_pp1/preds.txt'"
+ sh "rm -rf examples/ia3_tuning/test_tp2_pp1.nemo"
+ sh "rm -rf examples/ia3_tuning/test_tp2_pp1"
+ }
+ }
+ }
+ }
+ stage('L2: Megatron GPT Adapter TP=2') {
+ when {
+ anyOf {
+ branch 'r1.17.0'
+ changeRequest target: 'r1.17.0'
+ }
+ }
+ failFast true
+ parallel{
+ stage('GPT Adapter tuning & inference TP=2 PP=1') {
+ steps {
+ sh "python examples/nlp/language_modeling/tuning/megatron_gpt_adapter_tuning.py \
+ --config-name=megatron_gpt_adapter_tuning_config \
+ name='test_tp2_pp1' \
+ exp_manager.exp_dir='examples/adapter_tuning' \
+ trainer.devices=2 \
+ trainer.max_steps=1 \
+ trainer.val_check_interval=1 \
+ trainer.max_epochs=null \
+ model.data.num_workers=1 \
+ model.tensor_model_parallel_size=2 \
+ model.language_model_path='/home/TestData/nlp/megatron_gpt/tiny/megatron_14m_gpt_tp2_pp1.nemo' \
+ model.existing_tasks=[] \
+ model.new_tasks=['rte'] \
+ model.data.train_ds=['/home/TestData/nlp/prompt_learning/rte_CI_test.jsonl'] \
+ model.data.validation_ds=['/home/TestData/nlp/prompt_learning/rte_CI_test.jsonl'] \
+ model.global_batch_size=4"
+ sh "python examples/nlp/language_modeling/tuning/megatron_gpt_adapter_eval.py \
+ --config-name=megatron_gpt_adapter_inference \
+ adapter_model_file='examples/adapter_tuning/test_tp2_pp1.nemo' \
+ gpt_model_file='/home/TestData/nlp/megatron_gpt/tiny/megatron_14m_gpt_tp2_pp1.nemo' \
+ inference.greedy=True \
+ num_workers=1 \
+ inference.add_BOS=False \
+ trainer.devices=2 \
+ tensor_model_parallel_size=2 \
+ data_paths=['/home/TestData/nlp/prompt_learning/rte_CI_test.jsonl']"
+ sh "rm -rf examples/adapter_tuning/test_tp2_pp1.nemo"
+ sh "rm -rf examples/adapter_tuning/test_tp2_pp1"
+ }
+ }
+ }
+ }
+ stage('L2: Megatron GPT Adapter PP=2') {
+ when {
+ anyOf {
+ branch 'r1.17.0'
+ changeRequest target: 'r1.17.0'
+ }
+ }
+ failFast true
+ parallel{
+ stage('GPT Adapter tuning & inference TP=1 PP=2') {
+ steps {
+ sh "python examples/nlp/language_modeling/tuning/megatron_gpt_adapter_tuning.py \
+ --config-name=megatron_gpt_adapter_tuning_config \
+ name='test_tp1_pp2' \
+ exp_manager.exp_dir='examples/adapter_tuning' \
+ trainer.devices=2 \
+ trainer.max_steps=1 \
+ trainer.val_check_interval=1 \
+ trainer.max_epochs=null \
+ model.data.num_workers=1 \
+ model.tensor_model_parallel_size=1 \
+ model.pipeline_model_parallel_size=2 \
+ model.language_model_path='/home/TestData/nlp/megatron_gpt/tiny/megatron_14m_gpt_tp1_pp2.nemo' \
+ model.existing_tasks=[] \
+ model.new_tasks=['rte'] \
+ model.data.train_ds=['/home/TestData/nlp/prompt_learning/rte_CI_test.jsonl'] \
+ model.data.validation_ds=['/home/TestData/nlp/prompt_learning/rte_CI_test.jsonl'] \
+ model.global_batch_size=4"
+ sh "python examples/nlp/language_modeling/tuning/megatron_gpt_adapter_eval.py \
+ --config-name=megatron_gpt_adapter_inference \
+ adapter_model_file='examples/adapter_tuning/test_tp1_pp2.nemo' \
+ gpt_model_file='/home/TestData/nlp/megatron_gpt/tiny/megatron_14m_gpt_tp1_pp2.nemo' \
+ inference.greedy=True \
+ inference.add_BOS=False \
+ trainer.devices=2 \
+ num_workers=1 \
+ tensor_model_parallel_size=2 \
+ data_paths=['/home/TestData/nlp/prompt_learning/rte_CI_test.jsonl']"
+ sh "rm -rf examples/adapter_tuning/test_tp1_pp2.nemo"
+ sh "rm -rf examples/adapter_tuning/test_tp1_pp2"
+ }
+ }
+ }
+ }
+ stage('L2: Speech Transcription') {
+ when {
+ anyOf {
+ branch 'r1.17.0'
+ changeRequest target: 'r1.17.0'
+ }
+ }
+ failFast true
+ parallel {
+ stage('Speech to Text Transcribe') {
+ steps {
+ sh 'python examples/asr/transcribe_speech.py \
+ pretrained_name="QuartzNet15x5Base-En" \
+ audio_dir="/home/TestData/an4_transcribe/test_subset/" \
+ output_filename="stt_test_res.json" \
+ amp=true'
+ sh 'rm -rf stt_test_res.json'
+ }
+ }
+ }
+ }
+ stage('L2: Transducer alignment') {
+ when {
+ anyOf {
+ branch 'r1.17.0'
+ changeRequest target: 'r1.17.0'
+ }
+ }
+ failFast true
+ parallel {
+ stage('Running pytest') {
+ steps {
+ sh 'pytest tests/collections/asr/decoding/rnnt_alignments_check.py --durations=-1'
+ }
+ }
+ }
+ }
+
+ stage('L2: Segmentation Tool') {
+ when {
+ anyOf {
+ branch 'r1.17.0'
+ changeRequest target: 'r1.17.0'
+ }
+ }
+ stages {
+ stage('Install ctc_segmentation requirements') {
+ steps {
+ sh 'cd tools/ctc_segmentation && \
+ pip install -r requirements.txt && \
+ apt-get update && apt-get install libsox-fmt-all -y'
+ }
+ }
+
+ stage('Parallel ctc_segmentation test') {
+ failFast true
+ parallel {
+ stage('L2: Eng CitriNet with .wav') {
+ steps {
+ sh 'cd tools/ctc_segmentation && \
+ TIME=`date +"%Y-%m-%d-%T"` && \
+ /bin/bash run_segmentation.sh \
+ --MODEL_NAME_OR_PATH="stt_en_citrinet_512_gamma_0_25" \
+ --DATA_DIR=/home/TestData/ctc_segmentation/eng \
+ --OUTPUT_DIR=/home/TestData/ctc_segmentation/eng/output${TIME} \
+ --LANGUAGE=en \
+ --USE_NEMO_NORMALIZATION="TRUE" && \
+ python /home/TestData/ctc_segmentation/verify_alignment.py \
+ -r /home/TestData/ctc_segmentation/eng/eng_valid_segments_1.7.txt \
+ -g /home/TestData/ctc_segmentation/eng/output${TIME}/verified_segments/nv_test_segments.txt && \
+ rm -rf /home/TestData/ctc_segmentation/eng/output${TIME}'
+ }
+ }
+ stage('L2: Ru QN with mp3') {
+ steps {
+ sh 'cd tools/ctc_segmentation && \
+ TIME=`date +"%Y-%m-%d-%T"` && \
+ /bin/bash run_segmentation.sh \
+ --MODEL_NAME_OR_PATH=/home/TestData/ctc_segmentation/QuartzNet15x5-Ru-e512-wer14.45.nemo \
+ --DATA_DIR=/home/TestData/ctc_segmentation/ru \
+ --OUTPUT_DIR=/home/TestData/ctc_segmentation/ru/output${TIME} \
+ --LANGUAGE=ru \
+ --ADDITIONAL_SPLIT_SYMBOLS=";" && \
+ python /home/TestData/ctc_segmentation/verify_alignment.py \
+ -r /home/TestData/ctc_segmentation/ru/valid_ru_segments_1.7.txt \
+ -g /home/TestData/ctc_segmentation/ru/output${TIME}/verified_segments/ru_segments.txt && \
+ rm -rf /home/TestData/ctc_segmentation/ru/output${TIME}'
+ }
+ }
+ }
+ }
+ }
+ }
+
+ stage('L2: G2P Models') {
+ when {
+ anyOf {
+ branch 'r1.17.0'
+ changeRequest target: 'r1.17.0'
+ }
+ }
+ failFast true
+ parallel {
+ stage('G2P Conformer training, evaluation and inference') {
+ steps {
+ sh 'cd examples/tts/g2p && \
+ TIME=`date +"%Y-%m-%d-%T"` && OUTPUT_DIR_CONFORMER=output_ctc_${TIME} && \
+ python g2p_train_and_evaluate.py \
+ train_manifest=/home/TestData/g2p/g2p.json \
+ validation_manifest=/home/TestData/g2p/g2p.json \
+ model.test_ds.manifest_filepath=/home/TestData/g2p/g2p.json \
+ model.tokenizer.dir=/home/TestData/g2p/tokenizer_spe_unigram_v512 \
+ trainer.max_epochs=1 \
+ model.max_source_len=64 \
+ trainer.devices=[0] \
+ do_training=True \
+ do_testing=True \
+ exp_manager.exp_dir=${OUTPUT_DIR_CONFORMER} \
+ +exp_manager.use_datetime_version=False\
+ +exp_manager.version=test \
+ --config-name=g2p_conformer_ctc && \
+ python g2p_inference.py \
+ pretrained_model=${OUTPUT_DIR_CONFORMER}/G2P-Conformer-CTC/test/checkpoints/G2P-Conformer-CTC.nemo \
+ manifest_filepath=/home/TestData/g2p/g2p.json \
+ phoneme_field=text'
+ }
+ }
+ stage('ByT5G2P training, evaluation and inference') {
+ steps {
+ sh 'TRANSFORMERS_OFFLINE=0 && 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 \
+ validation_manifest=/home/TestData/g2p/g2p.json \
+ model.test_ds.manifest_filepath=/home/TestData/g2p/g2p.json \
+ trainer.max_epochs=1 \
+ model.max_source_len=64 \
+ trainer.devices=[1] \
+ do_training=True \
+ do_testing=True \
+ exp_manager.exp_dir=${OUTPUT_DIR_T5} \
+ +exp_manager.use_datetime_version=False\
+ +exp_manager.version=test && \
+ python g2p_inference.py \
+ pretrained_model=${OUTPUT_DIR_T5}/T5G2P/test/checkpoints/T5G2P.nemo \
+ manifest_filepath=/home/TestData/g2p/g2p.json \
+ phoneme_field=text && TRANSFORMERS_OFFLINE=1'
+ }
+ }
+ stage('HeteronymClassificationModel training, evaluation and inference') {
+ steps {
+ sh 'cd examples/tts/g2p && \
+ TIME=`date +"%Y-%m-%d-%T"` && OUTPUT_DIR=output_${TIME} && \
+ python g2p_heteronym_classification_train_and_evaluate.py \
+ train_manifest=/home/TestData/g2p/manifest.json \
+ validation_manifest=/home/TestData/g2p/manifest.json \
+ test_manifest=/home/TestData/g2p/manifest.json \
+ model.wordids=/home/TestData/g2p/wordids.tsv \
+ trainer.max_epochs=1 \
+ model.max_seq_length=64 \
+ do_training=True \
+ do_testing=True \
+ exp_manager.exp_dir=${OUTPUT_DIR} \
+ +exp_manager.use_datetime_version=False\
+ +exp_manager.version=test && \
+ python g2p_heteronym_classification_inference.py \
+ manifest=/home/TestData/g2p/manifest.json \
+ pretrained_model=${OUTPUT_DIR}/HeteronymClassification/test/checkpoints/HeteronymClassification.nemo \
+ output_manifest=preds.json'
+ }
+ }
+ }
+ }
+
+ // TODO: add test once megatron-bert is supported again
+ // stage('L2: Multi-GPU Megatron finetuning') {
+ // when {
+ // anyOf {
+ // branch 'r1.17.0'
+ // changeRequest target: 'r1.17.0'
+ // }
+ // }
+ // failFast true
+ // parallel {
+ // stage('L2: Cased Megatron finetuning on MRPC') {
+ // steps {
+ // sh 'cd examples/nlp/glue_benchmark && \
+ // python glue_benchmark.py \
+ // model.dataset.data_dir=/home/TestData/nlp/glue_fake/MRPC \
+ // trainer.devices=[0,1] \
+ // trainer.accelerator="gpu" \
+ // +trainer.fast_dev_run=true \
+ // model.dataset.use_cache=false \
+ // model.language_model.pretrained_model_name=megatron-bert-345m-cased \
+ // trainer.accelerator=gpu \
+ // trainer.strategy=ddp \
+ // exp_manager=null'
+ // }
+ // }
+ // }
+ // }
+
+ stage('L2: STS-b') {
+ when {
+ anyOf {
+ branch 'r1.17.0'
+ changeRequest target: 'r1.17.0'
+ }
+ }
+ failFast true
+ parallel {
+ stage('GLUE STS-b with AlBERT') {
+ steps {
+ sh 'python examples/nlp/glue_benchmark/glue_benchmark.py \
+ model.dataset.use_cache=false \
+ model.task_name=sts-b \
+ model.dataset.data_dir=/home/TestData/nlp/glue_fake/STS-B \
+ trainer.devices=[1] \
+ trainer.accelerator="gpu" \
+ +trainer.fast_dev_run=True \
+ model.language_model.pretrained_model_name=albert-base-v1 \
+ exp_manager=null'
+ }
+ }
+ stage('Test Restore Punctuation & Capitalization with AlBERT') {
+ steps {
+ sh 'data_dir="$(mktemp -d -p "$(pwd)")" && \
+ cp /home/TestData/nlp/token_classification_punctuation/*.txt "${data_dir}"/ && \
+ python examples/nlp/token_classification/punctuation_capitalization_train_evaluate.py \
+ +do_training=false \
+ +do_testing=true \
+ pretrained_model=/home/TestData/nlp/pretrained_models/Punctuation_and_Capitalization_albert.nemo \
+ +model.test_ds.use_cache=false \
+ ~model.train_ds \
+ ~model.validation_ds \
+ model.test_ds.ds_item="${data_dir}" \
+ trainer.devices=[1] \
+ trainer.accelerator="gpu" \
+ exp_manager=null && \
+ rm -rf "${data_dir}"'
+ }
+ }
+// stage('Test Restore Punctuation & Capitalization with RoBERTa') {
+// steps {
+// sh 'data_dir="$(mktemp -d -p "$(pwd)")" && \
+// cp /home/TestData/nlp/token_classification_punctuation/*.txt "${data_dir}"/ && \
+// python examples/nlp/token_classification/punctuation_capitalization_train_evaluate.py \
+// +do_training=false \
+// +do_testing=true \
+// pretrained_model=/home/TestData/nlp/pretrained_models/Punctuation_and_Capitalization_roberta.nemo \
+// +model.test_ds.use_cache=false \
+// ~model.train_ds \
+// ~model.validation_ds \
+// model.test_ds.ds_item="${data_dir}" \
+// trainer.devices=[1] \
+// trainer.accelerator="gpu" \
+// exp_manager=null && \
+// rm -rf "${data_dir}"'
+// }
+// }
+ }
+ }
+ stage('L2: Dialogue Classification') {
+ when {
+ anyOf {
+ branch 'r1.17.0'
+ changeRequest target: 'r1.17.0'
+ }
+ }
+ failFast true
+ parallel {
+ stage('Dialogue: Intent and slot classification using GPT') {
+ steps {
+ sh 'TRANSFORMERS_OFFLINE=0 && 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\
+ model.tokenizer.vocab_file=/home/TestData/nlp/gpt2/vocab.json\
+ model.dataset.dialogues_example_dir=sgd_gen_outputs \
+ model.dataset.task_name=debug_sample \
+ trainer.max_steps=1 \
+ trainer.max_epochs=1 \
+ model.train_ds.batch_size=2 \
+ model.validation_ds.batch_size=2 \
+ model.test_ds.batch_size=2 \
+ model.nemo_path=null \
+ trainer.val_check_interval=0.0 \
+ trainer.devices=[0] \
+ model.dataset.use_cache=false \
+ model.tokenizer.special_tokens={pad_token:"endoftext"} \
+ model.tokenizer.tokenizer_name=gpt2 \
+ model.tokenizer.vocab_file=/home/TestData/nlp/gpt2/vocab.json\
+ model.language_model.pretrained_model_name=/home/TestData/nlp/gpt2 \
+ trainer.accelerator=gpu \
+ exp_manager=null && \
+ rm -rf sgd_gen_outputs'
+ }
+ }
+ stage('Intent and slot classification using SGDQA') {
+ steps {
+ sh 'TRANSFORMERS_OFFLINE=0 && 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 \
+ model.dataset.task_name=debug_sample \
+ trainer.max_steps=1 \
+ trainer.max_epochs=1 \
+ model.train_ds.batch_size=2 \
+ model.validation_ds.batch_size=2 \
+ model.test_ds.batch_size=2 \
+ model.dataset.num_tasks=6 \
+ model.nemo_path=null \
+ trainer.val_check_interval=0.0 \
+ trainer.devices=[0] \
+ model.dataset.use_cache=false \
+ model.language_model.pretrained_model_name=bert-base-cased \
+ trainer.accelerator=gpu \
+ exp_manager=null && \
+ rm -rf sgd_gen_bert_outputs'
+ }
+ }
+ stage('Intent and slot classification using IntentSlotClassificationModel') {
+ steps {
+ sh 'TRANSFORMERS_OFFLINE=0 && 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 \
+ model.dataset.task=assistant \
+ trainer.max_steps=1 \
+ trainer.max_epochs=1 \
+ model.train_ds.batch_size=2 \
+ model.validation_ds.batch_size=2 \
+ model.test_ds.batch_size=2 \
+ model.nemo_path=null \
+ trainer.val_check_interval=0.0 \
+ trainer.devices=[0] \
+ model.dataset.use_cache=false \
+ model.language_model.pretrained_model_name=bert-base-uncased \
+ trainer.accelerator=gpu \
+ exp_manager=null && \
+ rm -rf sgd_gen_bert_intent_classification_outputs && TRANSFORMERS_OFFLINE=1'
+ }
+ }
+ stage('Intent classification using ZeroShotIntentModel') {
+ steps {
+ sh 'TRANSFORMERS_OFFLINE=0 && cd examples/nlp/dialogue && \
+ python dialogue.py \
+ do_training=False \
+ model.dataset.data_dir=/home/TestData/nlp/drive_thru_revised \
+ model.original_nemo_checkpoint=/home/TestData/nlp/drive_thru_revised/zeroshotintent_en_bert_base_uncased.nemo \
+ model.dataset.dialogues_example_dir=sgd_gen_zero_shot_intent_classification_outputs \
+ model.dataset.task=zero_shot \
+ model.dataset.prompt_template="This example is" \
+ trainer.max_steps=1 \
+ trainer.max_epochs=1 \
+ model.train_ds.batch_size=2 \
+ model.validation_ds.batch_size=2 \
+ model.test_ds.batch_size=2 \
+ model.nemo_path=null \
+ trainer.val_check_interval=0.0 \
+ trainer.devices=[1] \
+ model.dataset.use_cache=false \
+ model.language_model.pretrained_model_name=bert-base-uncased \
+ trainer.accelerator=gpu \
+ exp_manager=null && \
+ rm -rf sgd_gen_zero_shot_intent_classification_outputs && TRANSFORMERS_OFFLINE=1'
+ }
+ }
+ stage('Design Intent classification using ZeroShotIntentModel') {
+ steps {
+ sh 'TRANSFORMERS_OFFLINE=0 && cd examples/nlp/dialogue && \
+ python dialogue.py \
+ do_training=False \
+ model.dataset.data_dir=/home/TestData/nlp/design_dataset \
+ model.original_nemo_checkpoint=/home/TestData/nlp/drive_thru_revised/zeroshotintent_en_bert_base_uncased.nemo \
+ model.dataset.dialogues_example_dir=design_zero_shot_intent_classification_outputs \
+ model.dataset.task=design \
+ model.dataset.prompt_template="This example is related to" \
+ model.library=megatron \
+ trainer.max_steps=1 \
+ trainer.max_epochs=1 \
+ model.train_ds.batch_size=2 \
+ model.validation_ds.batch_size=2 \
+ model.test_ds.batch_size=2 \
+ model.nemo_path=null \
+ trainer.val_check_interval=0.0 \
+ trainer.devices=[1] \
+ model.dataset.use_cache=false \
+ model.language_model.pretrained_model_name=bert-base-uncased \
+ trainer.accelerator=gpu \
+ exp_manager=null && \
+ rm -rf design_zero_shot_intent_classification_outputs && TRANSFORMERS_OFFLINE=1'
+ }
+ }
+ stage('Design Intent classification using ZeroShotIntentModel BART Classifier') {
+ steps {
+ sh 'TRANSFORMERS_OFFLINE=0 && cd examples/nlp/dialogue && \
+ python dialogue.py \
+ do_training=False \
+ model.dataset.data_dir=/home/TestData/nlp/design_dataset \
+ model.original_nemo_checkpoint=/home/TestData/nlp/drive_thru_revised/zeroshotintent_en_bert_base_uncased.nemo \
+ model.dataset.dialogues_example_dir=design_zero_shot_intent_classification_bart_outputs \
+ model.dataset.task=design \
+ model.dataset.prompt_template="This example is related to" \
+ model.library=huggingface \
+ trainer.devices=[1] \
+ model.dataset.use_cache=false \
+ model.language_model.pretrained_model_name=bert-base-uncased \
+ trainer.accelerator=gpu \
+ exp_manager=null && \
+ rm -rf design_zero_shot_intent_classification_bart_outputs && TRANSFORMERS_OFFLINE=1'
+ }
+ }
+ stage('Design Intent classification using DialogueNearestNeighbourModel') {
+ steps {
+ sh 'TRANSFORMERS_OFFLINE=0 && cd examples/nlp/dialogue && \
+ python dialogue.py \
+ do_training=False \
+ model.dataset.data_dir=/home/TestData/nlp/design_dataset \
+ model.dataset.dialogues_example_dir=design_dialogue_nearest_neighbour_classification_outputs \
+ model.dataset.task=design \
+ model.dataset.prompt_template="" \
+ model.library=huggingface \
+ trainer.devices=[0] \
+ model.dataset.use_cache=false \
+ model.language_model.pretrained_model_name=sentence-transformers/all-MiniLM-L6-v2 \
+ trainer.accelerator=gpu \
+ exp_manager=null && \
+ rm -rf design_dialogue_nearest_neighbour_classification_outputs && TRANSFORMERS_OFFLINE=1'
+ }
+ }
+ }
+ }
+ stage('L2: Dialogue Generation') {
+ when {
+ anyOf {
+ branch 'r1.17.0'
+ changeRequest target: 'r1.17.0'
+ }
+ }
+ failFast true
+ parallel {
+ stage('Dialogue: Answer Extender using DialogueS2SGenerationModel') {
+ steps {
+ sh 'TRANSFORMERS_OFFLINE=0 && cd examples/nlp/dialogue && \
+ python dialogue.py \
+ do_training=False \
+ model.dataset.data_dir=/home/TestData/nlp/ms-marco-qa \
+ model.dataset.dialogues_example_dir=answer_extender_s2s \
+ model.dataset.task=ms_marco \
+ model.library=huggingface \
+ model.dataset.debug_mode=True \
+ trainer.max_steps=1 \
+ trainer.max_epochs=1 \
+ model.train_ds.batch_size=2 \
+ model.validation_ds.batch_size=2 \
+ model.test_ds.batch_size=2 \
+ model.nemo_path=null \
+ trainer.val_check_interval=0.0 \
+ trainer.devices=[1] \
+ model.dataset.use_cache=false \
+ model.language_model.pretrained_model_name=facebook/bart-large \
+ trainer.accelerator=gpu \
+ exp_manager=null && \
+ rm -rf answer_extender_s2s'
+ }
+ }
+ stage('Dialogue: SGD Based Answer Extender using DialogueS2SGenerationModel') {
+ steps {
+ sh 'TRANSFORMERS_OFFLINE=0 && cd examples/nlp/dialogue && \
+ python dialogue.py \
+ do_training=False \
+ model.dataset.data_dir=/home/TestData/nlp/sgd_small \
+ model.dataset.dialogues_example_dir=sgd_answer_extender_s2s \
+ model.dataset.task_name=debug_sample \
+ model.dataset.task=sgd_generation \
+ model.dataset.input_field=utterance+system_actions \
+ model.dataset.output_field=system_utterance \
+ model.dataset.use_cache=false \
+ model.dataset.system_utterance=next_turn \
+ model.dataset.debug_mode=True \
+ model.dataset.prompt_template=slots_values \
+ model.library=huggingface \
+ trainer.max_steps=1 \
+ trainer.max_epochs=1 \
+ model.train_ds.batch_size=2 \
+ model.validation_ds.batch_size=2 \
+ model.test_ds.batch_size=2 \
+ model.nemo_path=null \
+ trainer.val_check_interval=0.0 \
+ trainer.devices=[0] \
+ model.language_model.pretrained_model_name=facebook/bart-large \
+ trainer.accelerator=gpu \
+ exp_manager=null && \
+ rm -rf sgd_answer_extender_s2s'
+ }
+ }
+ }
+ }
+// stage('L2: Dialogue Generation Part 2') {
+// when {
+// anyOf {
+// branch 'r1.17.0'
+// changeRequest target: 'r1.17.0'
+// }
+// }
+// failFast true
+// parallel {
+// stage('Dialogue: Answer Extender using DialogueGPTGenerationModel') {
+// steps {
+// sh 'TRANSFORMERS_OFFLINE=0 && cd examples/nlp/dialogue && \
+// python dialogue.py \
+// do_training=False \
+// model.dataset.data_dir=/home/TestData/nlp/ms-marco-qa \
+// model.dataset.dialogues_example_dir=answer_extender \
+// model.library=huggingface \
+// model.dataset.task=ms_marco \
+// model.dataset.debug_mode=True \
+// trainer.val_check_interval=0.0 \
+// trainer.devices=[0] \
+// model.dataset.use_cache=false \
+// model.language_model.pretrained_model_name=gpt2 \
+// trainer.accelerator=gpu \
+// exp_manager=null && \
+// rm -rf answer_extender'
+// }
+// }
+// }
+// }
+ stage('L2: COPY') {
+ when {
+ anyOf {
+ branch 'r1.17.0'
+ changeRequest target: 'r1.17.0'
+ }
+ }
+ failFast true
+ parallel {
+ stage('Dialogue: Answer Extender using DialogueGPTGenerationModel') {
+ steps {
+ sh 'TRANSFORMERS_OFFLINE=0 && cd examples/nlp/dialogue && \
+ python dialogue.py \
+ do_training=False \
+ model.dataset.data_dir=/home/TestData/nlp/ms-marco-qa \
+ model.dataset.dialogues_example_dir=answer_extender \
+ model.library=huggingface \
+ model.dataset.task=ms_marco \
+ model.dataset.debug_mode=True \
+ trainer.val_check_interval=0.0 \
+ trainer.devices=[0] \
+ model.dataset.use_cache=false \
+ model.language_model.pretrained_model_name=gpt2 \
+ trainer.accelerator=gpu \
+ exp_manager=null && \
+ rm -rf answer_extender'
+ }
+ }
+ }
+ }
+ stage('L2: Duplex Text Normalization') {
+ when {
+ anyOf {
+ branch 'r1.17.0'
+ changeRequest target: 'r1.17.0'
+ }
+ }
+ failFast true
+ parallel {
+ stage('Duplex Text Normalization with Tarred dataset') {
+ steps {
+ sh 'cd examples/nlp/duplex_text_normalization && \
+ python duplex_text_normalization_train.py \
+ data.validation_ds.data_path=/home/TestData/nlp/duplex_text_norm/small_test.tsv \
+ mode=tn \
+ lang=en \
+ tagger_model.do_training=false \
+ decoder_model.transformer=t5-small \
+ data.validation_ds.batch_size=2 \
+ data.train_ds.use_cache=false \
+ data.validation_ds.use_cache=false \
+ data.test_ds.batch_size=2 \
+ data.train_ds.decoder_data_augmentation=false \
+ data.train_ds.num_workers=2 \
+ decoder_trainer.devices=[0,1] \
+ decoder_trainer.accelerator="gpu" \
+ data.train_ds.use_tarred_dataset=true \
+ +decoder_trainer.fast_dev_run=true \
+ decoder_exp_manager.create_checkpoint_callback=false \
+ data.train_ds.tar_metadata_file=/home/TestData/nlp/duplex_text_norm/tarred_small/metadata.json \
+ data.test_ds.use_cache=false \
+ data.test_ds.data_path=/home/TestData/nlp/duplex_text_norm/small_test.tsv'
+ }
+ }
+ }
+ }
+ // Runs out of memory on the 12G TITAN V (GPU 0 on main CI)
+ // TODO: add when megatron bert is supported again in NeMo
+ // stage('L2: MegaBERT Token Classification') {
+ // when {
+ // anyOf {
+ // branch 'r1.17.0'
+ // changeRequest target: 'r1.17.0'
+ // }
+ // }
+ // failFast true
+ // steps {
+ // sh 'cd examples/nlp/token_classification && \
+ // python token_classification_train.py \
+ // model.dataset.data_dir=/home/TestData/nlp/token_classification_punctuation/ \
+ // model.language_model.pretrained_model_name=megatron-bert-345m-uncased \
+ // model.train_ds.batch_size=10 \
+ // model.dataset.max_seq_length=50 \
+ // model.dataset.use_cache=false \
+ // trainer.accelerator=gpu \
+ // trainer.strategy=ddp \
+ // trainer.precision=16 \
+ // trainer.devices=[1] \
+ // trainer.accelerator="gpu" \
+ // +trainer.fast_dev_run=true \
+ // exp_manager=null'
+ // }
+ // }
+
+ stage('L2: BERT Text Classification') {
+ when {
+ anyOf {
+ branch 'r1.17.0'
+ changeRequest target: 'r1.17.0'
+ }
+ }
+ failFast true
+ parallel {
+ stage ('Text Classification with BERT Test') {
+ steps {
+ sh 'cd examples/nlp/text_classification && \
+ python text_classification_with_bert.py \
+ model.dataset.num_classes=6 \
+ model.train_ds.file_path=/home/TestData/nlp/retail_text_classification/train.tsv \
+ model.validation_ds.file_path=/home/TestData/nlp/retail_text_classification/dev.tsv \
+ model.language_model.pretrained_model_name=distilbert-base-uncased \
+ model.train_ds.batch_size=10 \
+ model.dataset.max_seq_length=50 \
+ model.dataset.use_cache=false \
+ trainer.devices=[0] \
+ trainer.accelerator="gpu" \
+ +trainer.fast_dev_run=true \
+ exp_manager=null'
+ }
+ }
+ }
+ }
+
+ stage('L2: Parallel BERT Question-Answering SQUAD v1.1 & v2.0') {
+ when {
+ anyOf {
+ branch 'r1.17.0'
+ changeRequest target: 'r1.17.0'
+ }
+ }
+ failFast true
+ parallel {
+ 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 && \
+ python question_answering.py \
+ model.train_ds.file=/home/TestData/nlp/squad_mini/v1.1/train-v1.1.json \
+ model.dataset.use_cache=false \
+ model.validation_ds.file=/home/TestData/nlp/squad_mini/v1.1/dev-v1.1.json \
+ model.test_ds.file=/home/TestData/nlp/squad_mini/v1.1/dev-v1.1.json \
+ model.train_ds.batch_size=2 \
+ model.train_ds.num_samples=2 \
+ model.validation_ds.batch_size=2 \
+ model.validation_ds.num_samples=2 \
+ model.test_ds.num_samples=2 \
+ model.test_ds.batch_size=2 \
+ trainer.max_epochs=1 \
+ trainer.max_steps=1 \
+ model.language_model.pretrained_model_name=bert-base-uncased \
+ model.dataset.version_2_with_negative=false \
+ trainer.precision=16 \
+ trainer.devices=[0] \
+ trainer.accelerator="gpu" \
+ exp_manager=null && TRANSFORMERS_OFFLINE=1'
+ }
+ }
+ 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 && \
+ python question_answering.py \
+ model.train_ds.file=/home/TestData/nlp/squad_mini/v2.0/train-v2.0.json \
+ model.dataset.use_cache=false \
+ model.train_ds.batch_size=2 \
+ model.train_ds.num_samples=2 \
+ model.validation_ds.batch_size=2 \
+ model.validation_ds.num_samples=2 \
+ trainer.max_epochs=1 \
+ trainer.max_steps=1 \
+ model.validation_ds.file=/home/TestData/nlp/squad_mini/v2.0/dev-v2.0.json \
+ model.language_model.pretrained_model_name=bert-base-uncased \
+ model.dataset.version_2_with_negative=true \
+ trainer.precision=16 \
+ trainer.devices=[1] \
+ trainer.accelerator="gpu" \
+ exp_manager=null && TRANSFORMERS_OFFLINE=1'
+ }
+ }
+ }
+ }
+
+ stage('L2: Parallel BART Question-Answering SQUAD v1.1 & v2.0') {
+ when {
+ anyOf {
+ branch 'r1.17.0'
+ changeRequest target: 'r1.17.0'
+ }
+ }
+ failFast true
+ parallel {
+ 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 && \
+ python question_answering.py \
+ model.train_ds.file=/home/TestData/nlp/squad_mini/v1.1/train-v1.1.json \
+ model.dataset.use_cache=false \
+ model.dataset.check_if_answer_in_context=false \
+ model.validation_ds.file=/home/TestData/nlp/squad_mini/v1.1/dev-v1.1.json \
+ model.test_ds.file=/home/TestData/nlp/squad_mini/v1.1/dev-v1.1.json \
+ model.train_ds.batch_size=2 \
+ model.train_ds.num_samples=2 \
+ model.validation_ds.batch_size=2 \
+ model.validation_ds.num_samples=2 \
+ model.test_ds.num_samples=2 \
+ model.test_ds.batch_size=2 \
+ trainer.max_epochs=1 \
+ trainer.max_steps=1 \
+ model.language_model.pretrained_model_name=facebook/bart-base \
+ model.dataset.version_2_with_negative=false \
+ trainer.precision=16 \
+ trainer.devices=[0] \
+ trainer.accelerator="gpu" \
+ exp_manager=null && TRANSFORMERS_OFFLINE=1'
+ }
+ }
+ 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 && \
+ python question_answering.py \
+ model.train_ds.file=/home/TestData/nlp/squad_mini/v2.0/train-v2.0.json \
+ model.dataset.use_cache=false \
+ model.dataset.check_if_answer_in_context=false \
+ model.train_ds.batch_size=2 \
+ model.train_ds.num_samples=2 \
+ model.validation_ds.batch_size=2 \
+ model.validation_ds.num_samples=2 \
+ trainer.max_epochs=1 \
+ trainer.max_steps=1 \
+ model.validation_ds.file=/home/TestData/nlp/squad_mini/v2.0/dev-v2.0.json \
+ model.language_model.pretrained_model_name=facebook/bart-base \
+ model.dataset.version_2_with_negative=true \
+ trainer.precision=16 \
+ trainer.devices=[1] \
+ trainer.accelerator="gpu" \
+ exp_manager=null && TRANSFORMERS_OFFLINE=1'
+ }
+ }
+ }
+ }
+
+ stage('L2: Parallel GPT2 Question-Answering SQUAD v1.1 & v2.0') {
+ when {
+ anyOf {
+ branch 'r1.17.0'
+ changeRequest target: 'r1.17.0'
+ }
+ }
+ failFast true
+ parallel {
+ 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 && \
+ python question_answering.py \
+ model.train_ds.file=/home/TestData/nlp/squad_mini/v1.1/train-v1.1.json \
+ model.dataset.use_cache=false \
+ model.dataset.check_if_answer_in_context=false \
+ model.validation_ds.file=/home/TestData/nlp/squad_mini/v1.1/dev-v1.1.json \
+ model.test_ds.file=/home/TestData/nlp/squad_mini/v1.1/dev-v1.1.json \
+ model.train_ds.batch_size=2 \
+ model.train_ds.num_samples=2 \
+ model.validation_ds.batch_size=2 \
+ model.validation_ds.num_samples=2 \
+ model.test_ds.num_samples=2 \
+ model.test_ds.batch_size=2 \
+ trainer.max_epochs=1 \
+ trainer.max_steps=1 \
+ model.language_model.pretrained_model_name=gpt2 \
+ model.dataset.version_2_with_negative=false \
+ trainer.precision=16 \
+ trainer.devices=[0] \
+ trainer.accelerator="gpu" \
+ exp_manager=null && TRANSFORMERS_OFFLINE=1'
+ }
+ }
+ 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 && \
+ python question_answering.py \
+ model.train_ds.file=/home/TestData/nlp/squad_mini/v2.0/train-v2.0.json \
+ model.dataset.use_cache=false \
+ model.dataset.check_if_answer_in_context=false \
+ model.train_ds.batch_size=2 \
+ model.train_ds.num_samples=2 \
+ model.validation_ds.batch_size=2 \
+ model.validation_ds.num_samples=2 \
+ trainer.max_epochs=1 \
+ trainer.max_steps=1 \
+ model.validation_ds.file=/home/TestData/nlp/squad_mini/v2.0/dev-v2.0.json \
+ model.language_model.pretrained_model_name=gpt2 \
+ model.dataset.version_2_with_negative=true \
+ trainer.precision=16 \
+ trainer.devices=[1] \
+ trainer.accelerator="gpu" \
+ exp_manager=null && TRANSFORMERS_OFFLINE=1'
+ }
+ }
+ }
+ }
+
+ stage('L2: Intent and Slot Classification Tasks') {
+ when {
+ anyOf {
+ branch 'r1.17.0'
+ changeRequest target: 'r1.17.0'
+ }
+ }
+ failFast true
+ parallel {
+ stage('L2: Intent and Slot Classification') {
+ steps {
+ sh 'cd examples/nlp/intent_slot_classification && \
+ python intent_slot_classification.py \
+ model.data_dir=/home/TestData/nlp/retail \
+ model.validation_ds.prefix=dev \
+ model.test_ds.prefix=dev \
+ trainer.devices=[0] \
+ trainer.accelerator="gpu" \
+ +trainer.fast_dev_run=true \
+ exp_manager.exp_dir=checkpoints'
+ sh 'rm -rf checkpoints'
+ }
+ }
+ stage('L2: Multi-Label Intent and Slot Classification') {
+ steps {
+ sh 'cd examples/nlp/intent_slot_classification && \
+ python multi_label_intent_slot_classification.py \
+ model.data_dir=/home/TestData/nlp/new_multiatis \
+ model.validation_ds.prefix=dev \
+ model.test_ds.prefix=dev \
+ trainer.devices=[0] \
+ +trainer.fast_dev_run=true \
+ exp_manager.exp_dir=checkpoints2'
+ sh 'rm -rf checkpoints2'
+ }
+ }
+ }
+ }
+
+ // TODO: add when megatron-bert is supported again
+ // stage('L2: Model Parallel Size 2 Megatron Text Classification') {
+ // when {
+ // anyOf{
+ // branch 'r1.17.0'
+ // changeRequest target: 'r1.17.0'
+ // }
+ // }
+ // failFast true
+ // steps{
+ // sh 'cd examples/nlp/text_classification && \
+ // python text_classification_with_bert.py \
+ // trainer.devices=[0,1] \
+ // trainer.accelerator="gpu" \
+ // trainer.num_nodes=1 \
+ // trainer.precision=16 \
+ // trainer.gradient_clip_val=1.0 \
+ // +trainer.fast_dev_run=true \
+ // model.dataset.num_classes=6 \
+ // model.train_ds.file_path=/home/TestData/nlp/retail_text_classification/train.tsv \
+ // model.train_ds.batch_size=4 \
+ // model.language_model.pretrained_model_name=megatron-bert-uncased \
+ // model.language_model.config_file=/home/TestData/nlp/mp_2_bert_toy/config.json \
+ // model.language_model.lm_checkpoint=/home/TestData/nlp/mp_2_bert_toy/iter_2000000 \
+ // model.nemo_path=null \
+ // ~model.infer_samples \
+ // exp_manager=null'
+ // }
+ // }
+
+ // stage('L2: Model Parallel Size 2 Megatron Autoresume') {
+ // when {
+ // anyOf{
+ // branch 'r1.17.0'
+ // changeRequest target: 'r1.17.0'
+ // }
+ // }
+ // failFast true
+ // steps{
+ // sh 'cd examples/nlp/text_classification && \
+ // python text_classification_with_bert.py \
+ // trainer.devices=[0,1] \
+ // trainer.accelerator="gpu" \
+ // trainer.num_nodes=1 \
+ // trainer.precision=16 \
+ // trainer.gradient_clip_val=1.0 \
+ // trainer.max_epochs=1 \
+ // +trainer.fast_dev_run=true \
+ // model.dataset.num_classes=6 \
+ // model.train_ds.file_path=/home/TestData/nlp/retail_text_classification/train.tsv \
+ // model.train_ds.batch_size=4 \
+ // model.language_model.pretrained_model_name=megatron-bert-uncased \
+ // model.language_model.config_file=/home/TestData/nlp/mp_2_bert_toy/config.json \
+ // model.language_model.lm_checkpoint=/home/TestData/nlp/mp_2_bert_toy/iter_2000000 \
+ // model.nemo_path=null \
+ // ~model.infer_samples \
+ // +exp_manager.explicit_log_dir=/home/TestData/nlp/mp_autoresume \
+ // +exp_manager.resume_if_exists=true'
+ // }
+ // }
+
+ // stage('L2: Model Parallel Size 2 Megatron Evaluation from .nemo') {
+ // when {
+ // anyOf{
+ // branch 'r1.17.0'
+ // changeRequest target: 'r1.17.0'
+ // }
+ // }
+ // failFast true
+ // steps{
+ // sh 'cd examples/nlp/text_classification && \
+ // python model_parallel_text_classification_evaluation.py \
+ // trainer.devices=[0,1] \
+ // trainer.accelerator="gpu" \
+ // trainer.num_nodes=1 \
+ // model.dataset.num_classes=6 \
+ // model.test_ds.file_path=/home/TestData/nlp/retail_text_classification/dev.tsv \
+ // model.nemo_path=/home/TestData/nlp/mp_2_nemo/retail_text_class_350M.nemo \
+ // exp_manager=null'
+ // }
+ // }
+
+ // stage('L2: Model Parallel Size 2 Megatron Train from .nemo') {
+ // when {
+ // anyOf{
+ // branch 'r1.17.0'
+ // changeRequest target: 'r1.17.0'
+ // }
+ // }
+ // failFast true
+ // steps{
+ // sh 'cd examples/nlp/token_classification && \
+ // python token_classification_train.py \
+ // pretrained_model=/home/TestData/nlp/mp_2_nemo/ner_350M.nemo \
+ // model.dataset.data_dir=/home/TestData/nlp/ner/ \
+ // model.train_ds.batch_size=2 \
+ // model.dataset.use_cache=false \
+ // trainer.devices=[0,1] \
+ // trainer.accelerator="gpu" \
+ // +trainer.fast_dev_run=true \
+ // model.dataset.class_balancing="weighted_loss" \
+ // exp_manager=null'
+ // }
+ // }
+
+ stage('L2: Parallel NLP Examples 2') {
+ when {
+ anyOf {
+ branch 'r1.17.0'
+ changeRequest target: 'r1.17.0'
+ }
+ }
+ failFast true
+ parallel {
+ stage ('NER finetuning from pretrained Test') {
+ steps {
+ sh 'cd examples/nlp/token_classification && \
+ python token_classification_train.py \
+ pretrained_model=ner_en_bert \
+ model.dataset.data_dir=/home/TestData/nlp/ner/ \
+ model.train_ds.batch_size=2 \
+ model.dataset.use_cache=false \
+ trainer.devices=[0] \
+ trainer.accelerator="gpu" \
+ +trainer.fast_dev_run=true \
+ model.dataset.class_balancing="weighted_loss" \
+ exp_manager.exp_dir=null'
+ }
+ }
+ stage ('Punctuation and capitalization finetuning from pretrained test') {
+ steps {
+ sh 'cd examples/nlp/token_classification && \
+ data_dir="$(mktemp -d -p "$(pwd)")" && \
+ cp /home/TestData/nlp/token_classification_punctuation/*.txt "${data_dir}"/ && \
+ python punctuation_capitalization_train_evaluate.py \
+ pretrained_model=punctuation_en_bert \
+ model.train_ds.ds_item="${data_dir}" \
+ model.validation_ds.ds_item="${data_dir}" \
+ model.test_ds.ds_item="${data_dir}" \
+ +model.train_ds.use_cache=false \
+ +model.validation_ds.use_cache=false \
+ +model.test_ds.use_cache=false \
+ trainer.devices=[1] \
+ trainer.accelerator="gpu" \
+ +trainer.fast_dev_run=true \
+ exp_manager.exp_dir=null && \
+ rm -rf "${data_dir}"'
+ }
+ }
+ stage ('NER with TurkuNLP/bert-base-finnish-cased-v1') {
+ steps {
+ sh 'cd examples/nlp/token_classification && \
+ python token_classification_train.py \
+ model.dataset.data_dir=/home/TestData/nlp/token_classification_punctuation/ \
+ trainer.devices=[0] \
+ trainer.accelerator="gpu" \
+ +trainer.fast_dev_run=true \
+ model.dataset.use_cache=false \
+ model.language_model.pretrained_model_name="TurkuNLP/bert-base-finnish-cased-v1" \
+ exp_manager.exp_dir=null'
+ }
+ }
+ stage('Evaluation script for Token Classification') {
+ steps {
+ sh 'python examples/nlp/token_classification/token_classification_evaluate.py \
+ model.dataset.data_dir=/home/TestData/nlp/ner/ \
+ model.dataset.use_cache=false \
+ pretrained_model=/home/TestData/nlp/pretrained_models/NER_Model_with_BERT_base_uncased.nemo'
+ }
+ }
+ stage('Evaluation script for Punctuation') {
+ steps {
+ sh 'data_dir="$(mktemp -d -p "$(pwd)")" && \
+ cp /home/TestData/nlp/token_classification_punctuation/*.txt "${data_dir}"/ && \
+ python examples/nlp/token_classification/punctuation_capitalization_train_evaluate.py \
+ +do_training=false \
+ +do_testing=true \
+ model.test_ds.ds_item="${data_dir}" \
+ ~model.train_ds \
+ ~model.validation_ds \
+ +model.test_ds.use_cache=false \
+ pretrained_model=/home/TestData/nlp/pretrained_models/Punctuation_Capitalization_with_DistilBERT_base_uncased.nemo && \
+ rm -rf "${data_dir}"'
+ }
+ }
+ stage('L2: Punctuation & Capitalization, 2GPUs with DistilBERT, Fine-tuning on different data') {
+ steps {
+ sh 'cd examples/nlp/token_classification && \
+ output_dir="$(mktemp -d -p "$(pwd)")" && \
+ tmp_data_dir="$(mktemp -d -p "$(pwd)")" && \
+ cp /home/TestData/nlp/token_classification_punctuation/*.txt "${tmp_data_dir}"/ && \
+ python punctuation_capitalization_train_evaluate.py \
+ model.train_ds.use_tarred_dataset=false \
+ model.train_ds.ds_item="${tmp_data_dir}" \
+ model.validation_ds.ds_item="${tmp_data_dir}" \
+ model.test_ds.ds_item="${tmp_data_dir}" \
+ model.language_model.pretrained_model_name=distilbert-base-uncased \
+ +model.train_ds.use_cache=false \
+ +model.validation_ds.use_cache=false \
+ +model.test_ds.use_cache=false \
+ trainer.devices=[0,1] \
+ trainer.accelerator="gpu" \
+ trainer.strategy=ddp \
+ trainer.max_epochs=1 \
+ +exp_manager.explicit_log_dir="${output_dir}" \
+ +do_testing=true && \
+ tmp_data_dir_2="$(mktemp -d -p "$(pwd)")" && \
+ mv "${tmp_data_dir}"/* "${tmp_data_dir_2}" && \
+ rm -rf "${tmp_data_dir}" && \
+ python punctuation_capitalization_train_evaluate.py \
+ model.train_ds.use_tarred_dataset=false \
+ model.train_ds.ds_item="${tmp_data_dir_2}" \
+ model.validation_ds.ds_item="${tmp_data_dir_2}" \
+ model.test_ds.ds_item="${tmp_data_dir_2}" \
+ pretrained_model="${output_dir}/checkpoints/Punctuation_and_Capitalization.nemo" \
+ +model.train_ds.use_cache=false \
+ +model.validation_ds.use_cache=false \
+ +model.test_ds.use_cache=false \
+ trainer.devices=[0,1] \
+ trainer.accelerator="gpu" \
+ trainer.strategy=ddp \
+ trainer.max_epochs=1 \
+ exp_manager=null && \
+ rm -rf /workspace/NeMo/examples/nlp/token_classification/nemo_experiments \
+ "${tmp_data_dir_2}" \
+ "${output_dir}"'
+ }
+ }
+ }
+ }
+ stage('Punctuation & Capitalization tarred dataset') {
+ when {
+ anyOf {
+ branch 'r1.17.0'
+ changeRequest target: 'r1.17.0'
+ }
+ }
+ failFast true
+ stages {
+ stage('create and use tarred dataset') {
+ steps {
+ sh 'data_dir="$(mktemp -d -p "$(pwd)")" && \
+ cp -r /home/TestData/nlp/token_classification_punctuation/*.txt \
+ /home/TestData/nlp/token_classification_punctuation/wmt_wiki_10000 \
+ "${data_dir}"/ && \
+ usual_data=${data_dir}/wmt_wiki_10000 && \
+ output_dir="$(mktemp -d -p "$(pwd)")" && \
+ tarred_data=${output_dir}/train_tarred && \
+ tokens_in_batch=2000 && \
+ max_seq_length=512 && \
+ lm_model=distilbert-base-uncased && \
+ python examples/nlp/token_classification/data/create_punctuation_capitalization_tarred_dataset.py \
+ --text ${usual_data}/input.txt \
+ --labels ${usual_data}/labels.txt \
+ --output_dir ${tarred_data} \
+ --tokens_in_batch ${tokens_in_batch} \
+ --max_seq_length 512 \
+ --lines_per_dataset_fragment 2000 \
+ --num_batches_per_tarfile 5 \
+ --tar_file_prefix punctuation_capitalization \
+ --tokenizer_name ${lm_model} \
+ --use_fast_tokenizer \
+ --pad_label O \
+ --n_jobs 3 && \
+ echo "Number of tarred files in dataset:" && \
+ ls ${tarred_data}/*.tar | wc -l && \
+ echo "Label id files in dataset:" && \
+ ls ${tarred_data}/*.csv && \
+ metadata_file=${tarred_data}/metadata.punctuation_capitalization.tokens${tokens_in_batch}.max_seq_length${max_seq_length}.${lm_model}.json && \
+ python examples/nlp/token_classification/punctuation_capitalization_train_evaluate.py \
+ model.validation_ds.ds_item="${data_dir}" \
+ model.test_ds.ds_item="${data_dir}" \
+ model.train_ds.ds_item=${tarred_data} \
+ model.language_model.pretrained_model_name=${lm_model} \
+ model.train_ds.use_tarred_dataset=true \
+ model.train_ds.tar_metadata_file=${metadata_file} \
+ +model.train_ds.use_cache=false \
+ +model.validation_ds.use_cache=false \
+ +model.test_ds.use_cache=false \
+ trainer.devices=[0,1] \
+ trainer.accelerator="gpu" \
+ trainer.strategy=ddp \
+ trainer.max_epochs=1 \
+ +exp_manager.explicit_log_dir=${output_dir}/output && \
+ rm -rf "${output_dir}" "${data_dir}"'
+ }
+ }
+ }
+ }
+ stage('Punctuation & Capitalization, Different ways of passing labels to model') {
+ when {
+ anyOf {
+ branch 'r1.17.0'
+ changeRequest target: 'r1.17.0'
+ }
+ }
+ failFast true
+ stages {
+ stage('Punctuation & Capitalization, Using model.common_datasest_parameters.label_vocab_dir') {
+ steps {
+ sh 'cd examples/nlp/token_classification && \
+ work_dir="$(mktemp -d -p "$(pwd)")" && \
+ label_vocab_dir="${work_dir}/labels" && \
+ mkdir -p ${label_vocab_dir} && \
+ data_dir="${work_dir}/data" && \
+ mkdir -p "${data_dir}" && \
+ cp /home/TestData/nlp/token_classification_punctuation/*.txt "${data_dir}" && \
+ output_dir="${work_dir}/output" && \
+ mkdir -p "${output_dir}" && \
+ punct_label_vocab="${label_vocab_dir}/punct_label_vocab.csv" && \
+ capit_label_vocab="${label_vocab_dir}/capit_label_vocab.csv" && \
+ printf "O\n,\n.\n?\n" > "${punct_label_vocab}" && \
+ printf "O\nU\n" > "${capit_label_vocab}" && \
+ python punctuation_capitalization_train_evaluate.py \
+ model.train_ds.use_tarred_dataset=false \
+ model.train_ds.ds_item="${data_dir}" \
+ model.validation_ds.ds_item="${data_dir}" \
+ model.test_ds.ds_item="${data_dir}" \
+ model.language_model.pretrained_model_name=distilbert-base-uncased \
+ model.common_dataset_parameters.label_vocab_dir="${label_vocab_dir}" \
+ model.class_labels.punct_labels_file="$(basename "${punct_label_vocab}")" \
+ model.class_labels.capit_labels_file="$(basename "${capit_label_vocab}")" \
+ +model.train_ds.use_cache=false \
+ +model.validation_ds.use_cache=false \
+ +model.test_ds.use_cache=false \
+ trainer.devices=[0,1] \
+ trainer.strategy=ddp \
+ trainer.max_epochs=1 \
+ +exp_manager.explicit_log_dir="${output_dir}" \
+ +do_testing=false && \
+ python punctuation_capitalization_train_evaluate.py \
+ +do_training=false \
+ +do_testing=true \
+ ~model.train_ds \
+ ~model.validation_ds \
+ model.test_ds.ds_item="${data_dir}" \
+ pretrained_model="${output_dir}/checkpoints/Punctuation_and_Capitalization.nemo" \
+ +model.train_ds.use_cache=false \
+ +model.validation_ds.use_cache=false \
+ +model.test_ds.use_cache=false \
+ trainer.devices=[0,1] \
+ trainer.strategy=ddp \
+ trainer.max_epochs=1 \
+ exp_manager=null && \
+ rm -rf "${work_dir}"'
+ }
+ }
+ stage('Punctuation & Capitalization, Using model.common_datasest_parameters.{punct,capit}_label_ids') {
+ steps {
+ sh 'cd examples/nlp/token_classification && \
+ work_dir="$(mktemp -d -p "$(pwd)")" && \
+ output_dir="${work_dir}/output" && \
+ mkdir -p "${output_dir}" && \
+ data_dir="${work_dir}/data" && \
+ mkdir -p "${data_dir}" && \
+ cp /home/TestData/nlp/token_classification_punctuation/*.txt "${data_dir}" && \
+ conf_name=punctuation_capitalization_config_with_ids && \
+ cp conf/punctuation_capitalization_config.yaml "${work_dir}/${conf_name}.yaml" && \
+ sed -i $\'s/punct_label_ids: null/punct_label_ids: {O: 0, \\\',\\\': 1, .: 2, \\\'?\\\': 3}/\' \
+ "${work_dir}/${conf_name}.yaml" && \
+ sed -i $\'s/capit_label_ids: null/capit_label_ids: {O: 0, U: 1}/\' \
+ "${work_dir}/${conf_name}.yaml" && \
+ python punctuation_capitalization_train_evaluate.py \
+ --config-path "${work_dir}" \
+ --config-name "${conf_name}" \
+ model.train_ds.use_tarred_dataset=false \
+ model.train_ds.ds_item="${data_dir}" \
+ model.validation_ds.ds_item="${data_dir}" \
+ model.test_ds.ds_item="${data_dir}" \
+ model.language_model.pretrained_model_name=distilbert-base-uncased \
+ +model.train_ds.use_cache=false \
+ +model.validation_ds.use_cache=false \
+ +model.test_ds.use_cache=false \
+ trainer.devices=[0,1] \
+ trainer.strategy=ddp \
+ trainer.max_epochs=1 \
+ +exp_manager.explicit_log_dir="${output_dir}" \
+ +do_testing=false && \
+ python punctuation_capitalization_train_evaluate.py \
+ +do_training=false \
+ +do_testing=true \
+ ~model.train_ds \
+ ~model.validation_ds \
+ model.test_ds.ds_item="${data_dir}" \
+ pretrained_model="${output_dir}/checkpoints/Punctuation_and_Capitalization.nemo" \
+ +model.train_ds.use_cache=false \
+ +model.validation_ds.use_cache=false \
+ +model.test_ds.use_cache=false \
+ trainer.devices=[0,1] \
+ trainer.strategy=ddp \
+ trainer.max_epochs=1 \
+ exp_manager=null && \
+ rm -rf "${work_dir}"'
+ }
+ }
+ }
+ }
+ stage('Punctuation & Capitalization inference') {
+ when {
+ anyOf {
+ branch 'r1.17.0'
+ changeRequest target: 'r1.17.0'
+ }
+ }
+ failFast true
+ stages {
+ stage('Restore punctuation and capitalization in long text') {
+ steps {
+ sh 'output_dir="$(mktemp -d -p "$(pwd)")" && \
+ python examples/nlp/token_classification/punctuate_capitalize_infer.py \
+ --input_manifest /home/TestData/nlp/token_classification_punctuation/iwslt_tst2019.manifest \
+ --output_text "${output_dir}/iwslt_inference_result.txt" \
+ --max_seq_length 92 \
+ --step 8 \
+ --margin 16 \
+ --pretrained_name punctuation_en_bert \
+ --batch_size 32 && \
+ rm -rf "${output_dir}"'
+ }
+ }
+ }
+ }
+
+ stage('L2: Parallel Pretraining BERT pretraining from Text/Preprocessed') {
+ when {
+ anyOf {
+ branch 'r1.17.0'
+ changeRequest target: 'r1.17.0'
+ }
+ }
+ failFast true
+ parallel {
+ stage('L2: Pretraining BERT pretraining from Text') {
+ steps {
+ sh 'cd examples/nlp/language_modeling && \
+ python bert_pretraining.py \
+ --config-name=bert_pretraining_from_text_config.yaml \
+ trainer.devices=[0] \
+ trainer.accelerator="gpu" \
+ trainer.precision=16 \
+ +trainer.fast_dev_run=true \
+ model.train_ds.data_file=/home/TestData/nlp/wikitext-2/train.txt \
+ model.train_ds.batch_size=32 \
+ model.validation_ds.data_file=/home/TestData/nlp/wikitext-2/valid.txt \
+ model.validation_ds.batch_size=32 \
+ model.language_model.config_file=/home/TestData/nlp/bert_configs/bert_3200.json \
+ model.optim.lr=0.01 \
+ model.optim.sched.warmup_ratio=0.1 \
+ model.tokenizer.tokenizer_name=sentencepiece \
+ model.tokenizer.tokenizer_model=/home/TestData/nlp/wikitext-2/tokenizer_bpe_v3193/tokenizer.model \
+ model.mask_prob=0.15 \
+ model.short_seq_prob=0.1 \
+ exp_manager.exp_dir=PretrainingBERTFromText \
+ '
+ sh 'rm -f /home/TestData/nlp/wikitext-2/*.pkl'
+ sh 'rm -rf examples/nlp/language_modeling/PretrainingBERTFromText'
+ sh 'ls -lha examples/nlp/language_modeling'
+ }
+ }
+ stage('L2: Pretraining BERT from Preprocessed') {
+ steps {
+ sh 'cd examples/nlp/language_modeling && \
+ python bert_pretraining.py \
+ --config-name=bert_pretraining_from_preprocessed_config.yaml \
+ trainer.devices=[1] \
+ trainer.accelerator="gpu" \
+ trainer.precision=16 \
+ +trainer.fast_dev_run=true \
+ model.train_ds.data_file=/home/TestData/nlp/wiki_book_mini/training \
+ model.train_ds.batch_size=8 \
+ model.language_model.lm_checkpoint=/home/TestData/nlp/bert_ckpts/nemo1.0/bert_base_uncased_mlm_final_1074591_nemo1.0.pt \
+ model.language_model.config_file=/home/TestData/nlp/bert_configs/uncased_L-12_H-768_A-12.json \
+ model.optim.lr=0.875e-4 \
+ model.optim.weight_decay=0.01 \
+ model.optim.sched.warmup_ratio=0.01 \
+ exp_manager.exp_dir=PretrainingBERTFromPreprocessed \
+ exp_manager.create_checkpoint_callback=False \
+ '
+ sh 'rm -rf examples/nlp/language_modeling/PretrainingBERTFromPreprocessed'
+ sh 'ls -lha examples/nlp/language_modeling'
+ }
+ }
+ }
+ }
+
+ stage('L2: Entity Linking') {
+ when {
+ anyOf {
+ branch 'r1.17.0'
+ changeRequest target: 'r1.17.0'
+ }
+ }
+ failFast true
+ parallel {
+ stage ('Self Alignment Pretraining BERT') {
+ steps {
+ sh 'cd examples/nlp/entity_linking && \
+ python self_alignment_pretraining.py \
+ project_dir=. \
+ trainer.val_check_interval=3 \
+ model.raw_data=None \
+ model.train_ds.data_file=/home/TestData/nlp/entity_linking/tiny_example_train_pairs.tsv \
+ model.validation_ds.data_file=/home/TestData/nlp/entity_linking/tiny_example_validation_pairs.tsv \
+ model.train_ds.batch_size=8 \
+ model.validation_ds.batch_size=8 \
+ exp_manager.exp_dir=null'
+ }
+ }
+ }
+ }
+
+ // TODO: remove +model.optim.capturable=True when Pytorch fix: https://github.com/pytorch/pytorch/pull/81858
+ // is in the release container
+ stage('L2: NMT Attention is All You Need Training') {
+ when {
+ anyOf {
+ branch 'r1.17.0'
+ changeRequest target: 'r1.17.0'
+ }
+ }
+ failFast true
+ parallel {
+ stage('L2: NMT Training Post-LN') {
+ steps {
+ sh 'python examples/nlp/machine_translation/enc_dec_nmt.py \
+ --config-path=conf \
+ --config-name=aayn_base \
+ do_testing=false \
+ model.train_ds.src_file_name=/home/TestData/nlp/nmt/toy_data/wmt14-de-en.src \
+ model.train_ds.tgt_file_name=/home/TestData/nlp/nmt/toy_data/wmt14-de-en.ref \
+ model.validation_ds.src_file_name=/home/TestData/nlp/nmt/toy_data/wmt14-de-en.src \
+ model.validation_ds.tgt_file_name=/home/TestData/nlp/nmt/toy_data/wmt14-de-en.src \
+ model.test_ds.src_file_name=/home/TestData/nlp/nmt/toy_data/wmt14-de-en.src \
+ model.test_ds.tgt_file_name=/home/TestData/nlp/nmt/toy_data/wmt14-de-en.src \
+ model.encoder_tokenizer.tokenizer_model=/home/TestData/nlp/nmt/toy_data/tt_tokenizer.BPE.4096.model \
+ model.decoder_tokenizer.tokenizer_model=/home/TestData/nlp/nmt/toy_data/tt_tokenizer.BPE.4096.model \
+ model.encoder.num_layers=1 \
+ model.encoder.hidden_size=64 \
+ model.encoder.inner_size=256 \
+ model.decoder.num_layers=1 \
+ model.decoder.hidden_size=64 \
+ model.decoder.inner_size=256 \
+ +model.optim.capturable=True \
+ trainer.devices=[0] \
+ trainer.accelerator="gpu" \
+ +trainer.val_check_interval=2 \
+ +trainer.limit_val_batches=1 \
+ +trainer.max_steps=2 \
+ trainer.precision=16 \
+ +exp_manager.explicit_log_dir=examples/nlp/machine_translation/nmt_results \
+ +exp_manager.create_checkpoint_callback=true \
+ '
+ sh 'python examples/nlp/machine_translation/enc_dec_nmt.py \
+ --config-path=conf \
+ --config-name=aayn_base \
+ do_testing=true \
+ model.train_ds.src_file_name=/home/TestData/nlp/nmt/toy_data/wmt14-de-en.src \
+ model.train_ds.tgt_file_name=/home/TestData/nlp/nmt/toy_data/wmt14-de-en.ref \
+ model.validation_ds.src_file_name=/home/TestData/nlp/nmt/toy_data/wmt14-de-en.src \
+ model.validation_ds.tgt_file_name=/home/TestData/nlp/nmt/toy_data/wmt14-de-en.src \
+ model.test_ds.src_file_name=/home/TestData/nlp/nmt/toy_data/wmt14-de-en.src \
+ model.test_ds.tgt_file_name=/home/TestData/nlp/nmt/toy_data/wmt14-de-en.src \
+ model.encoder_tokenizer.tokenizer_model=/home/TestData/nlp/nmt/toy_data/tt_tokenizer.BPE.4096.model \
+ model.decoder_tokenizer.tokenizer_model=/home/TestData/nlp/nmt/toy_data/tt_tokenizer.BPE.4096.model \
+ model.encoder.num_layers=1 \
+ model.encoder.hidden_size=64 \
+ model.encoder.inner_size=256 \
+ model.decoder.num_layers=1 \
+ model.decoder.hidden_size=64 \
+ model.decoder.inner_size=256 \
+ +model.optim.capturable=True \
+ trainer.devices=[0] \
+ trainer.accelerator="gpu" \
+ +trainer.val_check_interval=10 \
+ +trainer.limit_val_batches=1 \
+ +trainer.limit_test_batches=1 \
+ +trainer.max_steps=10 \
+ +exp_manager.explicit_log_dir=examples/nlp/machine_translation/nmt_results \
+ +exp_manager.create_checkpoint_callback=true \
+ +exp_manager.resume_if_exists=True \
+ '
+ sh 'rm -rf examples/nlp/machine_translation/nmt_results'
+ }
+ }
+
+ stage('L2: NMT Training Pre-LN') {
+ steps {
+ sh 'cd examples/nlp/machine_translation && \
+ python enc_dec_nmt.py \
+ --config-path=conf \
+ --config-name=aayn_base \
+ do_testing=true \
+ model.train_ds.src_file_name=/home/TestData/nlp/nmt/toy_data/wmt14-de-en.src \
+ model.train_ds.tgt_file_name=/home/TestData/nlp/nmt/toy_data/wmt14-de-en.ref \
+ model.validation_ds.src_file_name=/home/TestData/nlp/nmt/toy_data/wmt14-de-en.src \
+ model.validation_ds.tgt_file_name=/home/TestData/nlp/nmt/toy_data/wmt14-de-en.src \
+ model.test_ds.src_file_name=/home/TestData/nlp/nmt/toy_data/wmt14-de-en.src \
+ model.test_ds.tgt_file_name=/home/TestData/nlp/nmt/toy_data/wmt14-de-en.src \
+ model.encoder_tokenizer.tokenizer_model=/home/TestData/nlp/nmt/toy_data/tt_tokenizer.BPE.4096.model \
+ model.decoder_tokenizer.tokenizer_model=/home/TestData/nlp/nmt/toy_data/tt_tokenizer.BPE.4096.model \
+ model.encoder.pre_ln=true \
+ model.decoder.pre_ln=true \
+ trainer.devices=[1] \
+ trainer.accelerator="gpu" \
+ +trainer.fast_dev_run=true \
+ +trainer.limit_test_batches=2 \
+ exp_manager=null \
+ '
+ }
+ }
+ stage('L2: NMT Multi-Validation') {
+ steps {
+ sh 'cd examples/nlp/machine_translation && \
+ python enc_dec_nmt.py \
+ --config-path=conf \
+ --config-name=aayn_base \
+ do_testing=true \
+ model.train_ds.src_file_name=/home/TestData/nlp/nmt/toy_data/wmt14-en-de.src \
+ model.train_ds.tgt_file_name=/home/TestData/nlp/nmt/toy_data/wmt14-en-de.ref \
+ model.validation_ds.src_file_name=[/home/TestData/nlp/nmt/toy_data/wmt13-en-de.src,/home/TestData/nlp/nmt/toy_data/wmt14-en-de.src] \
+ model.validation_ds.tgt_file_name=[/home/TestData/nlp/nmt/toy_data/wmt13-en-de.ref,/home/TestData/nlp/nmt/toy_data/wmt14-en-de.ref] \
+ model.test_ds.src_file_name=[/home/TestData/nlp/nmt/toy_data/wmt13-en-de.src,/home/TestData/nlp/nmt/toy_data/wmt14-en-de.src] \
+ model.test_ds.tgt_file_name=[/home/TestData/nlp/nmt/toy_data/wmt13-en-de.ref,/home/TestData/nlp/nmt/toy_data/wmt14-en-de.ref] \
+ model.encoder_tokenizer.tokenizer_model=/home/TestData/nlp/nmt/toy_data/tt_tokenizer.BPE.4096.model \
+ model.decoder_tokenizer.tokenizer_model=/home/TestData/nlp/nmt/toy_data/tt_tokenizer.BPE.4096.model \
+ trainer.devices=[0] \
+ trainer.accelerator="gpu" \
+ +trainer.fast_dev_run=true \
+ +trainer.limit_test_batches=2 \
+ exp_manager=null \
+ '
+ }
+ }
+ }
+ }
+
+ stage('L2: NMT Attention is All You Need Inference') {
+ when {
+ anyOf {
+ branch 'r1.17.0'
+ changeRequest target: 'r1.17.0'
+ }
+ }
+ failFast true
+ parallel {
+ stage('L2: NMT Inference - PostLN') {
+ steps {
+ sh 'cd examples/nlp/machine_translation && \
+ python nmt_transformer_infer.py \
+ --model=/home/TestData/nlp/nmt/toy_data/TransformerLargeDe-En.nemo \
+ --srctext=/home/TestData/nlp/nmt/toy_data/wmt14-de-en.test.src \
+ --tgtout=/home/TestData/nlp/nmt/toy_data/out.txt \
+ --target_lang en \
+ --source_lang de \
+ '
+ }
+ }
+ stage('L2: NMT Inference - Pre-LN') {
+ steps {
+ sh 'cd examples/nlp/machine_translation && \
+ python nmt_transformer_infer.py \
+ --model=/home/TestData/nlp/nmt/toy_data/en_de_24x6_preln.nemo \
+ --srctext=/home/TestData/nlp/nmt/toy_data/wmt14-en-de.test.src \
+ --tgtout=/home/TestData/nlp/nmt/toy_data/out.txt \
+ --target_lang de \
+ --source_lang en \
+ '
+ }
+ }
+ }
+ }
+
+ stage('L2: NMT Attention is All You Need Finetuning') {
+ when {
+ anyOf {
+ branch 'r1.17.0'
+ changeRequest target: 'r1.17.0'
+ }
+ }
+ failFast true
+ steps {
+ sh "cd examples/nlp/machine_translation && \
+ python enc_dec_nmt_finetune.py \
+ model_path=/home/TestData/nlp/nmt/toy_data/en_de_24x6_preln.nemo \
+ trainer.devices=[0] \
+ ~trainer.max_epochs \
+ model.train_ds.src_file_name=/home/TestData/nlp/nmt/toy_data/wmt14-de-en.src \
+ model.train_ds.tgt_file_name=/home/TestData/nlp/nmt/toy_data/wmt14-de-en.ref \
+ model.validation_ds.src_file_name=/home/TestData/nlp/nmt/toy_data/wmt14-de-en.src \
+ model.validation_ds.tgt_file_name=/home/TestData/nlp/nmt/toy_data/wmt14-de-en.src \
+ model.test_ds.src_file_name=/home/TestData/nlp/nmt/toy_data/wmt14-de-en.src \
+ model.test_ds.tgt_file_name=/home/TestData/nlp/nmt/toy_data/wmt14-de-en.src \
+ +trainer.val_check_interval=10 \
+ +trainer.limit_val_batches=1 \
+ +trainer.limit_test_batches=1 \
+ +trainer.max_steps=10 \
+ +exp_manager.exp_dir=examples/nlp/machine_translation/nmt_finetune \
+ +exp_manager.create_checkpoint_callback=True \
+ +exp_manager.checkpoint_callback_params.monitor=val_sacreBLEU \
+ +exp_manager.checkpoint_callback_params.mode=max \
+ +exp_manager.checkpoint_callback_params.save_best_model=true \
+ "
+ sh "rm -rf examples/nlp/machine_translation/nmt_finetune"
+ }
+ }
+
+
+ stage('L2: NMT Tarred Dataset Creation') {
+ when {
+ anyOf {
+ branch 'r1.17.0'
+ changeRequest target: 'r1.17.0'
+ }
+ }
+ failFast true
+ parallel {
+ stage('L2: NMT Auto Tarred Dataset Creation') {
+ steps {
+ sh 'cd examples/nlp/machine_translation && \
+ python enc_dec_nmt.py \
+ --config-path=conf \
+ --config-name=aayn_base \
+ do_training=false \
+ model.preproc_out_dir=$PWD/preproc_out_dir \
+ model.train_ds.use_tarred_dataset=true \
+ model.train_ds.n_preproc_jobs=2 \
+ model.train_ds.lines_per_dataset_fragment=500 \
+ model.train_ds.num_batches_per_tarfile=10 \
+ model.train_ds.src_file_name=/home/TestData/nlp/nmt/toy_data/wmt14-de-en.src \
+ model.train_ds.tgt_file_name=/home/TestData/nlp/nmt/toy_data/wmt14-de-en.ref \
+ model.validation_ds.src_file_name=/home/TestData/nlp/nmt/toy_data/wmt14-de-en.src \
+ model.validation_ds.tgt_file_name=/home/TestData/nlp/nmt/toy_data/wmt14-de-en.src \
+ model.encoder_tokenizer.vocab_size=2000 \
+ model.decoder_tokenizer.vocab_size=2000 \
+ ~model.test_ds \
+ trainer.devices=[0] \
+ trainer.accelerator="gpu" \
+ +trainer.fast_dev_run=true \
+ exp_manager=null \
+ '
+ }
+ }
+
+ stage('L2: NMT Script Tarred Dataset Creation') {
+ steps {
+ sh 'cd examples/nlp/machine_translation && \
+ python create_tarred_parallel_dataset.py \
+ --src_fname /home/TestData/nlp/nmt/toy_data/wmt14-de-en.src \
+ --tgt_fname /home/TestData/nlp/nmt/toy_data/wmt14-de-en.ref \
+ --out_dir $PWD/out_dir \
+ --encoder_tokenizer_vocab_size=2000 \
+ --decoder_tokenizer_vocab_size=2000 \
+ --tokens_in_batch=1000 \
+ --lines_per_dataset_fragment=500 \
+ --num_batches_per_tarfile=10 \
+ --n_preproc_jobs=2 \
+ '
+ }
+ }
+ }
+ }
+ stage('L2: Megatron NMT Training TP=2') {
+ when {
+ anyOf {
+ branch 'r1.17.0'
+ changeRequest target: 'r1.17.0'
+ }
+ }
+ failFast true
+ steps {
+ sh "python examples/nlp/machine_translation/megatron_nmt_training.py \
+ trainer.devices=2 \
+ trainer.accelerator=gpu \
+ trainer.log_every_n_steps=1 \
+ trainer.val_check_interval=10 \
+ +trainer.limit_val_batches=2 \
+ trainer.accumulate_grad_batches=1 \
+ trainer.max_steps=10 \
+ trainer.precision=16 \
+ trainer.gradient_clip_val=1.0 \
+ exp_manager.exp_dir=examples/nlp/machine_translation/megatron_nmt_results \
+ model.tensor_model_parallel_size=2 \
+ model.seq_length=128 \
+ model.encoder.num_layers=4 \
+ model.encoder.hidden_size=64 \
+ model.encoder.num_attention_heads=8 \
+ model.encoder.activation='swiglu' \
+ model.encoder.masked_softmax_fusion=False \
+ model.encoder.bias_activation_fusion=False \
+ model.encoder.activations_checkpoint_method='block' \
+ model.encoder.activations_checkpoint_num_layers=1 \
+ model.decoder.num_layers=2 \
+ model.decoder.hidden_size=64 \
+ model.decoder.num_attention_heads=8 \
+ model.decoder.activation='swiglu' \
+ model.decoder.masked_softmax_fusion=False \
+ model.decoder.bias_activation_fusion=False \
+ model.decoder.activations_checkpoint_method='block' \
+ model.decoder.activations_checkpoint_num_layers=1 \
+ model.micro_batch_size=2 \
+ model.global_batch_size=4 \
+ model.train_ds.src_file_name=/home/TestData/nlp/nmt/toy_data/wmt14-de-en.src \
+ model.train_ds.tgt_file_name=/home/TestData/nlp/nmt/toy_data/wmt14-de-en.ref \
+ model.validation_ds.src_file_name=/home/TestData/nlp/nmt/toy_data/wmt14-de-en.src \
+ model.validation_ds.tgt_file_name=/home/TestData/nlp/nmt/toy_data/wmt14-de-en.ref \
+ ~model.test_ds \
+ model.train_ds.dataset_type=text_memmap \
+ model.encoder_tokenizer.library=sentencepiece \
+ model.encoder_tokenizer.model=/home/TestData/nlp/nmt/toy_data/spm_64k_all_langs_plus_en.model \
+ model.decoder_tokenizer.library=sentencepiece \
+ model.decoder_tokenizer.model=/home/TestData/nlp/nmt/toy_data/spm_64k_all_langs_plus_en.model"
+ sh "python examples/nlp/machine_translation/megatron_nmt_training.py \
+ trainer.devices=2 \
+ trainer.accelerator=gpu \
+ trainer.log_every_n_steps=1 \
+ trainer.val_check_interval=10 \
+ +trainer.limit_val_batches=2 \
+ trainer.accumulate_grad_batches=1 \
+ trainer.max_steps=10 \
+ trainer.precision=16 \
+ trainer.gradient_clip_val=1.0 \
+ exp_manager.exp_dir=examples/nlp/machine_translation/megatron_nmt_results \
+ model.tensor_model_parallel_size=2 \
+ model.seq_length=128 \
+ model.encoder.num_layers=4 \
+ model.encoder.hidden_size=64 \
+ model.encoder.num_attention_heads=8 \
+ model.encoder.activation='swiglu' \
+ model.encoder.masked_softmax_fusion=False \
+ model.encoder.bias_activation_fusion=False \
+ model.encoder.activations_checkpoint_method='block' \
+ model.encoder.activations_checkpoint_num_layers=1 \
+ model.decoder.num_layers=2 \
+ model.decoder.hidden_size=64 \
+ model.decoder.num_attention_heads=8 \
+ model.decoder.activation='swiglu' \
+ model.decoder.masked_softmax_fusion=False \
+ model.decoder.bias_activation_fusion=False \
+ model.decoder.activations_checkpoint_method='block' \
+ model.decoder.activations_checkpoint_num_layers=1 \
+ model.micro_batch_size=2 \
+ model.global_batch_size=4 \
+ model.train_ds.src_file_name=/home/TestData/nlp/nmt/toy_data/wmt14-de-en.src \
+ model.train_ds.tgt_file_name=/home/TestData/nlp/nmt/toy_data/wmt14-de-en.ref \
+ model.validation_ds.src_file_name=/home/TestData/nlp/nmt/toy_data/wmt14-de-en.src \
+ model.validation_ds.tgt_file_name=/home/TestData/nlp/nmt/toy_data/wmt14-de-en.ref \
+ ~model.test_ds \
+ model.train_ds.dataset_type=text_memmap \
+ model.encoder_tokenizer.library=sentencepiece \
+ model.encoder_tokenizer.model=/home/TestData/nlp/nmt/toy_data/spm_64k_all_langs_plus_en.model \
+ model.decoder_tokenizer.library=sentencepiece \
+ model.decoder_tokenizer.model=/home/TestData/nlp/nmt/toy_data/spm_64k_all_langs_plus_en.model"
+ sh "rm -rf examples/nlp/machine_translation/megatron_nmt_results"
+ }
+ }
+
+ // stage('L2: NMT Bottleneck Fallback') {
+ // when {
+ // anyOf {
+ // branch 'r1.17.0'
+ // changeRequest target: 'r1.17.0'
+ // }
+ // }
+ // failFast true
+ // parallel {
+ // stage('L2: seq2seq (no bottleneck)') {
+ // steps {
+ // sh 'cd examples/nlp/machine_translation && \
+ // enc_dec_nmt-bottleneck.py \
+ // --config-path=conf \
+ // --config-name=aayn_bottleneck \
+ // do_testing=true \
+ // model.model_type=nll \
+ // model.encoder.arch=seq2seq \
+ // model.encoder.hidden_steps=1 \
+ // model.encoder.hidden_blocks=1 \
+ // model.encoder.hidden_init_method=params \
+ // model.encoder.hidden_size=64 \
+ // model.encoder.inner_size=128 \
+ // model.encoder.num_attention_heads=2 \
+ // model.encoder.num_layers=2 \
+ // model.decoder.hidden_size=64 \
+ // model.decoder.inner_size=128 \
+ // model.decoder.num_attention_heads=2 \
+ // model.decoder.num_layers=2 \
+ // model.train_ds.src_file_name=/home/TestData/nlp/nmt/toy_data/wmt14-en-de.src \
+ // model.train_ds.tgt_file_name=/home/TestData/nlp/nmt/toy_data/wmt14-en-de.ref \
+ // model.validation_ds.src_file_name=[/home/TestData/nlp/nmt/toy_data/wmt13-en-de.src,/home/TestData/nlp/nmt/toy_data/wmt14-en-de.src] \
+ // model.validation_ds.tgt_file_name=[/home/TestData/nlp/nmt/toy_data/wmt13-en-de.ref,/home/TestData/nlp/nmt/toy_data/wmt14-en-de.ref] \
+ // model.test_ds.src_file_name=/home/TestData/nlp/nmt/toy_data/wmt13-en-de.src \
+ // model.test_ds.tgt_file_name=/home/TestData/nlp/nmt/toy_data/wmt13-en-de.ref \
+ // model.encoder_tokenizer.tokenizer_model=/home/TestData/nlp/nmt/toy_data/tt_tokenizer.BPE.4096.model \
+ // model.decoder_tokenizer.tokenizer_model=/home/TestData/nlp/nmt/toy_data/tt_tokenizer.BPE.4096.model \
+ // trainer.devices=[1] \
+ // trainer.accelerator="gpu" \
+ // +trainer.fast_dev_run=true \
+ // +trainer.limit_test_batches=2 \
+ // exp_manager=null \
+ // '
+ // }
+ // }
+ // }
+ // }
+ // stage('L2: NMT Bottleneck Architecture') {
+ // when {
+ // anyOf {
+ // branch 'r1.17.0'
+ // changeRequest target: 'r1.17.0'
+ // }
+ // }
+ // failFast true
+ // parallel {
+ // stage('Bridge Encoder (identity)') {
+ // steps {
+ // sh 'cd examples/nlp/machine_translation && \
+ // enc_dec_nmt-bottleneck.py \
+ // --config-path=conf \
+ // --config-name=aayn_bottleneck \
+ // do_testing=true \
+ // model.model_type=nll \
+ // model.encoder.arch=bridge \
+ // model.encoder.hidden_steps=1 \
+ // model.encoder.hidden_blocks=1 \
+ // model.encoder.hidden_init_method=identity \
+ // model.encoder.hidden_size=64 \
+ // model.encoder.inner_size=128 \
+ // model.encoder.num_attention_heads=2 \
+ // model.encoder.num_layers=2 \
+ // model.decoder.hidden_size=64 \
+ // model.decoder.inner_size=128 \
+ // model.decoder.num_attention_heads=2 \
+ // model.decoder.num_layers=2 \
+ // model.train_ds.src_file_name=/home/TestData/nlp/nmt/toy_data/wmt14-de-en.src \
+ // model.train_ds.tgt_file_name=/home/TestData/nlp/nmt/toy_data/wmt14-de-en.ref \
+ // model.validation_ds.src_file_name=/home/TestData/nlp/nmt/toy_data/wmt14-de-en.src \
+ // model.validation_ds.tgt_file_name=/home/TestData/nlp/nmt/toy_data/wmt14-de-en.src \
+ // model.test_ds.src_file_name=/home/TestData/nlp/nmt/toy_data/wmt14-de-en.src \
+ // model.test_ds.tgt_file_name=/home/TestData/nlp/nmt/toy_data/wmt14-de-en.src \
+ // model.encoder_tokenizer.tokenizer_model=/home/TestData/nlp/nmt/toy_data/tt_tokenizer.BPE.4096.model \
+ // model.decoder_tokenizer.tokenizer_model=/home/TestData/nlp/nmt/toy_data/tt_tokenizer.BPE.4096.model \
+ // trainer.devices=[0] \
+ // trainer.accelerator="gpu" \
+ // +trainer.fast_dev_run=true \
+ // +trainer.limit_test_batches=2 \
+ // exp_manager=null \
+ // '
+ // }
+ // }
+ // stage('Perceiver Encoder (params)') {
+ // steps {
+ // sh 'cd examples/nlp/machine_translation && \
+ // enc_dec_nmt-bottleneck.py \
+ // --config-path=conf \
+ // --config-name=aayn_bottleneck \
+ // do_testing=true \
+ // model.model_type=nll \
+ // model.encoder.arch=perceiver \
+ // model.encoder.hidden_steps=1 \
+ // model.encoder.hidden_blocks=1 \
+ // model.encoder.hidden_init_method=params \
+ // model.encoder.hidden_size=64 \
+ // model.encoder.inner_size=128 \
+ // model.encoder.num_attention_heads=2 \
+ // model.encoder.num_layers=2 \
+ // model.decoder.hidden_size=64 \
+ // model.decoder.inner_size=128 \
+ // model.decoder.num_attention_heads=2 \
+ // model.decoder.num_layers=2 \
+ // model.train_ds.src_file_name=/home/TestData/nlp/nmt/toy_data/wmt14-de-en.src \
+ // model.train_ds.tgt_file_name=/home/TestData/nlp/nmt/toy_data/wmt14-de-en.ref \
+ // model.validation_ds.src_file_name=/home/TestData/nlp/nmt/toy_data/wmt14-de-en.src \
+ // model.validation_ds.tgt_file_name=/home/TestData/nlp/nmt/toy_data/wmt14-de-en.src \
+ // model.test_ds.src_file_name=/home/TestData/nlp/nmt/toy_data/wmt14-de-en.src \
+ // model.test_ds.tgt_file_name=/home/TestData/nlp/nmt/toy_data/wmt14-de-en.src \
+ // model.encoder_tokenizer.tokenizer_model=/home/TestData/nlp/nmt/toy_data/tt_tokenizer.BPE.4096.model \
+ // model.decoder_tokenizer.tokenizer_model=/home/TestData/nlp/nmt/toy_data/tt_tokenizer.BPE.4096.model \
+ // trainer.devices=[1] \
+ // trainer.accelerator="gpu" \
+ // +trainer.fast_dev_run=true \
+ // +trainer.limit_test_batches=2 \
+ // exp_manager=null \
+ // '
+ // }
+ // }
+ // }
+ // }
+ // stage('L2: NMT Bottleneck LVM') {
+ // when {
+ // anyOf {
+ // branch 'r1.17.0'
+ // changeRequest target: 'r1.17.0'
+ // }
+ // }
+ // failFast true
+ // parallel {
+ // stage('VAE') {
+ // steps {
+ // sh 'cd examples/nlp/machine_translation && \
+ // enc_dec_nmt-bottleneck.py \
+ // --config-path=conf \
+ // --config-name=aayn_bottleneck \
+ // do_testing=true \
+ // model.model_type=vae \
+ // model.encoder.arch=perceiver \
+ // model.encoder.hidden_steps=1 \
+ // model.encoder.hidden_blocks=1 \
+ // model.encoder.hidden_init_method=params \
+ // model.encoder.hidden_size=64 \
+ // model.encoder.inner_size=128 \
+ // model.encoder.num_attention_heads=2 \
+ // model.encoder.num_layers=2 \
+ // model.decoder.hidden_size=64 \
+ // model.decoder.inner_size=128 \
+ // model.decoder.num_attention_heads=2 \
+ // model.decoder.num_layers=2 \
+ // model.train_ds.src_file_name=/home/TestData/nlp/nmt/toy_data/wmt14-de-en.src \
+ // model.train_ds.tgt_file_name=/home/TestData/nlp/nmt/toy_data/wmt14-de-en.ref \
+ // model.validation_ds.src_file_name=/home/TestData/nlp/nmt/toy_data/wmt14-de-en.src \
+ // model.validation_ds.tgt_file_name=/home/TestData/nlp/nmt/toy_data/wmt14-de-en.src \
+ // model.test_ds.src_file_name=/home/TestData/nlp/nmt/toy_data/wmt14-de-en.src \
+ // model.test_ds.tgt_file_name=/home/TestData/nlp/nmt/toy_data/wmt14-de-en.src \
+ // model.encoder_tokenizer.tokenizer_model=/home/TestData/nlp/nmt/toy_data/tt_tokenizer.BPE.4096.model \
+ // model.decoder_tokenizer.tokenizer_model=/home/TestData/nlp/nmt/toy_data/tt_tokenizer.BPE.4096.model \
+ // trainer.devices=[0] \
+ // trainer.accelerator="gpu" \
+ // +trainer.fast_dev_run=true \
+ // +trainer.limit_test_batches=2 \
+ // exp_manager=null \
+ // '
+ // }
+ // }
+ // stage('MIM') {
+ // steps {
+ // sh 'cd examples/nlp/machine_translation && \
+ // enc_dec_nmt-bottleneck.py \
+ // --config-path=conf \
+ // --config-name=aayn_bottleneck \
+ // do_testing=true \
+ // model.model_type=mim \
+ // model.encoder.arch=perceiver \
+ // model.encoder.hidden_steps=1 \
+ // model.encoder.hidden_blocks=1 \
+ // model.encoder.hidden_init_method=params \
+ // model.encoder.hidden_size=64 \
+ // model.encoder.inner_size=128 \
+ // model.encoder.num_attention_heads=2 \
+ // model.encoder.num_layers=2 \
+ // model.decoder.hidden_size=64 \
+ // model.decoder.inner_size=128 \
+ // model.decoder.num_attention_heads=2 \
+ // model.decoder.num_layers=2 \
+ // model.train_ds.src_file_name=/home/TestData/nlp/nmt/toy_data/wmt14-de-en.src \
+ // model.train_ds.tgt_file_name=/home/TestData/nlp/nmt/toy_data/wmt14-de-en.ref \
+ // model.validation_ds.src_file_name=/home/TestData/nlp/nmt/toy_data/wmt14-de-en.src \
+ // model.validation_ds.tgt_file_name=/home/TestData/nlp/nmt/toy_data/wmt14-de-en.src \
+ // model.test_ds.src_file_name=/home/TestData/nlp/nmt/toy_data/wmt14-de-en.src \
+ // model.test_ds.tgt_file_name=/home/TestData/nlp/nmt/toy_data/wmt14-de-en.src \
+ // model.encoder_tokenizer.tokenizer_model=/home/TestData/nlp/nmt/toy_data/tt_tokenizer.BPE.4096.model \
+ // model.decoder_tokenizer.tokenizer_model=/home/TestData/nlp/nmt/toy_data/tt_tokenizer.BPE.4096.model \
+ // trainer.devices=[1] \
+ // trainer.accelerator="gpu" \
+ // +trainer.fast_dev_run=true \
+ // +trainer.limit_test_batches=2 \
+ // exp_manager=null \
+ // '
+ // }
+ // }
+ // }
+ // }
+ stage('L2: Megatron Bert Pretraining and Resume Training with Pipeline Paralleism') {
+ when {
+ anyOf {
+ branch 'r1.17.0'
+ changeRequest target: 'r1.17.0'
+ }
+ }
+ failFast true
+ steps {
+ sh "python examples/nlp/language_modeling/megatron_bert_pretraining.py \
+ trainer.devices=2 \
+ trainer.accelerator=gpu \
+ trainer.log_every_n_steps=1 \
+ trainer.val_check_interval=10 \
+ trainer.limit_val_batches=2 \
+ trainer.accumulate_grad_batches=1 \
+ trainer.max_steps=10 \
+ trainer.precision=16 \
+ trainer.gradient_clip_val=1.0 \
+ exp_manager.exp_dir=examples/nlp/language_modeling/bert_pretrain_results \
+ model.pipeline_model_parallel_size=2 \
+ model.optim.name=fused_adam \
+ model.optim.lr=2e-4 \
+ model.optim.sched.warmup_steps=2 \
+ model.optim.sched.constant_steps=2 \
+ model.optim.sched.min_lr=8e-5 \
+ model.max_position_embeddings=128 \
+ model.encoder_seq_length=128 \
+ model.data.seq_length=128 \
+ model.tokenizer.vocab_file=/home/TestData/nlp/megatron_bert/data/bert/vocab.txt \
+ model.num_layers=8 \
+ model.hidden_size=256 \
+ model.num_attention_heads=8 \
+ model.activations_checkpoint_method='block' \
+ model.activations_checkpoint_num_layers=1 \
+ model.data.data_prefix=[.5,/home/TestData/nlp/megatron_bert/data/bert/simple_wiki_bert_preproc_text_sentence,.5,/home/TestData/nlp/megatron_bert/data/bert/simple_wiki_bert_preproc_text_sentence] \
+ model.data.index_mapping_dir=examples/nlp/language_modeling/bert_index_mappings"
+ sh "python examples/nlp/language_modeling/megatron_bert_pretraining.py \
+ trainer.devices=2 \
+ trainer.accelerator=gpu \
+ trainer.log_every_n_steps=1 \
+ trainer.val_check_interval=10 \
+ trainer.limit_val_batches=2 \
+ trainer.accumulate_grad_batches=1 \
+ trainer.max_steps=20 \
+ trainer.precision=16 \
+ trainer.gradient_clip_val=1.0 \
+ exp_manager.exp_dir=examples/nlp/language_modeling/bert_pretrain_results \
+ exp_manager.resume_if_exists=True \
+ model.pipeline_model_parallel_size=2 \
+ model.optim.name=fused_adam \
+ model.optim.lr=2e-4 \
+ model.optim.sched.warmup_steps=2 \
+ model.optim.sched.constant_steps=2 \
+ model.optim.sched.min_lr=8e-5 \
+ model.max_position_embeddings=128 \
+ model.encoder_seq_length=128 \
+ model.data.seq_length=128 \
+ model.tokenizer.vocab_file=/home/TestData/nlp/megatron_bert/data/bert/vocab.txt \
+ model.num_layers=8 \
+ model.hidden_size=256 \
+ model.num_attention_heads=8 \
+ model.activations_checkpoint_method='block' \
+ model.activations_checkpoint_num_layers=1 \
+ model.data.data_prefix=[.5,/home/TestData/nlp/megatron_bert/data/bert/simple_wiki_bert_preproc_text_sentence,.5,/home/TestData/nlp/megatron_bert/data/bert/simple_wiki_bert_preproc_text_sentence] \
+ model.data.index_mapping_dir=examples/nlp/language_modeling/bert_index_mappings"
+ sh "rm -rf examples/nlp/language_modeling/bert_pretrain_results"
+ sh "rm -rf examples/nlp/language_modeling/bert_index_mappings"
+ }
+ }
+ stage('L2: Megatron Bert Pretraining and Resume Training') {
+ when {
+ anyOf {
+ branch 'r1.17.0'
+ changeRequest target: 'r1.17.0'
+ }
+ }
+ failFast true
+ steps {
+ sh "python examples/nlp/language_modeling/megatron_bert_pretraining.py \
+ trainer.devices=2 \
+ trainer.accelerator=gpu \
+ trainer.log_every_n_steps=1 \
+ trainer.val_check_interval=10 \
+ trainer.limit_val_batches=2 \
+ trainer.accumulate_grad_batches=1 \
+ trainer.max_steps=10 \
+ trainer.precision=16 \
+ trainer.gradient_clip_val=1.0 \
+ exp_manager.exp_dir=examples/nlp/language_modeling/bert_pretrain_results \
+ model.tensor_model_parallel_size=2 \
+ model.optim.name=fused_adam \
+ model.optim.lr=2e-4 \
+ model.sequence_parallel=True \
+ model.optim.sched.warmup_steps=2 \
+ model.optim.sched.constant_steps=2 \
+ model.optim.sched.min_lr=8e-5 \
+ model.max_position_embeddings=128 \
+ model.encoder_seq_length=128 \
+ model.data.seq_length=128 \
+ model.tokenizer.vocab_file=/home/TestData/nlp/megatron_bert/data/bert/vocab.txt \
+ model.num_layers=8 \
+ model.hidden_size=256 \
+ model.num_attention_heads=8 \
+ model.activations_checkpoint_method='block' \
+ model.activations_checkpoint_num_layers=1 \
+ model.data.data_prefix=[.5,/home/TestData/nlp/megatron_bert/data/bert/simple_wiki_bert_preproc_text_sentence,.5,/home/TestData/nlp/megatron_bert/data/bert/simple_wiki_bert_preproc_text_sentence] \
+ model.data.index_mapping_dir=examples/nlp/language_modeling/bert_index_mappings"
+ sh "python examples/nlp/language_modeling/megatron_bert_pretraining.py \
+ trainer.devices=2 \
+ trainer.accelerator=gpu \
+ trainer.log_every_n_steps=1 \
+ trainer.val_check_interval=10 \
+ trainer.limit_val_batches=2 \
+ trainer.accumulate_grad_batches=1 \
+ trainer.max_steps=20 \
+ trainer.precision=16 \
+ trainer.gradient_clip_val=1.0 \
+ exp_manager.exp_dir=examples/nlp/language_modeling/bert_pretrain_results \
+ exp_manager.resume_if_exists=True \
+ model.tensor_model_parallel_size=2 \
+ model.optim.name=fused_adam \
+ model.optim.lr=2e-4 \
+ model.optim.sched.warmup_steps=2 \
+ model.optim.sched.constant_steps=2 \
+ model.optim.sched.min_lr=8e-5 \
+ model.max_position_embeddings=128 \
+ model.encoder_seq_length=128 \
+ model.data.seq_length=128 \
+ model.tokenizer.vocab_file=/home/TestData/nlp/megatron_bert/data/bert/vocab.txt \
+ model.num_layers=8 \
+ model.hidden_size=256 \
+ model.num_attention_heads=8 \
+ model.activations_checkpoint_method='block' \
+ model.activations_checkpoint_num_layers=1 \
+ model.data.data_prefix=[.5,/home/TestData/nlp/megatron_bert/data/bert/simple_wiki_bert_preproc_text_sentence,.5,/home/TestData/nlp/megatron_bert/data/bert/simple_wiki_bert_preproc_text_sentence] \
+ model.data.index_mapping_dir=examples/nlp/language_modeling/bert_index_mappings"
+ sh "rm -rf examples/nlp/language_modeling/bert_pretrain_results"
+ sh "rm -rf examples/nlp/language_modeling/bert_index_mappings"
+ }
+ }
+ stage('L2: Megatron RETRO Pretraining and Resume Training') {
+ when {
+ anyOf {
+ branch 'r1.17.0'
+ changeRequest target: 'r1.17.0'
+ }
+ }
+ failFast true
+ steps {
+ sh "python examples/nlp/language_modeling/megatron_retro_pretraining.py \
+ trainer.devices=2 \
+ trainer.num_nodes=1 \
+ trainer.accelerator=gpu \
+ trainer.accumulate_grad_batches=1 \
+ trainer.limit_val_batches=2 \
+ exp_manager.resume_if_exists=True \
+ trainer.max_steps=10 \
+ trainer.precision=16 \
+ trainer.gradient_clip_val=1.0 \
+ trainer.val_check_interval=10 \
+ exp_manager.exp_dir=examples/nlp/language_modeling/retro_results \
+ model.data.data_prefix='' \
+ model.data.knn_index='' \
+ model.data.retrieval_prefix='' \
+ model.tensor_model_parallel_size=2 \
+ model.micro_batch_size=4 \
+ model.optim.name=fused_adam \
+ model.optim.lr=2e-4 \
+ model.optim.sched.warmup_steps=2 \
+ model.optim.sched.constant_steps=2 \
+ model.optim.sched.min_lr=8e-5 \
+ model.max_position_embeddings=128 \
+ model.encoder_seq_length=128 \
+ model.chunk_size=32 \
+ model.enc_num_layers=2 \
+ model.dec_num_layers=2 \
+ model.enc_cross_attention=[1] \
+ model.dec_cross_attention=[1] \
+ +model.data.mock=True"
+ sh "python examples/nlp/language_modeling/megatron_retro_pretraining.py \
+ trainer.devices=2 \
+ trainer.num_nodes=1 \
+ trainer.accelerator=gpu \
+ trainer.accumulate_grad_batches=1 \
+ trainer.limit_val_batches=2 \
+ exp_manager.resume_if_exists=True \
+ trainer.max_steps=20 \
+ trainer.precision=16 \
+ trainer.gradient_clip_val=1.0 \
+ trainer.val_check_interval=10 \
+ exp_manager.exp_dir=examples/nlp/language_modeling/retro_results \
+ model.data.data_prefix='' \
+ model.data.knn_index='' \
+ model.data.retrieval_prefix='' \
+ model.tensor_model_parallel_size=2 \
+ model.micro_batch_size=4 \
+ model.optim.name=fused_adam \
+ model.optim.lr=2e-4 \
+ model.optim.sched.warmup_steps=2 \
+ model.optim.sched.constant_steps=2 \
+ model.optim.sched.min_lr=8e-5 \
+ model.max_position_embeddings=128 \
+ model.encoder_seq_length=128 \
+ model.chunk_size=32 \
+ model.enc_num_layers=2 \
+ model.dec_num_layers=2 \
+ model.enc_cross_attention=[1] \
+ model.dec_cross_attention=[1] \
+ +model.data.mock=True"
+ sh "rm -rf examples/nlp/language_modeling/retro_results"
+ }
+ }
+ stage('L2: Megatron RETRO muTransfer Pretraining Performance') {
+ when {
+ anyOf {
+ branch 'r1.17.0'
+ changeRequest target: 'r1.17.0'
+ }
+ }
+ failFast true
+ steps {
+ sh "python examples/nlp/language_modeling/megatron_retro_mutransfer_pretrain.py \
+ trainer.devices=2 \
+ trainer.num_nodes=1 \
+ trainer.accelerator=gpu \
+ trainer.accumulate_grad_batches=1 \
+ trainer.max_steps=100 \
+ trainer.log_every_n_steps=1 \
+ trainer.precision=16 \
+ trainer.val_check_interval=100 \
+ trainer.limit_val_batches=0 \
+ trainer.gradient_clip_val=1.0 \
+ +trainer.num_sanity_val_steps=0 \
+ exp_manager.exp_dir=examples/nlp/language_modeling/retro_results/ \
+ +exp_manager.version=smalltest \
+ model.data.neighbors=2 \
+ model.megatron_amp_O2=False \
+ model.apply_query_key_layer_scaling=False \
+ model.tensor_model_parallel_size=1 \
+ model.optim.name=muadamw \
+ model.optim.weight_decay=0.1 \
+ model.optim.betas=[0.9,0.95] \
+ model.optim.lr=6e-4 \
+ model.optim.sched.warmup_steps=1000 \
+ model.optim.sched.constant_steps=0 \
+ model.optim.sched.min_lr=6e-5 \
+ model.add_position_embedding=False \
+ model.enc_num_layers=2 \
+ model.dec_num_layers=6 \
+ model.enc_cross_attention=[0] \
+ model.dec_cross_attention=[3,5] \
+ model.hidden_size=96 \
+ model.ffn_hidden_size=384 \
+ model.init_method_std=0.023 \
+ model.num_attention_heads=12 \
+ model.max_position_embeddings=1024 \
+ model.encoder_seq_length=1024 \
+ model.tokenizer.library=megatron \
+ model.tokenizer.type=GPT2BPETokenizer \
+ model.tokenizer.merge_file=/home/TestData/nlp/megatron_retro/gpt2-merges.txt \
+ model.tokenizer.vocab_file=/home/TestData/nlp/megatron_retro/gpt2-vocab.json \
+ model.data.data_prefix=[/home/TestData/nlp/megatron_retro/retro_wiki_test_text_document] \
+ model.data.knn_index=[/home/TestData/nlp/megatron_retro/knn2_map_wiki_test.idx] \
+ model.data.retrieval_prefix=/home/TestData/nlp/megatron_retro/retro_wiki_test_text_document \
+ model.data.index_mapping_dir=/home/TestData/nlp/megatron_retro \
+ model.data.num_workers=8 \
+ model.micro_batch_size=8 \
+ model.normalization=rmsnorm \
+ model.transformer_block_type=pre_ln \
+ model.bias_activation_fusion=True \
+ model.bias_dropout_add_fusion=False \
+ model.masked_softmax_fusion=True \
+ model.hidden_dropout=0 \
+ model.attention_dropout=0 \
+ model.fp32_residual_connection=True \
+ model.shape_file=/home/TestData/nlp/megatron_retro/o1_rel_shape_info_tiny.yaml"
+ sh '''python -c "import pandas as pd
+import pathlib
+from pandas.testing import assert_frame_equal
+from tensorboard.backend.event_processing.event_accumulator import EventAccumulator
+import torch
+if not (torch.cuda.is_available() and 'A100' in torch.cuda.get_device_name()):
+ import sys
+ sys.exit(0)
+event_file = list(pathlib.Path('examples/nlp/language_modeling/retro_results/megatron_retro/smalltest').glob('events.out.tfevents*'))[0]
+ea = EventAccumulator(str(event_file)).Reload()
+vals = []
+for i in ea.Scalars('reduced_train_loss'):
+ vals.append(i.value)
+training_curve = pd.DataFrame({'loss': vals})
+gt_curve = pd.read_csv('/home/TestData/nlp/megatron_retro/expected_learning_curve.csv')
+assert_frame_equal(training_curve, gt_curve, rtol=1e-3, atol=1e-3)"'''
+ sh "rm -rf examples/nlp/language_modeling/retro_results"
+ }
+ }
+ stage('L2: BioMegatron Bert NER Task') {
+ when {
+ anyOf {
+ branch 'r1.17.0'
+ changeRequest target: 'r1.17.0'
+ }
+ }
+ failFast true
+ steps {
+ sh "python examples/nlp/token_classification/token_classification_train.py \
+ exp_manager.exp_dir=examples/nlp/language_modeling/token_classification_results \
+ trainer.max_epochs=1 \
+ model.dataset.data_dir=/home/TestData/nlp/ner \
+ model.language_model.pretrained_model_name=biomegatron345m_biovocab_30k_cased \
+ model.tokenizer.tokenizer_name=null"
+ sh "rm -rf examples/nlp/language_modeling/token_classification_results"
+ }
+ }
+ stage('L2: Megatron GPT Pretraining and Resume Training TP=2') {
+ when {
+ anyOf {
+ branch 'r1.17.0'
+ changeRequest target: 'r1.17.0'
+ }
+ }
+ failFast true
+ steps {
+ sh "python examples/nlp/language_modeling/megatron_gpt_pretraining.py \
+ trainer.devices=2 \
+ trainer.accelerator=gpu \
+ trainer.log_every_n_steps=1 \
+ trainer.val_check_interval=2 \
+ trainer.limit_val_batches=2 \
+ trainer.accumulate_grad_batches=1 \
+ trainer.max_steps=3 \
+ trainer.precision=16 \
+ trainer.gradient_clip_val=1.0 \
+ exp_manager.exp_dir=examples/nlp/language_modeling/gpt_pretrain_results \
+ model.tensor_model_parallel_size=2 \
+ model.optim.name=fused_adam \
+ model.optim.lr=2e-4 \
+ model.optim.sched.warmup_steps=1 \
+ model.optim.sched.constant_steps=1 \
+ model.optim.sched.min_lr=8e-5 \
+ model.max_position_embeddings=128 \
+ model.encoder_seq_length=128 \
+ model.data.seq_length=128 \
+ model.position_embedding_type=rope \
+ model.rotary_percentage=0.5 \
+ model.normalization=rmsnorm \
+ model.bias=False \
+ model.bias_activation_fusion=False \
+ model.bias_dropout_add_fusion=False \
+ model.tokenizer.vocab_file=/home/TestData/nlp/megatron_gpt/data/gpt/vocab.json \
+ model.tokenizer.merge_file=/home/TestData/nlp/megatron_gpt/data/gpt/merges.txt \
+ model.num_layers=8 \
+ model.hidden_size=256 \
+ model.num_attention_heads=8 \
+ model.activations_checkpoint_method='block' \
+ model.activations_checkpoint_num_layers=1 \
+ model.data.data_prefix=[.5,/home/TestData/nlp/megatron_gpt/data/gpt/simple_wiki_gpt_preproc_text_document,.5,/home/TestData/nlp/megatron_gpt/data/gpt/simple_wiki_gpt_preproc_text_document] \
+ model.data.index_mapping_dir=examples/nlp/language_modeling/gpt_index_mappings"
+ sh "python examples/nlp/language_modeling/megatron_gpt_pretraining.py \
+ trainer.devices=2 \
+ trainer.accelerator=gpu \
+ trainer.log_every_n_steps=1 \
+ trainer.val_check_interval=2 \
+ trainer.limit_val_batches=1 \
+ trainer.accumulate_grad_batches=1 \
+ trainer.max_steps=6 \
+ trainer.precision=16 \
+ trainer.gradient_clip_val=1.0 \
+ exp_manager.exp_dir=examples/nlp/language_modeling/gpt_pretrain_results \
+ exp_manager.resume_if_exists=True \
+ model.tensor_model_parallel_size=2 \
+ model.optim.name=fused_adam \
+ model.optim.lr=2e-4 \
+ model.optim.sched.warmup_steps=2 \
+ model.optim.sched.constant_steps=2 \
+ model.optim.sched.min_lr=8e-5 \
+ model.max_position_embeddings=128 \
+ model.encoder_seq_length=128 \
+ model.data.seq_length=128 \
+ model.position_embedding_type=rope \
+ model.rotary_percentage=0.5 \
+ model.normalization=rmsnorm \
+ model.bias=False \
+ model.bias_activation_fusion=False \
+ model.bias_dropout_add_fusion=False \
+ model.tokenizer.vocab_file=/home/TestData/nlp/megatron_gpt/data/gpt/vocab.json \
+ model.tokenizer.merge_file=/home/TestData/nlp/megatron_gpt/data/gpt/merges.txt \
+ model.num_layers=8 \
+ model.hidden_size=256 \
+ model.num_attention_heads=8 \
+ model.activations_checkpoint_method='block' \
+ model.activations_checkpoint_num_layers=1 \
+ model.data.data_prefix=[.5,/home/TestData/nlp/megatron_gpt/data/gpt/simple_wiki_gpt_preproc_text_document,.5,/home/TestData/nlp/megatron_gpt/data/gpt/simple_wiki_gpt_preproc_text_document] \
+ model.data.index_mapping_dir=examples/nlp/language_modeling/gpt_index_mappings"
+ sh "rm -rf examples/nlp/language_modeling/gpt_pretrain_results"
+ sh "rm -rf examples/nlp/language_modeling/gpt_index_mappings"
+ }
+ }
+ stage('L2: Megatron GPT Pretraining and Resume Training PP=2') {
+ when {
+ anyOf {
+ branch 'r1.17.0'
+ changeRequest target: 'r1.17.0'
+ }
+ }
+ failFast true
+ steps {
+ sh "python examples/nlp/language_modeling/megatron_gpt_pretraining.py \
+ trainer.devices=2 \
+ trainer.log_every_n_steps=1 \
+ trainer.val_check_interval=2 \
+ trainer.limit_val_batches=2 \
+ trainer.accumulate_grad_batches=1 \
+ trainer.max_steps=3 \
+ trainer.precision=16 \
+ trainer.gradient_clip_val=1.0 \
+ exp_manager.exp_dir=examples/nlp/language_modeling/gpt_pretrain_results \
+ model.pipeline_model_parallel_size=2 \
+ model.tensor_model_parallel_size=1 \
+ model.optim.name=fused_adam \
+ model.optim.lr=2e-4 \
+ model.optim.sched.warmup_steps=1 \
+ model.optim.sched.constant_steps=1 \
+ model.optim.sched.min_lr=8e-5 \
+ model.max_position_embeddings=128 \
+ model.encoder_seq_length=128 \
+ model.activation=fast-swiglu \
+ model.bias_activation_fusion=False \
+ model.hidden_dropout=0.0 \
+ model.attention_dropout=0.0 \
+ model.transformer_block_type=normformer \
+ model.headscale=True \
+ model.data.seq_length=128 \
+ model.tokenizer.vocab_file=/home/TestData/nlp/megatron_gpt/data/gpt/vocab.json \
+ model.tokenizer.merge_file=/home/TestData/nlp/megatron_gpt/data/gpt/merges.txt \
+ model.num_layers=8 \
+ model.hidden_size=256 \
+ model.num_attention_heads=8 \
+ model.activations_checkpoint_method='block' \
+ model.activations_checkpoint_num_layers=1 \
+ model.data.data_prefix=[.5,/home/TestData/nlp/megatron_gpt/data/gpt/simple_wiki_gpt_preproc_text_document,.5,/home/TestData/nlp/megatron_gpt/data/gpt/simple_wiki_gpt_preproc_text_document] \
+ model.data.index_mapping_dir=examples/nlp/language_modeling/gpt_index_mappings"
+ sh "python examples/nlp/language_modeling/megatron_gpt_pretraining.py \
+ trainer.devices=2 \
+ trainer.log_every_n_steps=1 \
+ trainer.val_check_interval=2 \
+ trainer.limit_val_batches=2 \
+ trainer.accumulate_grad_batches=1 \
+ trainer.max_steps=6 \
+ trainer.precision=16 \
+ trainer.gradient_clip_val=1.0 \
+ exp_manager.exp_dir=examples/nlp/language_modeling/gpt_pretrain_results \
+ exp_manager.resume_if_exists=True \
+ model.pipeline_model_parallel_size=2 \
+ model.tensor_model_parallel_size=1 \
+ model.optim.name=fused_adam \
+ model.optim.lr=2e-4 \
+ model.optim.sched.warmup_steps=2 \
+ model.optim.sched.constant_steps=2 \
+ model.optim.sched.min_lr=8e-5 \
+ model.max_position_embeddings=128 \
+ model.encoder_seq_length=128 \
+ model.activation=fast-swiglu \
+ model.bias_activation_fusion=False \
+ model.hidden_dropout=0.0 \
+ model.attention_dropout=0.0 \
+ model.transformer_block_type=normformer \
+ model.headscale=True \
+ model.data.seq_length=128 \
+ model.tokenizer.vocab_file=/home/TestData/nlp/megatron_gpt/data/gpt/vocab.json \
+ model.tokenizer.merge_file=/home/TestData/nlp/megatron_gpt/data/gpt/merges.txt \
+ model.num_layers=8 \
+ model.hidden_size=256 \
+ model.num_attention_heads=8 \
+ model.activations_checkpoint_method='block' \
+ model.activations_checkpoint_num_layers=1 \
+ model.data.data_prefix=[.5,/home/TestData/nlp/megatron_gpt/data/gpt/simple_wiki_gpt_preproc_text_document,.5,/home/TestData/nlp/megatron_gpt/data/gpt/simple_wiki_gpt_preproc_text_document] \
+ model.data.index_mapping_dir=examples/nlp/language_modeling/gpt_index_mappings"
+ sh "rm -rf examples/nlp/language_modeling/gpt_pretrain_results"
+ sh "rm -rf examples/nlp/language_modeling/gpt_index_mappings"
+ }
+ }
+ stage('L2: Megatron GPT Eval') {
+ when {
+ anyOf {
+ branch 'r1.17.0'
+ changeRequest target: 'r1.17.0'
+ }
+ }
+ failFast true
+ steps{
+ sh "python examples/nlp/language_modeling/megatron_gpt_eval.py \
+ gpt_model_file=/home/TestData/nlp/megatron_gpt/125M/megatron_gpt.nemo \
+ prompts=['How to fix GPU memory? A:'] \
+ tensor_model_parallel_size=1 \
+ inference.tokens_to_generate=32 \
+ trainer.precision=16"
+ }
+ }
+ stage('L2: Megatron GPT Eval PP2') {
+ when {
+ anyOf {
+ branch 'r1.17.0'
+ changeRequest target: 'r1.17.0'
+ }
+ }
+ failFast true
+ steps {
+ sh "python examples/nlp/language_modeling/megatron_gpt_eval.py \
+ gpt_model_file=/home/TestData/nlp/megatron_gpt/PP2/gpt_pp2_tp1.nemo \
+ server=False \
+ tensor_model_parallel_size=1 \
+ pipeline_model_parallel_size=2 \
+ trainer.devices=2 \
+ trainer.num_nodes=1"
+ }
+ }
+
+ stage('L2: Megatron GPT Prompt Tuning TP1 PP1') {
+ when {
+ anyOf {
+ branch 'r1.17.0'
+ changeRequest target: 'r1.17.0'
+ }
+ }
+ failFast true
+ parallel{
+ stage('GPT Prompt Learning TP=1 PP=1') {
+ steps {
+ sh "python examples/nlp/language_modeling/megatron_gpt_prompt_learning.py \
+ --config-name=megatron_gpt_prompt_learning_config \
+ name='/home/TestData/nlp/prompt_learning/prompt_tuning_test' \
+ trainer.devices=1 \
+ trainer.max_steps=1 \
+ trainer.val_check_interval=1 \
+ trainer.max_epochs=null \
+ model.data.num_workers=1 \
+ model.tensor_model_parallel_size=1 \
+ model.virtual_prompt_style='p-tuning' \
+ model.p_tuning.encoder_type='embedding' \
+ model.language_model_path='/home/TestData/nlp/megatron_gpt/tiny/megatron_14m_gpt_tp1_pp1.nemo' \
+ model.existing_tasks=[] \
+ model.new_tasks=['rte'] \
+ model.data.train_ds=['/home/TestData/nlp/prompt_learning/rte_CI_test.jsonl'] \
+ model.data.validation_ds=['/home/TestData/nlp/prompt_learning/rte_CI_test.jsonl'] \
+ model.global_batch_size=4"
+ sh "rm -rf /home/TestData/nlp/prompt_learning/prompt_tuning_test"
+ sh "rm -rf /home/TestData/nlp/prompt_learning/prompt_tuning_test.nemo"
+ }
+ }
+ }
+ }
+
+ stage('L2: Megatron GPT Prompt Tuning TP2 PP1') {
+ when {
+ anyOf {
+ branch 'r1.17.0'
+ changeRequest target: 'r1.17.0'
+ }
+ }
+ failFast true
+ parallel{
+ stage('GPT Prompt Learning TP=2 PP=1') {
+ steps {
+ sh "python examples/nlp/language_modeling/megatron_gpt_prompt_learning.py \
+ --config-name=megatron_gpt_prompt_learning_config \
+ name='/home/TestData/nlp/prompt_learning/p_tuning_test_tp' \
+ trainer.devices=2 \
+ trainer.max_steps=1 \
+ trainer.val_check_interval=1 \
+ trainer.max_epochs=null \
+ model.data.num_workers=1 \
+ model.tensor_model_parallel_size=2 \
+ model.language_model_path='/home/TestData/nlp/megatron_gpt/tiny/megatron_14m_gpt_tp2_pp1.nemo' \
+ model.existing_tasks=[] \
+ model.new_tasks=['rte'] \
+ model.data.train_ds=['/home/TestData/nlp/prompt_learning/rte_CI_test.jsonl'] \
+ model.data.validation_ds=['/home/TestData/nlp/prompt_learning/rte_CI_test.jsonl'] \
+ model.global_batch_size=4"
+ sh "rm -rf /home/TestData/nlp/prompt_learning/p_tuning_test_tp"
+ sh "python examples/nlp/language_modeling/megatron_gpt_prompt_learning_eval.py \
+ virtual_prompt_model_file='/home/TestData/nlp/prompt_learning/p_tuning_test_tp.nemo' \
+ gpt_model_file='/home/TestData/nlp/megatron_gpt/tiny/megatron_14m_gpt_tp2_pp1.nemo' \
+ inference.greedy=True \
+ inference.add_BOS=False \
+ trainer.devices=2 \
+ tensor_model_parallel_size=2 \
+ pred_file_path=/home/TestData/nlp/prompt_learning/p_tuning_test_tp_preds.txt \
+ data_paths=['/home/TestData/nlp/prompt_learning/rte_CI_test.jsonl']"
+ sh "rm -rf /home/TestData/nlp/prompt_learning/p_tuning_test_tp.nemo"
+ sh "rm -rf /home/TestData/nlp/prompt_learning/p_tuning_test_tp_preds.txt"
+ }
+ }
+ }
+ }
+
+ // TODO: add when https://github.com/NVIDIA/apex/pull/1596 is merged
+ // stage('L2: Megatron GPT Prompt Tuning TP1 PP2') {
+ // when {
+ // anyOf {
+ // branch 'r1.17.0'
+ // changeRequest target: 'r1.17.0'
+ // }
+ // }
+ // failFast true
+ // parallel{
+ // stage('GPT Prompt Learning TP=1 PP=2') {
+ // steps {
+ // sh "python examples/nlp/language_modeling/megatron_gpt_prompt_learning.py \
+ // --config-name=megatron_gpt_prompt_learning_config \
+ // name='/home/TestData/nlp/prompt_learning/p_tuning_test_pp' \
+ // trainer.devices=2 \
+ // trainer.max_steps=1 \
+ // trainer.val_check_interval=1 \
+ // trainer.max_epochs=null \
+ // model.optim.name=fused_adam \
+ // model.data.num_workers=1 \
+ // model.pipeline_model_parallel_size=2 \
+ // model.language_model_path='/home/TestData/nlp/megatron_gpt/tiny/megatron_14m_gpt_tp1_pp2.nemo' \
+ // model.existing_tasks=[] \
+ // model.new_tasks=['boolq'] \
+ // model.data.train_ds=['/home/TestData/nlp/prompt_learning/boolq_CI_test.jsonl'] \
+ // model.data.validation_ds=['/home/TestData/nlp/prompt_learning/boolq_CI_test.jsonl'] \
+ // model.global_batch_size=4"
+ // sh "rm -rf /home/TestData/nlp/prompt_learning/p_tuning_test_pp"
+ // sh "python examples/nlp/language_modeling/megatron_gpt_prompt_learning_eval.py \
+ // virtual_prompt_model_file='/home/TestData/nlp/prompt_learning/p_tuning_test_pp.nemo' \
+ // gpt_model_file='/home/TestData/nlp/megatron_gpt/tiny/megatron_14m_gpt_tp1_pp2.nemo' \
+ // inference.greedy=True \
+ // inference.add_BOS=False \
+ // trainer.devices=2 \
+ // pipeline_model_parallel_size=2 \
+ // pred_file_path=/home/TestData/nlp/prompt_learning/p_tuning_test_pp_preds.txt \
+ // data_paths=['/home/TestData/nlp/prompt_learning/boolq_CI_test.jsonl']"
+ // sh "rm -rf /home/TestData/nlp/prompt_learning/p_tuning_test_pp.nemo"
+ // sh "rm -rf /home/TestData/nlp/prompt_learning/p_tuning_test_pp_preds.txt"
+ // }
+ // }
+ // }
+ // }
+
+ // TODO: Add this test back. Test was failing on CI machines due to HW error
+ // stage('L2: Megatron GPT Convert from Megatron-LM checkpoing and Eval') {
+ // when {
+ // anyOf {
+ // branch 'r1.17.0'
+ // changeRequest target: 'r1.17.0'
+ // }
+ // }
+ // failFast true
+ // steps {
+ // sh "python -m torch.distributed.launch --nproc_per_node=2 \
+ // examples/nlp/language_modeling/megatron_lm_ckpt_to_nemo.py \
+ // --checkpoint_folder=/home/TestData/nlp/megatron_gpt/data/gpt/iter_0008700 \
+ // --checkpoint_name=model_optim_rng.pt \
+ // --hparams_file=/home/TestData/nlp/megatron_gpt/data/gpt/iter_0008700/hparams.yaml \
+ // --nemo_file_path=examples/nlp/language_modeling/small_gpt.nemo \
+ // --model_type=gpt \
+ // --pipeline_model_parallel_size=1 \
+ // --gpus_per_node=2 \
+ // --tensor_model_parallel_size=2"
+ // sh "python examples/nlp/language_modeling/megatron_gpt_eval.py \
+ // --gpt_model_file=examples/nlp/language_modeling/small_gpt.nemo \
+ // --tokens_to_generate=32 \
+ // --tensor_model_parallel_size=2 \
+ // --prompt='This is a test.'"
+ // sh "rm examples/nlp/language_modeling/small_gpt.nemo"
+ // }
+ // }
+ stage('L2: Megatron Change Partitions') {
+ when {
+ anyOf {
+ branch 'r1.17.0'
+ changeRequest target: 'r1.17.0'
+ }
+ }
+ failFast true
+ parallel{
+ stage('Reduce Num Partitions (2 to 1)'){
+ steps{
+ sh "python examples/nlp/language_modeling/megatron_change_num_partitions.py \
+ --model_file \
+ /home/TestData/nlp/megatron_gpt/TP2/megatron_gpt_tp2.nemo \
+ --target_file \
+ /home/TestData/nlp/megatron_gpt/TP2/test-reduce.nemo \
+ --tensor_model_parallel_size \
+ 2 \
+ --target_tensor_model_parallel_size \
+ 1"
+ sh "rm /home/TestData/nlp/megatron_gpt/TP2/test-reduce.nemo"
+ }
+ }
+ stage('Increase Num Partitions (2 to 4)'){
+ steps{
+ sh "python examples/nlp/language_modeling/megatron_change_num_partitions.py \
+ --model_file \
+ /home/TestData/nlp/megatron_gpt/TP2/megatron_gpt_tp2.nemo \
+ --target_file \
+ /home/TestData/nlp/megatron_gpt/TP2/test-increase.nemo \
+ --tensor_model_parallel_size \
+ 2 \
+ --target_tensor_model_parallel_size \
+ 4"
+ sh "rm /home/TestData/nlp/megatron_gpt/TP2/test-increase.nemo"
+ }
+ }
+ }
+ }
+ stage('L2: Megatron T5 Pretraining and Resume Training TP=2') {
+ when {
+ anyOf {
+ branch 'r1.17.0'
+ changeRequest target: 'r1.17.0'
+ }
+ }
+ failFast true
+ steps {
+ sh "python examples/nlp/language_modeling/megatron_t5_pretraining.py \
+ trainer.devices=2 \
+ trainer.accelerator=gpu \
+ trainer.log_every_n_steps=1 \
+ trainer.val_check_interval=10 \
+ trainer.limit_val_batches=2 \
+ trainer.accumulate_grad_batches=1 \
+ trainer.max_steps=10 \
+ trainer.precision=16 \
+ trainer.gradient_clip_val=1.0 \
+ exp_manager.exp_dir=examples/nlp/language_modeling/t5_pretrain_results \
+ model.tensor_model_parallel_size=2 \
+ model.seq_length=128 \
+ model.encoder.num_layers=4 \
+ model.encoder.hidden_size=64 \
+ model.encoder.num_attention_heads=8 \
+ model.encoder.activation='swiglu' \
+ model.encoder.masked_softmax_fusion=False \
+ model.encoder.bias_activation_fusion=False \
+ model.encoder.activations_checkpoint_method='block' \
+ model.encoder.activations_checkpoint_num_layers=1 \
+ model.encoder.position_embedding_type=relative \
+ model.decoder.num_layers=2 \
+ model.decoder.hidden_size=64 \
+ model.decoder.num_attention_heads=8 \
+ model.decoder.activation='fast-swiglu' \
+ model.decoder.masked_softmax_fusion=False \
+ model.decoder.bias_activation_fusion=False \
+ model.decoder.activations_checkpoint_method='block' \
+ model.decoder.activations_checkpoint_num_layers=1 \
+ model.encoder.transformer_block_type='pre_ln' \
+ model.decoder.transformer_block_type='pre_ln' \
+ model.data.data_prefix=[.5,/home/TestData/nlp/nmt/toy_data/wmt14-de-en.src,.5,/home/TestData/nlp/nmt/toy_data/wmt14-de-en.ref] \
+ model.data.index_mapping_dir=examples/nlp/language_modeling/t5_index_mappings \
+ model.data.data_impl=text_mmap \
+ +model.data.data_impl_kwargs.newline_int=10 \
+ +model.data.data_impl_kwargs.header_lines=0 \
+ +model.data.data_impl_kwargs.workers=null \
+ +model.data.data_impl_kwargs.sort_dataset_paths=False \
+ model.share_token_embeddings=False \
+ model.share_decoder_tokens_head_embeddings=False"
+ sh "python examples/nlp/language_modeling/megatron_t5_pretraining.py \
+ trainer.devices=2 \
+ trainer.accelerator=gpu \
+ trainer.log_every_n_steps=1 \
+ trainer.val_check_interval=10 \
+ trainer.limit_val_batches=2 \
+ trainer.accumulate_grad_batches=1 \
+ trainer.max_steps=10 \
+ trainer.precision=16 \
+ trainer.gradient_clip_val=1.0 \
+ exp_manager.exp_dir=examples/nlp/language_modeling/t5_pretrain_results \
+ exp_manager.resume_if_exists=True \
+ model.tensor_model_parallel_size=2 \
+ model.seq_length=128 \
+ model.encoder.num_layers=4 \
+ model.encoder.hidden_size=64 \
+ model.encoder.num_attention_heads=8 \
+ model.encoder.activation='swiglu' \
+ model.encoder.masked_softmax_fusion=False \
+ model.encoder.bias_activation_fusion=False \
+ model.encoder.activations_checkpoint_method='block' \
+ model.encoder.activations_checkpoint_num_layers=1 \
+ model.encoder.position_embedding_type=relative \
+ model.decoder.num_layers=2 \
+ model.decoder.hidden_size=64 \
+ model.decoder.num_attention_heads=8 \
+ model.decoder.activation='fast-swiglu' \
+ model.decoder.masked_softmax_fusion=False \
+ model.decoder.bias_activation_fusion=False \
+ model.decoder.activations_checkpoint_method='block' \
+ model.decoder.activations_checkpoint_num_layers=1 \
+ model.encoder.transformer_block_type='pre_ln' \
+ model.decoder.transformer_block_type='pre_ln' \
+ model.data.data_prefix=[.5,/home/TestData/nlp/nmt/toy_data/wmt14-de-en.src,.5,/home/TestData/nlp/nmt/toy_data/wmt14-de-en.ref] \
+ model.data.index_mapping_dir=examples/nlp/language_modeling/t5_index_mappings \
+ model.data.data_impl=text_mmap \
+ +model.data.data_impl_kwargs.newline_int=10 \
+ +model.data.data_impl_kwargs.header_lines=0 \
+ +model.data.data_impl_kwargs.workers=null \
+ +model.data.data_impl_kwargs.sort_dataset_paths=False \
+ model.share_token_embeddings=False \
+ model.share_decoder_tokens_head_embeddings=False"
+ sh "rm -rf examples/nlp/language_modeling/t5_pretrain_results"
+ sh "rm -rf examples/nlp/language_modeling/t5_index_mappings"
+ }
+ }
+ stage('L2: Megatron T5 with ALiBi Pretraining and Resume Training TP=2') {
+ when {
+ anyOf {
+ branch 'r1.17.0'
+ changeRequest target: 'r1.17.0'
+ }
+ }
+ failFast true
+ steps {
+ sh "python examples/nlp/language_modeling/megatron_t5_pretraining.py \
+ trainer.devices=2 \
+ trainer.accelerator=gpu \
+ trainer.log_every_n_steps=1 \
+ trainer.val_check_interval=10 \
+ trainer.limit_val_batches=2 \
+ trainer.accumulate_grad_batches=1 \
+ trainer.max_steps=10 \
+ trainer.precision=16 \
+ trainer.gradient_clip_val=1.0 \
+ exp_manager.exp_dir=examples/nlp/language_modeling/t5_pretrain_results \
+ model.tensor_model_parallel_size=2 \
+ model.seq_length=128 \
+ model.encoder.num_layers=4 \
+ model.encoder.hidden_size=64 \
+ model.encoder.num_attention_heads=8 \
+ model.encoder.activation='swiglu' \
+ model.encoder.masked_softmax_fusion=False \
+ model.encoder.bias_activation_fusion=False \
+ model.encoder.activations_checkpoint_method='block' \
+ model.encoder.activations_checkpoint_num_layers=1 \
+ model.encoder.position_embedding_type=alibi \
+ model.decoder.num_layers=2 \
+ model.decoder.hidden_size=64 \
+ model.decoder.num_attention_heads=8 \
+ model.decoder.activation='swiglu' \
+ model.decoder.masked_softmax_fusion=False \
+ model.decoder.bias_activation_fusion=False \
+ model.decoder.activations_checkpoint_method='block' \
+ model.decoder.activations_checkpoint_num_layers=1 \
+ model.encoder.transformer_block_type='pre_ln' \
+ model.decoder.transformer_block_type='pre_ln' \
+ model.data.data_prefix=[.5,/home/TestData/nlp/nmt/toy_data/wmt14-de-en.src,.5,/home/TestData/nlp/nmt/toy_data/wmt14-de-en.ref] \
+ model.data.index_mapping_dir=examples/nlp/language_modeling/t5_index_mappings \
+ model.data.data_impl=text_mmap \
+ +model.data.data_impl_kwargs.newline_int=10 \
+ +model.data.data_impl_kwargs.header_lines=0 \
+ +model.data.data_impl_kwargs.workers=null \
+ +model.data.data_impl_kwargs.sort_dataset_paths=False \
+ model.share_token_embeddings=False \
+ model.share_decoder_tokens_head_embeddings=False"
+ sh "python examples/nlp/language_modeling/megatron_t5_pretraining.py \
+ trainer.devices=2 \
+ trainer.accelerator=gpu \
+ trainer.log_every_n_steps=1 \
+ trainer.val_check_interval=10 \
+ trainer.limit_val_batches=2 \
+ trainer.accumulate_grad_batches=1 \
+ trainer.max_steps=10 \
+ trainer.precision=16 \
+ trainer.gradient_clip_val=1.0 \
+ exp_manager.exp_dir=examples/nlp/language_modeling/t5_pretrain_results \
+ exp_manager.resume_if_exists=True \
+ model.tensor_model_parallel_size=2 \
+ model.seq_length=128 \
+ model.encoder.num_layers=4 \
+ model.encoder.hidden_size=64 \
+ model.encoder.num_attention_heads=8 \
+ model.encoder.activation='swiglu' \
+ model.encoder.masked_softmax_fusion=False \
+ model.encoder.bias_activation_fusion=False \
+ model.encoder.activations_checkpoint_method='block' \
+ model.encoder.activations_checkpoint_num_layers=1 \
+ model.encoder.position_embedding_type=alibi \
+ model.decoder.num_layers=2 \
+ model.decoder.hidden_size=64 \
+ model.decoder.num_attention_heads=8 \
+ model.decoder.activation='swiglu' \
+ model.decoder.masked_softmax_fusion=False \
+ model.decoder.bias_activation_fusion=False \
+ model.decoder.activations_checkpoint_method='block' \
+ model.decoder.activations_checkpoint_num_layers=1 \
+ model.encoder.transformer_block_type='pre_ln' \
+ model.decoder.transformer_block_type='pre_ln' \
+ model.data.data_prefix=[.5,/home/TestData/nlp/nmt/toy_data/wmt14-de-en.src,.5,/home/TestData/nlp/nmt/toy_data/wmt14-de-en.ref] \
+ model.data.index_mapping_dir=examples/nlp/language_modeling/t5_index_mappings \
+ model.data.data_impl=text_mmap \
+ +model.data.data_impl_kwargs.newline_int=10 \
+ +model.data.data_impl_kwargs.header_lines=0 \
+ +model.data.data_impl_kwargs.workers=null \
+ +model.data.data_impl_kwargs.sort_dataset_paths=False \
+ model.share_token_embeddings=False \
+ model.share_decoder_tokens_head_embeddings=False"
+ sh "rm -rf examples/nlp/language_modeling/t5_pretrain_results"
+ sh "rm -rf examples/nlp/language_modeling/t5_index_mappings"
+ }
+ }
+ stage('L2: Megatron T5 Pretraining and Resume Training PP=2') {
+ when {
+ anyOf {
+ branch 'r1.17.0'
+ changeRequest target: 'r1.17.0'
+ }
+ }
+ failFast true
+ steps {
+ sh "python examples/nlp/language_modeling/megatron_t5_pretraining.py \
+ trainer.devices=2 \
+ trainer.accelerator=gpu \
+ trainer.log_every_n_steps=1 \
+ trainer.val_check_interval=10 \
+ trainer.limit_val_batches=2 \
+ trainer.accumulate_grad_batches=1 \
+ trainer.max_steps=10 \
+ trainer.precision=16 \
+ trainer.gradient_clip_val=1.0 \
+ exp_manager.exp_dir=examples/nlp/language_modeling/t5_pretrain_results \
+ model.pipeline_model_parallel_size=2 \
+ model.pipeline_model_parallel_split_rank=1 \
+ model.seq_length=256 \
+ model.encoder.num_layers=4 \
+ model.decoder.num_layers=1 \
+ model.encoder.hidden_size=64 \
+ model.decoder.hidden_size=64 \
+ model.encoder.num_attention_heads=8 \
+ model.decoder.num_attention_heads=8 \
+ model.decoder.ffn_hidden_size=2048 \
+ model.encoder.activation='gelu' \
+ model.encoder.activations_checkpoint_method='block' \
+ model.encoder.activations_checkpoint_num_layers=1 \
+ model.encoder.transformer_block_type='pre_ln' \
+ model.decoder.transformer_block_type='post_ln' \
+ model.data.data_prefix=[.5,/home/TestData/nlp/megatron_t5/data/pile_val_small_bert_tokenizer_text_document,.5,/home/TestData/nlp/megatron_t5/data/pile_val_small_bert_tokenizer_text_document] \
+ model.data.index_mapping_dir=examples/nlp/language_modeling/t5_index_mappings"
+ sh "python examples/nlp/language_modeling/megatron_t5_pretraining.py \
+ trainer.devices=2 \
+ trainer.accelerator=gpu \
+ trainer.log_every_n_steps=1 \
+ trainer.val_check_interval=10 \
+ trainer.limit_val_batches=2 \
+ trainer.accumulate_grad_batches=1 \
+ trainer.max_steps=10 \
+ trainer.precision=16 \
+ trainer.gradient_clip_val=1.0 \
+ exp_manager.exp_dir=examples/nlp/language_modeling/t5_pretrain_results \
+ exp_manager.resume_if_exists=True \
+ model.pipeline_model_parallel_size=2 \
+ model.pipeline_model_parallel_split_rank=1 \
+ model.seq_length=256 \
+ model.encoder.num_layers=4 \
+ model.decoder.num_layers=1 \
+ model.encoder.hidden_size=64 \
+ model.decoder.hidden_size=64 \
+ model.encoder.num_attention_heads=8 \
+ model.decoder.num_attention_heads=8 \
+ model.decoder.ffn_hidden_size=2048 \
+ model.encoder.activation='gelu' \
+ model.encoder.activations_checkpoint_method='block' \
+ model.encoder.activations_checkpoint_num_layers=1 \
+ model.encoder.transformer_block_type='pre_ln' \
+ model.decoder.transformer_block_type='post_ln' \
+ model.data.data_prefix=[.5,/home/TestData/nlp/megatron_t5/data/pile_val_small_bert_tokenizer_text_document,.5,/home/TestData/nlp/megatron_t5/data/pile_val_small_bert_tokenizer_text_document] \
+ model.data.index_mapping_dir=examples/nlp/language_modeling/t5_index_mappings"
+ sh "rm -rf examples/nlp/language_modeling/t5_pretrain_results"
+ sh "rm -rf examples/nlp/language_modeling/t5_index_mappings"
+ }
+ }
+ stage('L2: Megatron T5 w/ Mixture of Expert Pretraining') {
+ when {
+ anyOf {
+ branch 'r1.17.0'
+ changeRequest target: 'r1.17.0'
+ }
+ }
+ failFast true
+ steps {
+ sh "python examples/nlp/language_modeling/megatron_t5_pretraining.py \
+ trainer.devices=2 \
+ trainer.accelerator=gpu \
+ trainer.log_every_n_steps=1 \
+ trainer.val_check_interval=10 \
+ trainer.limit_val_batches=2 \
+ trainer.accumulate_grad_batches=1 \
+ trainer.max_steps=10 \
+ trainer.precision=16 \
+ trainer.gradient_clip_val=1.0 \
+ exp_manager.exp_dir=examples/nlp/language_modeling/t5_pretrain_results \
+ model.pipeline_model_parallel_split_rank=1 \
+ model.seq_length=256 \
+ model.encoder.num_layers=4 \
+ model.decoder.num_layers=1 \
+ model.encoder.num_moe_experts=4 \
+ model.decoder.num_moe_experts=4 \
+ model.encoder.moe_frequency=3 \
+ model.decoder.moe_frequency=1 \
+ model.encoder.hidden_size=64 \
+ model.decoder.hidden_size=64 \
+ model.encoder.num_attention_heads=8 \
+ model.decoder.num_attention_heads=8 \
+ model.decoder.ffn_hidden_size=2048 \
+ model.encoder.activation='gelu' \
+ model.encoder.activations_checkpoint_method='block' \
+ model.encoder.activations_checkpoint_num_layers=1 \
+ model.encoder.transformer_block_type='pre_ln' \
+ model.decoder.transformer_block_type='post_ln' \
+ model.data.data_prefix=[.5,/home/TestData/nlp/megatron_t5/data/pile_val_small_bert_tokenizer_text_document,.5,/home/TestData/nlp/megatron_t5/data/pile_val_small_bert_tokenizer_text_document] \
+ model.data.index_mapping_dir=examples/nlp/language_modeling/t5_index_mappings"
+ sh "rm -rf examples/nlp/language_modeling/t5_pretrain_results"
+ sh "rm -rf examples/nlp/language_modeling/t5_index_mappings"
+ }
+ }
+
+ stage('L2: Megatron T5 Prompt Learning TP1 PP1') {
+ when {
+ anyOf {
+ branch 'r1.17.0'
+ changeRequest target: 'r1.17.0'
+ }
+ }
+ failFast true
+ parallel{
+ stage('T5 Prompt Learning TP=1 PP=1') {
+ steps {
+ sh "python examples/nlp/language_modeling/megatron_t5_prompt_learning.py \
+ --config-name=megatron_t5_prompt_learning \
+ name='/home/TestData/nlp/prompt_learning/t5_p_tuning_test' \
+ trainer.devices=1 \
+ trainer.max_steps=1 \
+ trainer.val_check_interval=1 \
+ trainer.max_epochs=null \
+ model.data.num_workers=1 \
+ model.language_model_path='/home/TestData/nlp/megatron_t5/8m/megatron_t5_8m-refactor.nemo' \
+ model.existing_tasks=[] \
+ model.new_tasks=['squad'] \
+ model.data.train_ds=['/home/TestData/nlp/prompt_learning/squad_CI_test.jsonl'] \
+ model.data.validation_ds=['/home/TestData/nlp/prompt_learning/squad_CI_test.jsonl'] \
+ model.global_batch_size=4 \
+ model.micro_batch_size=4"
+ sh "rm -rf /home/TestData/nlp/prompt_learning/t5_p_tuning_test"
+ sh "python examples/nlp/language_modeling/megatron_t5_prompt_learning_eval.py \
+ virtual_prompt_model_file='/home/TestData/nlp/prompt_learning/t5_p_tuning_test.nemo' \
+ language_model_path='/home/TestData/nlp/megatron_t5/8m/megatron_t5_8m-refactor.nemo' \
+ data.test_ds=['/home/TestData/nlp/prompt_learning/squad_CI_test.jsonl'] \
+ pred_file_path='/home/TestData/nlp/prompt_learning/t5_p_tuning_test_preds.txt' \
+ data.global_batch_size=4 \
+ data.micro_batch_size=4"
+ sh "rm -rf /home/TestData/nlp/prompt_learning/t5_p_tuning_test.nemo"
+ sh "rm -rf /home/TestData/nlp/prompt_learning/t5_p_tuning_test_preds.txt"
+ }
+ }
+ }
+ }
+
+ stage('L2: Megatron T5 Prompt Learning TP2 PP1') {
+ when {
+ anyOf {
+ branch 'r1.17.0'
+ changeRequest target: 'r1.17.0'
+ }
+ }
+ failFast true
+ parallel{
+ stage('T5 Prompt Learning TP=2 PP=1') {
+ steps {
+ sh "python examples/nlp/language_modeling/megatron_t5_prompt_learning.py \
+ --config-name=megatron_t5_prompt_learning \
+ name='/home/TestData/nlp/prompt_learning/t5_p_tuning_test_tp2' \
+ trainer.devices=2 \
+ trainer.max_steps=1 \
+ trainer.val_check_interval=1 \
+ trainer.max_epochs=null \
+ model.data.num_workers=1 \
+ model.tensor_model_parallel_size=2 \
+ model.language_model_path='/home/TestData/nlp/megatron_t5/8m/megatron_t5_8m_tp2.nemo' \
+ model.existing_tasks=[] \
+ model.new_tasks=['squad'] \
+ model.data.train_ds=['/home/TestData/nlp/prompt_learning/squad_CI_test.jsonl'] \
+ model.data.validation_ds=['/home/TestData/nlp/prompt_learning/squad_CI_test.jsonl'] \
+ model.global_batch_size=8 \
+ model.micro_batch_size=8"
+ sh "rm -rf /home/TestData/nlp/prompt_learning/t5_p_tuning_test_tp2"
+ sh "python examples/nlp/language_modeling/megatron_t5_prompt_learning_eval.py \
+ virtual_prompt_model_file='/home/TestData/nlp/prompt_learning/t5_p_tuning_test_tp2.nemo' \
+ language_model_path='/home/TestData/nlp/megatron_t5/8m/megatron_t5_8m_tp2.nemo' \
+ data.test_ds=['/home/TestData/nlp/prompt_learning/squad_CI_test.jsonl'] \
+ pred_file_path='/home/TestData/nlp/prompt_learning/t5_p_tuning_test_tp2_preds.txt' \
+ tensor_model_parallel_size=2 \
+ trainer.devices=2 \
+ data.global_batch_size=8 \
+ data.micro_batch_size=8"
+ sh "rm -rf /home/TestData/nlp/prompt_learning/t5_p_tuning_test_tp2.nemo"
+ sh "rm -rf /home/TestData/nlp/prompt_learning/t5_p_tuning_test_tp2_preds.txt"
+ }
+ }
+ }
+ }
+
+ // TODO: add when https://github.com/NVIDIA/apex/pull/1596 is merged
+ // stage('L2: Megatron T5 Prompt Learning TP1 PP2') {
+ // when {
+ // anyOf {
+ // branch 'r1.17.0'
+ // changeRequest target: 'r1.17.0'
+ // }
+ // }
+ // failFast true
+ // parallel{
+ // stage('T5 Prompt Learning TP=1 PP=2') {
+ // steps {
+ // sh "python examples/nlp/language_modeling/megatron_t5_prompt_learning.py \
+ // --config-name=megatron_t5_prompt_learning \
+ // name='/home/TestData/nlp/prompt_learning/t5_p_tuning_test_pp2' \
+ // trainer.devices=2 \
+ // trainer.max_steps=1 \
+ // trainer.val_check_interval=1 \
+ // trainer.max_epochs=null \
+ // model.data.num_workers=1 \
+ // model.pipeline_model_parallel_size=2 \
+ // model.language_model_path='/home/TestData/nlp/megatron_t5/8m/megatron_t5_8m_tp1_pp2.nemo' \
+ // model.existing_tasks=[] \
+ // model.new_tasks=['squad'] \
+ // model.data.train_ds=['/home/TestData/nlp/prompt_learning/squad_CI_test.jsonl'] \
+ // model.data.validation_ds=['/home/TestData/nlp/prompt_learning/squad_CI_test.jsonl'] \
+ // model.global_batch_size=8 \
+ // model.micro_batch_size=8"
+ // sh "rm -rf /home/TestData/nlp/prompt_learning/t5_p_tuning_test_pp2"
+ // sh "python examples/nlp/language_modeling/megatron_t5_prompt_learning_eval.py \
+ // virtual_prompt_model_file='/home/TestData/nlp/prompt_learning/t5_p_tuning_test_pp2.nemo' \
+ // language_model_path='/home/TestData/nlp/megatron_t5/8m/megatron_t5_8m_tp1_pp2.nemo' \
+ // data.test_ds=['/home/TestData/nlp/prompt_learning/squad_CI_test.jsonl'] \
+ // pred_file_path='/home/TestData/nlp/prompt_learning/t5_p_tuning_test_pp2_preds.txt' \
+ // tensor_model_parallel_size=2 \
+ // trainer.devices=2 \
+ // data.global_batch_size=8 \
+ // data.micro_batch_size=8"
+ // sh "rm -rf /home/TestData/nlp/prompt_learning/t5_p_tuning_test_pp2.nemo"
+ // sh "rm -rf /home/TestData/nlp/prompt_learning/t5_p_tuning_test_pp2_preds.txt"
+ // }
+ // }
+ // }
+ // }
+
+ stage('L2: Megatron UL2 Pretraining and Resume Training TP=2') {
+ when {
+ anyOf {
+ branch 'r1.17.0'
+ changeRequest target: 'r1.17.0'
+ }
+ }
+ failFast true
+ steps {
+ sh "python examples/nlp/language_modeling/megatron_t5_pretraining.py -cn megatron_ul2_config \
+ trainer.devices=2 \
+ trainer.accelerator=gpu \
+ trainer.log_every_n_steps=1 \
+ trainer.val_check_interval=10 \
+ trainer.limit_val_batches=2 \
+ trainer.accumulate_grad_batches=1 \
+ trainer.max_steps=10 \
+ trainer.precision=16 \
+ trainer.gradient_clip_val=1.0 \
+ exp_manager.exp_dir=examples/nlp/language_modeling/t5_pretrain_results \
+ model.tensor_model_parallel_size=2 \
+ model.seq_length=128 \
+ model.encoder.num_layers=4 \
+ model.encoder.hidden_size=64 \
+ model.encoder.num_attention_heads=8 \
+ model.encoder.activation='swiglu' \
+ model.encoder.bias_activation_fusion=False \
+ model.encoder.activations_checkpoint_method='block' \
+ model.encoder.activations_checkpoint_num_layers=1 \
+ model.encoder.transformer_block_type='normformer' \
+ model.encoder.headscale=True \
+ model.decoder.num_layers=4 \
+ model.decoder.hidden_size=64 \
+ model.decoder.num_attention_heads=8 \
+ model.decoder.activation='geglu' \
+ model.decoder.bias_activation_fusion=False \
+ model.decoder.activations_checkpoint_method='block' \
+ model.decoder.activations_checkpoint_num_layers=1 \
+ model.decoder.transformer_block_type='normformer' \
+ model.decoder.headscale=False \
+ model.data.data_prefix=[.5,/home/TestData/nlp/megatron_t5/data/pile_val_small_bert_tokenizer_text_document,.5,/home/TestData/nlp/megatron_t5/data/pile_val_small_bert_tokenizer_text_document] \
+ model.data.index_mapping_dir=examples/nlp/language_modeling/t5_index_mappings"
+ sh "python examples/nlp/language_modeling/megatron_t5_pretraining.py \
+ trainer.devices=2 \
+ trainer.accelerator=gpu \
+ trainer.log_every_n_steps=1 \
+ trainer.val_check_interval=10 \
+ trainer.limit_val_batches=2 \
+ trainer.accumulate_grad_batches=1 \
+ trainer.max_steps=10 \
+ trainer.precision=16 \
+ trainer.gradient_clip_val=1.0 \
+ exp_manager.exp_dir=examples/nlp/language_modeling/t5_pretrain_results \
+ exp_manager.resume_if_exists=True \
+ model.tensor_model_parallel_size=2 \
+ model.seq_length=128 \
+ model.encoder.num_layers=4 \
+ model.encoder.hidden_size=64 \
+ model.encoder.num_attention_heads=8 \
+ model.encoder.activation='swiglu' \
+ model.encoder.bias_activation_fusion=False \
+ model.encoder.activations_checkpoint_method='block' \
+ model.encoder.activations_checkpoint_num_layers=1 \
+ model.encoder.transformer_block_type='normformer' \
+ model.encoder.headscale=True \
+ model.decoder.num_layers=4 \
+ model.decoder.hidden_size=64 \
+ model.decoder.num_attention_heads=8 \
+ model.decoder.activation='geglu' \
+ model.decoder.bias_activation_fusion=False \
+ model.decoder.activations_checkpoint_method='block' \
+ model.decoder.activations_checkpoint_num_layers=1 \
+ model.decoder.transformer_block_type='normformer' \
+ model.decoder.headscale=False \
+ model.data.data_prefix=[.5,/home/TestData/nlp/megatron_t5/data/pile_val_small_bert_tokenizer_text_document,.5,/home/TestData/nlp/megatron_t5/data/pile_val_small_bert_tokenizer_text_document] \
+ model.data.index_mapping_dir=examples/nlp/language_modeling/t5_index_mappings"
+ sh "rm -rf examples/nlp/language_modeling/t5_pretrain_results"
+ sh "rm -rf examples/nlp/language_modeling/t5_index_mappings"
+ }
+ }
+ stage('L2: Megatron T5 Eval') {
+ when {
+ anyOf {
+ branch 'r1.17.0'
+ changeRequest target: 'r1.17.0'
+ }
+ }
+ failFast true
+ steps{
+ sh "python examples/nlp/language_modeling/megatron_t5_eval.py \
+ --model_file \
+ /home/TestData/nlp/megatron_t5/8m/megatron_t5_8m-refactor.nemo \
+ --prompt \
+ 'How do I fix my GPU memory issue? I am seeing out of memory.' \
+ --tensor_model_parallel_size 1"
+ }
+ }
+ stage('L2: Megatron BART Pretraining and Resume Training, TP=2') {
+ when {
+ anyOf {
+ branch 'r1.17.0'
+ changeRequest target: 'r1.17.0'
+ }
+ }
+ failFast true
+ steps {
+ sh "python examples/nlp/language_modeling/megatron_bart_pretraining.py \
+ trainer.devices=2 \
+ trainer.accelerator=gpu \
+ trainer.log_every_n_steps=1 \
+ trainer.val_check_interval=2 \
+ trainer.limit_val_batches=2 \
+ trainer.accumulate_grad_batches=1 \
+ trainer.max_steps=3 \
+ trainer.precision=16 \
+ trainer.gradient_clip_val=1.0 \
+ exp_manager.exp_dir=examples/nlp/language_modeling/bart_pretrain_results \
+ model.tensor_model_parallel_size=2 \
+ model.seq_length=128 \
+ model.encoder.num_layers=4 \
+ model.encoder.hidden_size=64 \
+ model.encoder.num_attention_heads=8 \
+ model.encoder.activation='reglu' \
+ model.encoder.bias_activation_fusion=False \
+ model.encoder.activations_checkpoint_method='block' \
+ model.encoder.activations_checkpoint_num_layers=1 \
+ model.decoder.num_layers=4 \
+ model.decoder.hidden_size=64 \
+ model.decoder.num_attention_heads=8 \
+ model.decoder.activation='reglu' \
+ model.decoder.bias_activation_fusion=False \
+ model.decoder.activations_checkpoint_method='block' \
+ model.decoder.activations_checkpoint_num_layers=1 \
+ model.data.data_prefix='{train:[1.0,/home/TestData/nlp/megatron_t5/data/pile_val_small_bert_tokenizer_text_document],test:[/home/TestData/nlp/megatron_t5/data/pile_val_small_bert_tokenizer_text_document], validation:[/home/TestData/nlp/megatron_t5/data/pile_val_small_bert_tokenizer_text_document]}'"
+ sh "python examples/nlp/language_modeling/megatron_bart_pretraining.py \
+ trainer.devices=2 \
+ trainer.accelerator=gpu \
+ trainer.log_every_n_steps=1 \
+ trainer.val_check_interval=2 \
+ trainer.limit_val_batches=1 \
+ trainer.accumulate_grad_batches=1 \
+ trainer.max_steps=6 \
+ trainer.precision=16 \
+ trainer.gradient_clip_val=1.0 \
+ exp_manager.exp_dir=examples/nlp/language_modeling/bart_pretrain_results \
+ exp_manager.resume_if_exists=True \
+ model.tensor_model_parallel_size=2 \
+ model.seq_length=128 \
+ model.encoder.num_layers=4 \
+ model.encoder.hidden_size=64 \
+ model.encoder.num_attention_heads=8 \
+ model.encoder.activation='reglu' \
+ model.encoder.bias_activation_fusion=False \
+ model.encoder.activations_checkpoint_method='block' \
+ model.encoder.activations_checkpoint_num_layers=1 \
+ model.decoder.num_layers=4 \
+ model.decoder.hidden_size=64 \
+ model.decoder.num_attention_heads=8 \
+ model.decoder.activation='reglu' \
+ model.decoder.bias_activation_fusion=False \
+ model.decoder.activations_checkpoint_method='block' \
+ model.decoder.activations_checkpoint_num_layers=1 \
+ model.data.data_prefix='{train:[1.0,/home/TestData/nlp/megatron_t5/data/pile_val_small_bert_tokenizer_text_document],test:[/home/TestData/nlp/megatron_t5/data/pile_val_small_bert_tokenizer_text_document], validation:[/home/TestData/nlp/megatron_t5/data/pile_val_small_bert_tokenizer_text_document]}'"
+ sh "rm -rf examples/nlp/language_modeling/bart_pretrain_results"
+ }
+ }
+ stage('L2: Megatron BART Pretraining and Resume Training, PP=2') {
+ when {
+ anyOf {
+ branch 'r1.17.0'
+ changeRequest target: 'r1.17.0'
+ }
+ }
+ failFast true
+ steps {
+ sh "python examples/nlp/language_modeling/megatron_bart_pretraining.py \
+ trainer.devices=2 \
+ trainer.accelerator=gpu \
+ trainer.log_every_n_steps=1 \
+ trainer.val_check_interval=10 \
+ trainer.limit_val_batches=2 \
+ trainer.accumulate_grad_batches=1 \
+ trainer.max_steps=10 \
+ trainer.precision=16 \
+ trainer.gradient_clip_val=1.0 \
+ exp_manager.exp_dir=examples/nlp/language_modeling/bart_pretrain_results \
+ model.pipeline_model_parallel_size=2 \
+ model.pipeline_model_parallel_split_rank=1 \
+ model.seq_length=256 \
+ model.encoder.num_layers=4 \
+ model.encoder.hidden_size=64 \
+ model.encoder.num_attention_heads=8 \
+ model.encoder.activation='geglu' \
+ model.encoder.bias_activation_fusion=False \
+ model.encoder.activations_checkpoint_method='block' \
+ model.encoder.activations_checkpoint_num_layers=1 \
+ model.decoder.num_layers=4 \
+ model.decoder.hidden_size=64 \
+ model.decoder.num_attention_heads=8 \
+ model.decoder.activation='geglu' \
+ model.decoder.bias_activation_fusion=False \
+ model.decoder.activations_checkpoint_method='block' \
+ model.decoder.activations_checkpoint_num_layers=1 \
+ model.data.respect_document_boundaries=False \
+ model.data.data_prefix=[.5,/home/TestData/nlp/megatron_t5/data/pile_val_small_bert_tokenizer_text_document,.5,/home/TestData/nlp/megatron_t5/data/pile_val_small_bert_tokenizer_text_document]"
+ sh "python examples/nlp/language_modeling/megatron_bart_pretraining.py \
+ trainer.devices=2 \
+ trainer.accelerator=gpu \
+ trainer.log_every_n_steps=1 \
+ trainer.val_check_interval=10 \
+ trainer.limit_val_batches=2 \
+ trainer.accumulate_grad_batches=1 \
+ trainer.max_steps=10 \
+ trainer.precision=16 \
+ trainer.gradient_clip_val=1.0 \
+ exp_manager.exp_dir=examples/nlp/language_modeling/bart_pretrain_results \
+ exp_manager.resume_if_exists=True \
+ model.pipeline_model_parallel_size=2 \
+ model.pipeline_model_parallel_split_rank=1 \
+ model.seq_length=256 \
+ model.encoder.num_layers=4 \
+ model.encoder.hidden_size=64 \
+ model.encoder.num_attention_heads=8 \
+ model.encoder.activation='geglu' \
+ model.encoder.bias_activation_fusion=False \
+ model.encoder.activations_checkpoint_method='block' \
+ model.encoder.activations_checkpoint_num_layers=1 \
+ model.decoder.num_layers=4 \
+ model.decoder.hidden_size=64 \
+ model.decoder.num_attention_heads=8 \
+ model.decoder.activation='geglu' \
+ model.decoder.bias_activation_fusion=False \
+ model.decoder.activations_checkpoint_method='block' \
+ model.decoder.activations_checkpoint_num_layers=1 \
+ model.data.respect_document_boundaries=False \
+ model.data.data_prefix=[.5,/home/TestData/nlp/megatron_t5/data/pile_val_small_bert_tokenizer_text_document,.5,/home/TestData/nlp/megatron_t5/data/pile_val_small_bert_tokenizer_text_document]"
+ sh "rm -rf examples/nlp/language_modeling/bart_pretrain_results"
+ }
+ }
+ stage('L2: Megatron T5 GLUE/XNLI Finetuning') {
+ when {
+ anyOf {
+ branch 'r1.17.0'
+ changeRequest target: 'r1.17.0'
+ }
+ }
+ failFast true
+ parallel {
+ // TODO(Oktai15): update it in 1.8.0 version
+ stage('T5 GLUE RTE') {
+ steps {
+ sh "python examples/nlp/language_modeling/megatron_t5_seq2seq_finetune.py \
+ trainer.devices=1 \
+ trainer.accelerator=gpu \
+ trainer.log_every_n_steps=1 \
+ trainer.val_check_interval=1 \
+ +trainer.limit_val_batches=2 \
+ +trainer.limit_test_batches=2 \
+ trainer.accumulate_grad_batches=1 \
+ trainer.max_steps=2 \
+ trainer.precision=16 \
+ exp_manager.exp_dir=examples/nlp/language_modeling/t5_glue_results \
+ model.restore_from_path=/home/TestData/nlp/megatron_t5/8m/megatron_t5_8m-refactor.nemo \
+ model.pipeline_model_parallel_size=1 \
+ model.pipeline_model_parallel_split_rank=0 \
+ model.data.train_ds.task_name=rte \
+ model.data.train_ds.global_batch_size=4 \
+ model.data.train_ds.micro_batch_size=2 \
+ model.data.validation_ds.global_batch_size=2 \
+ model.data.validation_ds.micro_batch_size=2 \
+ model.data.train_ds.file_path=/home/TestData/nlp/megatron_t5/data/train_ci.tsv \
+ model.data.validation_ds.task_name=rte \
+ model.data.validation_ds.file_path=/home/TestData/nlp/megatron_t5/data/dev_ci.tsv \
+ "
+ sh "rm -rf examples/nlp/language_modeling/t5_glue_results"
+ }
+ }
+ stage('T5 GLUE XNLI') {
+ steps {
+ sh "python examples/nlp/language_modeling/megatron_t5_seq2seq_finetune.py \
+ -cn megatron_t5_config_finetune_glue_xnli \
+ trainer.devices=1 \
+ trainer.accelerator=gpu \
+ trainer.log_every_n_steps=1 \
+ trainer.val_check_interval=1 \
+ +trainer.limit_val_batches=2 \
+ +trainer.limit_test_batches=2 \
+ trainer.accumulate_grad_batches=1 \
+ trainer.max_steps=2 \
+ trainer.precision=16 \
+ exp_manager.exp_dir=examples/nlp/language_modeling/t5_xnli_results \
+ model.restore_from_path=/home/TestData/nlp/megatron_t5/8m/megatron_t5_8m-refactor.nemo \
+ model.pipeline_model_parallel_size=1 \
+ model.pipeline_model_parallel_split_rank=0 \
+ model.data.train_ds.global_batch_size=4 \
+ model.data.train_ds.micro_batch_size=2 \
+ model.data.validation_ds.global_batch_size=2 \
+ model.data.validation_ds.micro_batch_size=2 \
+ model.data.test_ds.global_batch_size=2 \
+ model.data.test_ds.micro_batch_size=2 \
+ model.data.train_ds.task_name=rte \
+ model.data.train_ds.file_path=/home/TestData/nlp/megatron_t5/data/train_ci.tsv \
+ model.data.validation_ds.task_name=xnli \
+ model.data.validation_ds.file_path=/home/TestData/nlp/megatron_t5/data/xnli_dev_ci.tsv \
+ model.data.test_ds.task_name=xnli \
+ model.data.test_ds.file_path=/home/TestData/nlp/megatron_t5/data/xnli_dev_ci.tsv \
+ "
+ sh "rm -rf examples/nlp/language_modeling/t5_xnli_results"
+ }
+ }
+ }
+ }
+ stage('L2: TTS Fast dev runs 1') {
+ when {
+ anyOf {
+ branch 'r1.17.0'
+ changeRequest target: 'r1.17.0'
+ }
+ }
+ parallel {
+ stage('Tacotron 2') {
+ steps {
+ sh 'python examples/tts/tacotron2.py \
+ train_dataset=/home/TestData/an4_dataset/an4_train.json \
+ validation_datasets=/home/TestData/an4_dataset/an4_val.json \
+ trainer.devices=[0] \
+ trainer.accelerator="gpu" \
+ +trainer.limit_train_batches=1 +trainer.limit_val_batches=1 trainer.max_epochs=1 \
+ trainer.strategy=null \
+ model.decoder.decoder_rnn_dim=256 \
+ model.decoder.attention_rnn_dim=1024 \
+ model.decoder.prenet_dim=128 \
+ model.postnet.postnet_n_convolutions=3 \
+ model.train_ds.dataloader_params.batch_size=4 \
+ model.train_ds.dataloader_params.num_workers=0 \
+ model.validation_ds.dataloader_params.batch_size=4 \
+ model.validation_ds.dataloader_params.num_workers=0 \
+ ~model.text_normalizer \
+ ~model.text_normalizer_call_kwargs \
+ ~trainer.check_val_every_n_epoch \
+ '
+ }
+ }
+ stage('WaveGlow') {
+ steps {
+ sh 'python examples/tts/waveglow.py \
+ train_dataset=/home/TestData/an4_dataset/an4_train.json \
+ validation_datasets=/home/TestData/an4_dataset/an4_val.json \
+ trainer.devices="[0]" \
+ +trainer.limit_train_batches=1 +trainer.limit_val_batches=1 trainer.max_epochs=1 \
+ trainer.strategy=null \
+ model.train_ds.dataloader_params.batch_size=4 \
+ model.train_ds.dataloader_params.num_workers=0 \
+ model.validation_ds.dataloader_params.batch_size=4 \
+ model.validation_ds.dataloader_params.num_workers=0 \
+ model.waveglow.n_flows=4 \
+ model.waveglow.n_wn_layers=2 \
+ model.waveglow.n_wn_channels=32 \
+ ~trainer.check_val_every_n_epoch'
+ }
+ }
+ stage('FastPitch') {
+ steps {
+ sh 'python examples/tts/fastpitch.py \
+ --config-name fastpitch_align_v1.05 \
+ train_dataset=/home/TestData/an4_dataset/an4_train.json \
+ validation_datasets=/home/TestData/an4_dataset/an4_val.json \
+ sup_data_path=/home/TestData/an4_dataset/beta_priors \
+ trainer.devices="[0]" \
+ +trainer.limit_train_batches=1 \
+ +trainer.limit_val_batches=1 \
+ trainer.max_epochs=1 \
+ trainer.strategy=null \
+ model.pitch_mean=212.35873413085938 \
+ model.pitch_std=68.52806091308594 \
+ model.train_ds.dataloader_params.batch_size=4 \
+ model.train_ds.dataloader_params.num_workers=0 \
+ model.validation_ds.dataloader_params.batch_size=4 \
+ model.validation_ds.dataloader_params.num_workers=0 \
+ model.symbols_embedding_dim=64 \
+ model.input_fft.d_inner=384 \
+ model.input_fft.n_layer=2 \
+ model.output_fft.d_inner=384 \
+ model.output_fft.n_layer=2 \
+ ~trainer.check_val_every_n_epoch \
+ ~model.text_normalizer \
+ ~model.text_normalizer_call_kwargs'
+ }
+ }
+ stage('RADTTS') {
+ steps {
+ sh 'python examples/tts/radtts.py \
+ train_dataset=/home/TestData/an4_dataset/an4_train.json \
+ validation_datasets=/home/TestData/an4_dataset/an4_val.json \
+ sup_data_path=/home/TestData/an4_dataset/radtts_beta_priors \
+ trainer.devices="[0]" \
+ +trainer.limit_train_batches=1 \
+ +trainer.limit_val_batches=1 \
+ trainer.max_epochs=1 \
+ trainer.strategy=null \
+ model.pitch_mean=212.35873413085938 \
+ model.pitch_std=68.52806091308594 \
+ model.train_ds.dataloader_params.batch_size=4 \
+ model.train_ds.dataloader_params.num_workers=0 \
+ model.validation_ds.dataloader_params.batch_size=4 \
+ model.validation_ds.dataloader_params.num_workers=0 \
+ export_dir=/home/TestData/radtts_test \
+ model.optim.lr=0.0001 \
+ model.modelConfig.decoder_use_partial_padding=True \
+ ~trainer.check_val_every_n_epoch \
+ ~model.text_normalizer \
+ ~model.text_normalizer_call_kwargs'
+ }
+ }
+ stage('Mixer-TTS') {
+ steps {
+ sh 'python examples/tts/mixer_tts.py \
+ train_dataset=/home/TestData/an4_dataset/an4_train.json \
+ validation_datasets=/home/TestData/an4_dataset/an4_val.json \
+ sup_data_path=/home/TestData/an4_dataset/sup_data \
+ trainer.devices="[0]" \
+ +trainer.limit_train_batches=1 \
+ +trainer.limit_val_batches=1 \
+ trainer.max_epochs=1 \
+ trainer.strategy=null \
+ model.pitch_mean=212.35873413085938 \
+ model.pitch_std=68.52806091308594 \
+ model.train_ds.dataloader_params.batch_size=4 \
+ model.train_ds.dataloader_params.num_workers=0 \
+ model.validation_ds.dataloader_params.batch_size=4 \
+ model.validation_ds.dataloader_params.num_workers=0 \
+ ~trainer.check_val_every_n_epoch \
+ ~model.text_normalizer \
+ ~model.text_normalizer_call_kwargs'
+ }
+ }
+ stage('Hifigan') {
+ steps {
+ sh 'python examples/tts/hifigan.py \
+ train_dataset=/home/TestData/an4_dataset/an4_train.json \
+ validation_datasets=/home/TestData/an4_dataset/an4_val.json \
+ trainer.devices="[0]" \
+ +trainer.limit_train_batches=1 \
+ +trainer.limit_val_batches=1 \
+ +trainer.max_epochs=1 \
+ trainer.strategy=null \
+ model.train_ds.dataloader_params.batch_size=4 \
+ model.train_ds.dataloader_params.num_workers=0 \
+ model.validation_ds.dataloader_params.batch_size=4 \
+ model.validation_ds.dataloader_params.num_workers=0 \
+ model.generator.upsample_initial_channel=64 \
+ +model.debug=true \
+ ~trainer.check_val_every_n_epoch'
+ }
+ }
+ }
+ }
+
+ stage('L??: Speech Checkpoints tests') {
+ when {
+ anyOf {
+ branch 'r1.17.0'
+ changeRequest target: 'r1.17.0'
+ }
+ }
+ failFast true
+ steps {
+ sh 'CUDA_VISIBLE_DEVICES=0 python examples/asr/speech_to_text_eval.py \
+ pretrained_name=QuartzNet15x5Base-En \
+ dataset_manifest=/home/TestData/librispeech/librivox-dev-other.json \
+ batch_size=64 \
+ tolerance=0.1012'
+ sh 'rm -f examples/asr/evaluation_transcripts.json'
+ }
+ }
+ }
+
+ post {
+ always {
+ sh 'chmod -R 777 .'
+ cleanWs()
+ }
+ }
+}
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000000000000000000000000000000000000..f49a4e16e68b128803cc2dcea614603632b04eac
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,201 @@
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
\ No newline at end of file
diff --git a/PUBLICATIONS.md b/PUBLICATIONS.md
new file mode 100644
index 0000000000000000000000000000000000000000..365ed2773ed3e3b446ba31f441562b2b4f3a2676
--- /dev/null
+++ b/PUBLICATIONS.md
@@ -0,0 +1,213 @@
+# Publications
+
+Here, we list a collection of research articles that utilize the NeMo Toolkit. If you would like to include your paper in this collection, please submit a PR updating this document.
+
+-------
+
+# Automatic Speech Recognition (ASR)
+
+
+ 2023
+
+ * [Fast Entropy-Based Methods of Word-Level Confidence Estimation for End-to-End Automatic Speech Recognition](https://ieeexplore.ieee.org/abstract/document/10022960)
+ * [Damage Control During Domain Adaptation for Transducer Based Automatic Speech Recognition](https://ieeexplore.ieee.org/abstract/document/10023219)
+
+
+
+
+ 2022
+
+ * [Multi-blank Transducers for Speech Recognition](https://arxiv.org/abs/2211.03541)
+
+
+
+
+ 2021
+
+ * [Citrinet: Closing the Gap between Non-Autoregressive and Autoregressive End-to-End Models for Automatic Speech Recognition](https://arxiv.org/abs/2104.01721)
+ * [SPGISpeech: 5,000 hours of transcribed financial audio for fully formatted end-to-end speech recognition](https://www.isca-speech.org/archive/interspeech_2021/oneill21_interspeech.html)
+ * [CarneliNet: Neural Mixture Model for Automatic Speech Recognition](https://arxiv.org/abs/2107.10708)
+ * [CTC Variations Through New WFST Topologies](https://arxiv.org/abs/2110.03098)
+ * [A Toolbox for Construction and Analysis of Speech Datasets](https://openreview.net/pdf?id=oJ0oHQtAld)
+
+
+
+
+
+ 2020
+
+ * [Cross-Language Transfer Learning, Continuous Learning, and Domain Adaptation for End-to-End Automatic Speech Recognition](https://ieeexplore.ieee.org/document/9428334)
+ * [Correction of Automatic Speech Recognition with Transformer Sequence-To-Sequence Model](https://ieeexplore.ieee.org/abstract/document/9053051)
+ * [Improving Noise Robustness of an End-to-End Neural Model for Automatic Speech Recognition](https://arxiv.org/abs/2010.12715)
+
+
+
+
+
+ 2019
+
+ * [Jasper: An End-to-End Convolutional Neural Acoustic Model](https://arxiv.org/abs/1904.03288)
+ * [QuartzNet: Deep Automatic Speech Recognition with 1D Time-Channel Separable Convolutions](https://arxiv.org/abs/1910.10261)
+
+
+
+
+
+--------
+
+
+## Speaker Recognition (SpkR)
+
+
+ 2022
+
+ * [TitaNet: Neural Model for Speaker Representation with 1D Depth-Wise Separable Convolutions and Global Context](https://ieeexplore.ieee.org/abstract/document/9746806)
+
+
+
+
+
+ 2020
+
+ * [SpeakerNet: 1D Depth-wise Separable Convolutional Network for Text-Independent Speaker Recognition and Verification]( https://arxiv.org/pdf/2010.12653.pdf)
+
+
+
+--------
+
+## Speech Classification
+
+
+ 2022
+
+ * [AmberNet: A Compact End-to-End Model for Spoken Language Identification](https://arxiv.org/abs/2210.15781)
+ * [Accidental Learners: Spoken Language Identification in Multilingual Self-Supervised Models](https://arxiv.org/abs/2211.05103)
+
+
+
+
+
+ 2021
+
+ * [MarbleNet: Deep 1D Time-Channel Separable Convolutional Neural Network for Voice Activity Detection](https://ieeexplore.ieee.org/abstract/document/9414470/)
+
+
+
+
+
+ 2020
+
+ * [MatchboxNet - 1D Time-Channel Separable Convolutional Neural Network Architecture for Speech Commands Recognition](http://www.interspeech2020.org/index.php?m=content&c=index&a=show&catid=337&id=993)
+
+
+
+
+--------
+
+## Speech Translation
+
+
+ 2022
+
+ * [NVIDIA NeMo Offline Speech Translation Systems for IWSLT 2022](https://aclanthology.org/2022.iwslt-1.18/)
+
+
+
+
+--------
+
+# Natural Language Processing (NLP)
+
+## Language Modeling
+
+
+ 2022
+
+ * [Evaluating Parameter Efficient Learning for Generation](https://arxiv.org/abs/2210.13673)
+ * [Text Mining Drug/Chemical-Protein Interactions using an Ensemble of BERT and T5 Based Models](https://arxiv.org/abs/2111.15617)
+
+
+
+
+ 2021
+
+ * [BioMegatron: Larger Biomedical Domain Language Model ](https://aclanthology.org/2020.emnlp-main.379/)
+
+
+
+## Neural Machine Translation
+
+
+ 2022
+
+ * [Finding the Right Recipe for Low Resource Domain Adaptation in Neural Machine Translation](https://arxiv.org/abs/2206.01137)
+
+
+
+
+ 2021
+
+ * [NVIDIA NeMo Neural Machine Translatio Systems for English-German and English-Russian News and Biomedical Tasks at WMT21](https://arxiv.org/pdf/2111.08634.pdf)
+
+
+
+--------
+
+## Dialogue State Tracking
+
+
+ 2021
+
+ * [SGD-QA: Fast Schema-Guided Dialogue State Tracking for Unseen Services](https://arxiv.org/abs/2105.08049)
+
+
+
+
+ 2020
+
+ * [A Fast and Robust BERT-based Dialogue State Tracker for Schema-Guided Dialogue Dataset](https://arxiv.org/abs/2008.12335)
+
+
+--------
+
+
+# Text To Speech (TTS)
+
+
+ 2022
+
+ * [Adapter-Based Extension of Multi-Speaker Text-to-Speech Model for New Speakers](https://arxiv.org/abs/2211.00585)
+
+
+
+
+ 2021
+
+ * [TalkNet: Fully-Convolutional Non-Autoregressive Speech Synthesis Model](https://www.isca-speech.org/archive/interspeech_2021/beliaev21_interspeech.html)
+ * [TalkNet 2: Non-Autoregressive Depth-Wise Separable Convolutional Model for Speech Synthesis with Explicit Pitch and Duration Prediction](https://arxiv.org/abs/2104.08189)
+ * [Hi-Fi Multi-Speaker English TTS Dataset](https://www.isca-speech.org/archive/pdfs/interspeech_2021/bakhturina21_interspeech.pdf)
+ * [Mixer-TTS: non-autoregressive, fast and compact text-to-speech model conditioned on language model embeddings](https://arxiv.org/abs/2110.03584)
+
+
+
+
+--------
+
+# (Inverse) Text Normalization
+
+ 2022
+
+ * [Shallow Fusion of Weighted Finite-State Transducer and Language Model for Text Normalization](https://arxiv.org/abs/2203.15917)
+ * [Thutmose Tagger: Single-pass neural model for Inverse Text Normalization](https://arxiv.org/abs/2208.00064)
+
+
+
+
+ 2021
+
+ * [NeMo Inverse Text Normalization: From Development to Production](https://www.isca-speech.org/archive/pdfs/interspeech_2021/zhang21ga_interspeech.pdf)
+ * [A Unified Transformer-based Framework for Duplex Text Normalization](https://arxiv.org/pdf/2108.09889.pdf )
+
+
+
+--------
\ No newline at end of file
diff --git a/README.rst b/README.rst
new file mode 100644
index 0000000000000000000000000000000000000000..3d94bf2d3848d40cac7370db0187537e18e563e4
--- /dev/null
+++ b/README.rst
@@ -0,0 +1,319 @@
+
+|status| |documentation| |codeql| |license| |pypi| |pyversion| |downloads| |black|
+
+.. |status| image:: http://www.repostatus.org/badges/latest/active.svg
+ :target: http://www.repostatus.org/#active
+ :alt: Project Status: Active – The project has reached a stable, usable state and is being actively developed.
+
+.. |documentation| image:: https://readthedocs.com/projects/nvidia-nemo/badge/?version=main
+ :alt: Documentation
+ :target: https://docs.nvidia.com/deeplearning/nemo/user-guide/docs/en/main/
+
+.. |license| image:: https://img.shields.io/badge/License-Apache%202.0-brightgreen.svg
+ :target: https://github.com/NVIDIA/NeMo/blob/master/LICENSE
+ :alt: NeMo core license and license for collections in this repo
+
+.. |pypi| image:: https://badge.fury.io/py/nemo-toolkit.svg
+ :target: https://badge.fury.io/py/nemo-toolkit
+ :alt: Release version
+
+.. |pyversion| image:: https://img.shields.io/pypi/pyversions/nemo-toolkit.svg
+ :target: https://badge.fury.io/py/nemo-toolkit
+ :alt: Python version
+
+.. |downloads| image:: https://static.pepy.tech/personalized-badge/nemo-toolkit?period=total&units=international_system&left_color=grey&right_color=brightgreen&left_text=downloads
+ :target: https://pepy.tech/project/nemo-toolkit
+ :alt: PyPi total downloads
+
+.. |codeql| image:: https://github.com/nvidia/nemo/actions/workflows/codeql.yml/badge.svg?branch=main&event=push
+ :target: https://github.com/nvidia/nemo/actions/workflows/codeql.yml
+ :alt: CodeQL
+
+.. |black| image:: https://img.shields.io/badge/code%20style-black-000000.svg
+ :target: https://github.com/psf/black
+ :alt: Code style: black
+
+.. _main-readme:
+
+**NVIDIA NeMo**
+===============
+
+Introduction
+------------
+
+NVIDIA NeMo is a conversational AI toolkit built for researchers working on automatic speech recognition (ASR),
+text-to-speech synthesis (TTS), large language models (LLMs), and
+natural language processing (NLP).
+The primary objective of NeMo is to help researchers from industry and academia to reuse prior work (code and pretrained models)
+and make it easier to create new `conversational AI models `_.
+
+All NeMo models are trained with `Lightning `_ and
+training is automatically scalable to 1000s of GPUs.
+Additionally, NeMo Megatron LLM models can be trained up to 1 trillion parameters using tensor and pipeline model parallelism.
+NeMo models can be optimized for inference and deployed for production use-cases with `NVIDIA Riva `_.
+
+Getting started with NeMo is simple.
+State of the Art pretrained NeMo models are freely available on `HuggingFace Hub `_ and
+`NVIDIA NGC `_.
+These models can be used to transcribe audio, synthesize speech, or translate text in just a few lines of code.
+
+We have extensive `tutorials `_ that
+can all be run on `Google Colab `_.
+
+For advanced users that want to train NeMo models from scratch or finetune existing NeMo models
+we have a full suite of `example scripts `_ that support multi-GPU/multi-node training.
+
+For scaling NeMo LLM training on Slurm clusters or public clouds, please see the `NVIDIA NeMo Megatron Launcher `_.
+The NM launcher has extensive recipes, scripts, utilities, and documentation for training NeMo LLMs and also has an `Autoconfigurator `_
+which can be used to find the optimal model parallel configuration for training on a specific cluster.
+
+Also see our `introductory video `_ for a high level overview of NeMo.
+
+Key Features
+------------
+
+* Speech processing
+ * `HuggingFace Space for Audio Transcription (File, Microphone and YouTube) `_
+ * `Automatic Speech Recognition (ASR) `_
+ * Supported models: Jasper, QuartzNet, CitriNet, Conformer-CTC, Conformer-Transducer, Squeezeformer-CTC, Squeezeformer-Transducer, ContextNet, LSTM-Transducer (RNNT), LSTM-CTC, FastConformer-CTC, FastConformer-Transducer...
+ * Supports CTC and Transducer/RNNT losses/decoders
+ * NeMo Original `Multi-blank Transducers `_
+ * Beam Search decoding
+ * `Language Modelling for ASR `_: N-gram LM in fusion with Beam Search decoding, Neural Rescoring with Transformer
+ * Streaming and Buffered ASR (CTC/Transducer) - `Chunked Inference Examples `_
+ * `Support of long audios for Conformer with memory efficient local attention `_
+ * `Speech Classification, Speech Command Recognition and Language Identification `_: MatchboxNet (Command Recognition), AmberNet (LangID)
+ * `Voice activity Detection (VAD) `_: MarbleNet
+ * ASR with VAD Inference - `Example `_
+ * `Speaker Recognition `_: TitaNet, ECAPA_TDNN, SpeakerNet
+ * `Speaker Diarization `_
+ * Clustering Diarizer: TitaNet, ECAPA_TDNN, SpeakerNet
+ * Neural Diarizer: MSDD (Multi-scale Diarization Decoder)
+ * `Speech Intent Detection and Slot Filling `_: Conformer-Transformer
+ * `Pretrained models on different languages. `_: English, Spanish, German, Russian, Chinese, French, Italian, Polish, ...
+ * `NGC collection of pre-trained speech processing models. `_
+* Natural Language Processing
+ * `NeMo Megatron pre-training of Large Language Models `_
+ * `Neural Machine Translation (NMT) `_
+ * `Punctuation and Capitalization `_
+ * `Token classification (named entity recognition) `_
+ * `Text classification `_
+ * `Joint Intent and Slot Classification `_
+ * `Question answering `_
+ * `GLUE benchmark `_
+ * `Information retrieval `_
+ * `Entity Linking `_
+ * `Dialogue State Tracking `_
+ * `Prompt Learning `_
+ * `NGC collection of pre-trained NLP models. `_
+ * `Synthetic Tabular Data Generation `_
+* `Speech synthesis (TTS) `_
+ * Spectrogram generation: Tacotron2, GlowTTS, TalkNet, FastPitch, FastSpeech2, Mixer-TTS, Mixer-TTS-X
+ * Vocoders: WaveGlow, SqueezeWave, UniGlow, MelGAN, HiFiGAN, UnivNet
+ * End-to-end speech generation: FastPitch_HifiGan_E2E, FastSpeech2_HifiGan_E2E, VITS
+ * `NGC collection of pre-trained TTS models. `_
+* `Tools `_
+ * `Text Processing (text normalization and inverse text normalization) `_
+ * `CTC-Segmentation tool `_
+ * `Speech Data Explorer `_: a dash-based tool for interactive exploration of ASR/TTS datasets
+
+
+Built for speed, NeMo can utilize NVIDIA's Tensor Cores and scale out training to multiple GPUs and multiple nodes.
+
+Requirements
+------------
+
+1) Python 3.8 or above
+2) Pytorch 1.10.0 or above
+3) NVIDIA GPU for training
+
+Documentation
+-------------
+
+.. |main| image:: https://readthedocs.com/projects/nvidia-nemo/badge/?version=main
+ :alt: Documentation Status
+ :scale: 100%
+ :target: https://docs.nvidia.com/deeplearning/nemo/user-guide/docs/en/main/
+
+.. |stable| image:: https://readthedocs.com/projects/nvidia-nemo/badge/?version=stable
+ :alt: Documentation Status
+ :scale: 100%
+ :target: https://docs.nvidia.com/deeplearning/nemo/user-guide/docs/en/stable/
+
++---------+-------------+------------------------------------------------------------------------------------------------------------------------------------------+
+| Version | Status | Description |
++=========+=============+==========================================================================================================================================+
+| Latest | |main| | `Documentation of the latest (i.e. main) branch. `_ |
++---------+-------------+------------------------------------------------------------------------------------------------------------------------------------------+
+| Stable | |stable| | `Documentation of the stable (i.e. most recent release) branch. `_ |
++---------+-------------+------------------------------------------------------------------------------------------------------------------------------------------+
+
+Tutorials
+---------
+A great way to start with NeMo is by checking `one of our tutorials `_.
+
+Getting help with NeMo
+----------------------
+FAQ can be found on NeMo's `Discussions board `_. You are welcome to ask questions or start discussions there.
+
+
+Installation
+------------
+
+Conda
+~~~~~
+
+We recommend installing NeMo in a fresh Conda environment.
+
+.. code-block:: bash
+
+ conda create --name nemo python==3.8.10
+ conda activate nemo
+
+Install PyTorch using their `configurator `_.
+
+.. code-block:: bash
+
+ conda install pytorch torchvision torchaudio pytorch-cuda=11.8 -c pytorch -c nvidia
+
+The command used to install PyTorch may depend on your system. Please use the configurator linked above to find the right command for your system.
+
+Pip
+~~~
+Use this installation mode if you want the latest released version.
+
+.. code-block:: bash
+
+ apt-get update && apt-get install -y libsndfile1 ffmpeg
+ pip install Cython
+ pip install nemo_toolkit['all']
+
+Depending on the shell used, you may need to use ``"nemo_toolkit[all]"`` instead in the above command.
+
+Pip from source
+~~~~~~~~~~~~~~~
+Use this installation mode if you want the version from a particular GitHub branch (e.g main).
+
+.. code-block:: bash
+
+ apt-get update && apt-get install -y libsndfile1 ffmpeg
+ pip install Cython
+ python -m pip install git+https://github.com/NVIDIA/NeMo.git@{BRANCH}#egg=nemo_toolkit[all]
+
+
+From source
+~~~~~~~~~~~
+Use this installation mode if you are contributing to NeMo.
+
+.. code-block:: bash
+
+ apt-get update && apt-get install -y libsndfile1 ffmpeg
+ git clone https://github.com/NVIDIA/NeMo
+ cd NeMo
+ ./reinstall.sh
+
+If you only want the toolkit without additional conda-based dependencies, you may replace ``reinstall.sh``
+with ``pip install -e .`` when your PWD is the root of the NeMo repository.
+
+RNNT
+~~~~
+Note that RNNT requires numba to be installed from conda.
+
+.. code-block:: bash
+
+ conda remove numba
+ pip uninstall numba
+ conda install -c conda-forge numba
+
+NeMo Megatron
+~~~~~~~~~~~~~
+NeMo Megatron training requires NVIDIA Apex to be installed.
+Install it manually if not using the NVIDIA PyTorch container.
+
+.. code-block:: bash
+
+ git clone https://github.com/NVIDIA/apex.git
+ cd apex
+ git checkout 03c9d80ed54c0eaa5b581bf42ceca3162f085327
+ 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" ./
+
+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.
+This raise can be avoided by commenting it here: https://github.com/NVIDIA/apex/blob/master/setup.py#L32
+
+cuda-nvprof is needed to install Apex. The version should match the CUDA version that you are using:
+
+.. code-block:: bash
+
+ conda install -c nvidia cuda-nvprof=11.8
+
+packaging is also needed:
+
+.. code-block:: bash
+
+ pip install -y packaging
+
+
+Transformer Engine
+~~~~~~~~~~~~~~~~~~
+NeMo Megatron GPT has been integrated with `NVIDIA Transformer Engine `_
+Transformer Engine enables FP8 training on NVIDIA Hopper GPUs.
+`Install `_ it manually if not using the NVIDIA PyTorch container.
+
+.. code-block:: bash
+
+ pip install --upgrade git+https://github.com/NVIDIA/TransformerEngine.git@stable
+
+It is highly recommended to use the NVIDIA PyTorch or NeMo container if having issues installing Transformer Engine or any other dependencies.
+
+Transformer Engine requires PyTorch to be built with CUDA 11.8.
+
+NeMo Text Processing
+~~~~~~~~~~~~~~~~~~~~
+NeMo Text Processing, specifically (Inverse) Text Normalization, is now a separate repository `https://github.com/NVIDIA/NeMo-text-processing `_.
+
+Docker containers:
+~~~~~~~~~~~~~~~~~~
+We release NeMo containers alongside NeMo releases. For example, NeMo ``r1.16.0`` comes with container ``nemo:23.01``, you may find more details about released containers in `releases page `_.
+
+To use built container, please run
+
+.. code-block:: bash
+
+ docker pull nvcr.io/nvidia/nemo:23.01
+
+To build a nemo container with Dockerfile from a branch, please run
+
+.. code-block:: bash
+
+ 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.02-py3 and then installing from GitHub.
+
+.. code-block:: bash
+
+ docker run --gpus all -it --rm -v :/NeMo --shm-size=8g \
+ -p 8888:8888 -p 6006:6006 --ulimit memlock=-1 --ulimit \
+ stack=67108864 --device=/dev/snd nvcr.io/nvidia/pytorch:23.02-py3
+
+Examples
+--------
+
+Many examples can be found under the `"Examples" `_ folder.
+
+
+Contributing
+------------
+
+We welcome community contributions! Please refer to the `CONTRIBUTING.md `_ CONTRIBUTING.md for the process.
+
+Publications
+------------
+
+We provide an ever growing list of publications that utilize the NeMo framework. Please refer to `PUBLICATIONS.md `_. We welcome the addition of your own articles to this list !
+
+License
+-------
+NeMo is under `Apache 2.0 license `_.
diff --git a/ci.groovy b/ci.groovy
new file mode 100644
index 0000000000000000000000000000000000000000..27ad659b99a1746685045a6fcdcd2d5874ead849
--- /dev/null
+++ b/ci.groovy
@@ -0,0 +1,119 @@
+@Library('blossom-github-lib@master')
+import ipp.blossom.*
+
+podTemplate(cloud:'sc-ipp-blossom-prod', yaml : """
+apiVersion: v1
+kind: Pod
+metadata:
+ labels:
+ some-label: some-label-value
+spec:
+ volumes:
+ - name: scratch
+ nfs:
+ server: ipp1-cdot01-col01
+ path: /vol/scratch1/scratch.okuchaiev_blossom
+ containers:
+ - name: latestdlfw
+ image: nvcr.io/nvidia/pytorch:23.02-py3
+ command:
+ - cat
+ volumeMounts:
+ - name: scratch
+ mountPath: /testdata
+ resources:
+ limits:
+ nvidia.com/gpu: 2
+ restartPolicy: Never
+ backoffLimit: 4
+ tty: true
+ shm-size: 32g
+ nodeSelector:
+ kubernetes.io/os: linux
+ nvidia.com/gpu_type: "Tesla_T4x4"
+ nvidia.com/node_type: gpu_tester
+ nvidia.com/driver_version: "510.20"
+"""
+) {
+ node(POD_LABEL) {
+ def githubHelper
+ stage('Get Token') {
+ withCredentials([usernamePassword(credentialsId: 'GHAtoken', passwordVariable: 'GIT_PASSWORD', usernameVariable: 'GIT_USERNAME')]) {
+ // create new instance of helper object
+ githubHelper = GithubHelper.getInstance("${GIT_PASSWORD}", githubData)
+ }
+
+ }
+ def stageName = ''
+ try {
+ currentBuild.description = githubHelper.getBuildDescription()
+ container('latestdlfw') {
+ stage('Code checkout') {
+ // update status on github
+ githubHelper.updateCommitStatus("$BUILD_URL", "$stageName Running", GitHubCommitState.PENDING)
+ checkout changelog: true, poll: true, scm: [$class: 'GitSCM', branches: [[name: "pr/"+githubHelper.getPRNumber()]],
+ doGenerateSubmoduleConfigurations: false,
+ submoduleCfg: [],
+ userRemoteConfigs: [[credentialsId: 'github-token', url: githubHelper.getCloneUrl(), refspec: '+refs/pull/*/head:refs/remotes/origin/pr/*']]]
+ }
+
+ stage('Code Style') {
+ sh "apt-get update && \
+ apt-get install -y bc && \
+ nvidia-smi && \
+ pip install -r requirements/requirements_test.txt && \
+ python setup.py style && ls -l /testdata/TestData && ln -s /testdata/TestData /home/TestData && \
+ ls -l /home && ls -l /home/TestData"
+ }
+
+ stage('Installation') {
+ sh "git config --global --add safe.directory '*' && nvidia-smi && ./reinstall.sh release"
+ }
+
+ stage('L0: GPU unit tests') {
+ sh "NEMO_NUMBA_MINVER=0.53 pytest -m 'not pleasefixme'"
+ }
+
+ parallel( //USE CUDA_VISIBLE_DEVICES to execute 2 single GPU tests in parallel here
+ [
+ "L1: NMT Training Pre-LN": { sh 'CUDA_VISIBLE_DEVICES=0 python examples/nlp/machine_translation/enc_dec_nmt.py \
+ --config-path=conf \
+ --config-name=aayn_base \
+ do_testing=true \
+ model.train_ds.src_file_name=/testdata/TestData/nlp/nmt/toy_data/wmt14-de-en.src \
+ model.train_ds.tgt_file_name=/testdata/TestData/nlp/nmt/toy_data/wmt14-de-en.ref \
+ model.validation_ds.src_file_name=/testdata/TestData/nlp/nmt/toy_data/wmt14-de-en.src \
+ model.validation_ds.tgt_file_name=/testdata/TestData/nlp/nmt/toy_data/wmt14-de-en.src \
+ model.test_ds.src_file_name=/testdata/TestData/nlp/nmt/toy_data/wmt14-de-en.src \
+ model.test_ds.tgt_file_name=/testdata/TestData/nlp/nmt/toy_data/wmt14-de-en.src \
+ model.encoder_tokenizer.tokenizer_model=/testdata/TestData/nlp/nmt/toy_data/tt_tokenizer.BPE.4096.model \
+ model.decoder_tokenizer.tokenizer_model=/testdata/TestData/nlp/nmt/toy_data/tt_tokenizer.BPE.4096.model \
+ model.encoder.pre_ln=true \
+ model.decoder.pre_ln=true \
+ trainer.devices=[0] \
+ trainer.accelerator="gpu" \
+ +trainer.fast_dev_run=true \
+ +trainer.limit_test_batches=2 \
+ exp_manager=null \
+ '},
+ "L1: Speech to text": { sh 'CUDA_VISIBLE_DEVICES=1 python examples/asr/asr_ctc/speech_to_text_ctc.py \
+ model.train_ds.manifest_filepath=/testdata/TestData/an4_dataset/an4_train.json \
+ model.validation_ds.manifest_filepath=/testdata/TestData/an4_dataset/an4_val.json \
+ trainer.devices=[0] \
+ trainer.accelerator="gpu" \
+ +trainer.fast_dev_run=True \
+ exp_manager=null \
+ '}
+ ]
+ )//end of parallel
+ }
+ githubHelper.updateCommitStatus("$BUILD_URL", "Complete", GitHubCommitState.SUCCESS)
+ }
+ catch (Exception ex){
+ currentBuild.result = 'FAILURE'
+ println ex
+ githubHelper.updateCommitStatus("$BUILD_URL", "$stageName Failed", GitHubCommitState.FAILURE)
+ }
+
+ }
+ }
\ No newline at end of file
diff --git a/docs/.nojekyll b/docs/.nojekyll
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/docs/Makefile b/docs/Makefile
new file mode 100644
index 0000000000000000000000000000000000000000..417fe2a0b149f603832abdd4dc070f30a331a502
--- /dev/null
+++ b/docs/Makefile
@@ -0,0 +1,216 @@
+# Makefile for Sphinx documentation
+#
+
+# You can set these variables from the command line.
+SPHINXOPTS =
+SPHINXBUILD = sphinx-build
+PAPER =
+BUILDDIR = build
+
+# User-friendly check for sphinx-build
+ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1)
+$(error The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don't have Sphinx installed, grab it from http://sphinx-doc.org/)
+endif
+
+# Internal variables.
+PAPEROPT_a4 = -D latex_paper_size=a4
+PAPEROPT_letter = -D latex_paper_size=letter
+ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source
+# the i18n builder cannot share the environment and doctrees with the others
+I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source
+
+.PHONY: help
+help:
+ @echo "Please use \`make ' where is one of"
+ @echo " html to make standalone HTML files"
+ @echo " dirhtml to make HTML files named index.html in directories"
+ @echo " singlehtml to make a single large HTML file"
+ @echo " pickle to make pickle files"
+ @echo " json to make JSON files"
+ @echo " htmlhelp to make HTML files and a HTML help project"
+ @echo " qthelp to make HTML files and a qthelp project"
+ @echo " applehelp to make an Apple Help Book"
+ @echo " devhelp to make HTML files and a Devhelp project"
+ @echo " epub to make an epub"
+ @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
+ @echo " latexpdf to make LaTeX files and run them through pdflatex"
+ @echo " latexpdfja to make LaTeX files and run them through platex/dvipdfmx"
+ @echo " text to make text files"
+ @echo " man to make manual pages"
+ @echo " texinfo to make Texinfo files"
+ @echo " info to make Texinfo files and run them through makeinfo"
+ @echo " gettext to make PO message catalogs"
+ @echo " changes to make an overview of all changed/added/deprecated items"
+ @echo " xml to make Docutils-native XML files"
+ @echo " pseudoxml to make pseudoxml-XML files for display purposes"
+ @echo " linkcheck to check all external links for integrity"
+ @echo " doctest to run all doctests embedded in the documentation (if enabled)"
+ @echo " coverage to run coverage check of the documentation (if enabled)"
+
+.PHONY: clean
+clean:
+ rm -rf $(BUILDDIR)/*
+
+.PHONY: html
+html:
+ $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
+ @echo
+ @echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
+
+.PHONY: dirhtml
+dirhtml:
+ $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
+ @echo
+ @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
+
+.PHONY: singlehtml
+singlehtml:
+ $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
+ @echo
+ @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
+
+.PHONY: pickle
+pickle:
+ $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
+ @echo
+ @echo "Build finished; now you can process the pickle files."
+
+.PHONY: json
+json:
+ $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
+ @echo
+ @echo "Build finished; now you can process the JSON files."
+
+.PHONY: htmlhelp
+htmlhelp:
+ $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
+ @echo
+ @echo "Build finished; now you can run HTML Help Workshop with the" \
+ ".hhp project file in $(BUILDDIR)/htmlhelp."
+
+.PHONY: qthelp
+qthelp:
+ $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
+ @echo
+ @echo "Build finished; now you can run "qcollectiongenerator" with the" \
+ ".qhcp project file in $(BUILDDIR)/qthelp, like this:"
+ @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/OpenSeq2Seq.qhcp"
+ @echo "To view the help file:"
+ @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/OpenSeq2Seq.qhc"
+
+.PHONY: applehelp
+applehelp:
+ $(SPHINXBUILD) -b applehelp $(ALLSPHINXOPTS) $(BUILDDIR)/applehelp
+ @echo
+ @echo "Build finished. The help book is in $(BUILDDIR)/applehelp."
+ @echo "N.B. You won't be able to view it unless you put it in" \
+ "~/Library/Documentation/Help or install it in your application" \
+ "bundle."
+
+.PHONY: devhelp
+devhelp:
+ $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
+ @echo
+ @echo "Build finished."
+ @echo "To view the help file:"
+ @echo "# mkdir -p $$HOME/.local/share/devhelp/OpenSeq2Seq"
+ @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/OpenSeq2Seq"
+ @echo "# devhelp"
+
+.PHONY: epub
+epub:
+ $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
+ @echo
+ @echo "Build finished. The epub file is in $(BUILDDIR)/epub."
+
+.PHONY: latex
+latex:
+ $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
+ @echo
+ @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
+ @echo "Run \`make' in that directory to run these through (pdf)latex" \
+ "(use \`make latexpdf' here to do that automatically)."
+
+.PHONY: latexpdf
+latexpdf:
+ $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
+ @echo "Running LaTeX files through pdflatex..."
+ $(MAKE) -C $(BUILDDIR)/latex all-pdf
+ @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
+
+.PHONY: latexpdfja
+latexpdfja:
+ $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
+ @echo "Running LaTeX files through platex and dvipdfmx..."
+ $(MAKE) -C $(BUILDDIR)/latex all-pdf-ja
+ @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
+
+.PHONY: text
+text:
+ $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
+ @echo
+ @echo "Build finished. The text files are in $(BUILDDIR)/text."
+
+.PHONY: man
+man:
+ $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
+ @echo
+ @echo "Build finished. The manual pages are in $(BUILDDIR)/man."
+
+.PHONY: texinfo
+texinfo:
+ $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
+ @echo
+ @echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo."
+ @echo "Run \`make' in that directory to run these through makeinfo" \
+ "(use \`make info' here to do that automatically)."
+
+.PHONY: info
+info:
+ $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
+ @echo "Running Texinfo files through makeinfo..."
+ make -C $(BUILDDIR)/texinfo info
+ @echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo."
+
+.PHONY: gettext
+gettext:
+ $(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale
+ @echo
+ @echo "Build finished. The message catalogs are in $(BUILDDIR)/locale."
+
+.PHONY: changes
+changes:
+ $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
+ @echo
+ @echo "The overview file is in $(BUILDDIR)/changes."
+
+.PHONY: linkcheck
+linkcheck:
+ $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
+ @echo
+ @echo "Link check complete; look for any errors in the above output " \
+ "or in $(BUILDDIR)/linkcheck/output.txt."
+
+.PHONY: doctest
+doctest:
+ $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
+ @echo "Testing of doctests in the sources finished, look at the " \
+ "results in $(BUILDDIR)/doctest/output.txt."
+
+.PHONY: coverage
+coverage:
+ $(SPHINXBUILD) -b coverage $(ALLSPHINXOPTS) $(BUILDDIR)/coverage
+ @echo "Testing of coverage in the sources finished, look at the " \
+ "results in $(BUILDDIR)/coverage/python.txt."
+
+.PHONY: xml
+xml:
+ $(SPHINXBUILD) -b xml $(ALLSPHINXOPTS) $(BUILDDIR)/xml
+ @echo
+ @echo "Build finished. The XML files are in $(BUILDDIR)/xml."
+
+.PHONY: pseudoxml
+pseudoxml:
+ $(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml
+ @echo
+ @echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml."
diff --git a/docs/source/_static/css/custom.css b/docs/source/_static/css/custom.css
new file mode 100644
index 0000000000000000000000000000000000000000..e5dbe2515c0640fc5a8b5d8b7ba50265ae930b26
--- /dev/null
+++ b/docs/source/_static/css/custom.css
@@ -0,0 +1,298 @@
+/* Import the Roboto Thin Font */
+@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400&display=swap');
+
+body {
+ font-size: 100%;
+ font-family: 'Roboto', sans-serif;
+}
+
+
+/* Width of template */
+
+.wy-nav-content {
+ max-width: 1200px !important;
+}
+
+
+
+/* Standard Text Formatting */
+
+h1 {
+ color: #76b900;
+ text-align: center;
+ /* background-color: #ffffff; */
+}
+
+h2 {
+ color: #ffffff;
+ /* background-color: #ffffff; */
+ /* #76b900 */
+ Padding: 5px;
+}
+
+h3 {
+ padding-top: 0px;
+ border-top: solid 3px #000000;
+ /* #76b900 */
+ border-bottom: solid 3px #000000;
+ /* #76b900 */
+}
+
+p {
+ margin-bottom: 24px;
+}
+
+/* Link Colors */
+a {
+ color: #76b900;
+}
+
+a:visited {
+ color: #218219;
+}
+
+.container-xl {
+ margin-right: unset;
+ margin-left: unset;
+}
+
+section {
+ overflow-x: auto;
+}
+
+/* ----------------------------------------------TABLES--------------------------------------- */
+section table {
+ overflow-x: auto;
+ display: block;
+}
+
+table {
+ font-size: small;
+}
+
+/* Table head Color */
+thead td {
+ background-color: #333333 !important;
+}
+
+.row-odd p {
+ /*padding-bottom: 0px;*/
+ /*margin-bottom: 0px;*/
+}
+
+/* even rows*/
+
+.row-even tr {
+ background-color: #e5f1e6 !important;
+}
+
+/* odd rows*/
+
+
+.wy-table-responsive table tr {
+ background-color: #ffffff !important;
+}
+
+
+
+.wy-table-responsive table td {
+ white-space: normal;
+}
+
+
+/* Removes bottom margin in tables*/
+
+.rst-content .line-block {
+ margin-bottom: 0px;
+}
+
+.wy-table-responsive {
+ overflow: visible !important;
+}
+
+/* reduces the size of text in multiline table columns. */
+
+.rst-content table.docutils td {
+ font-size: 80%;
+}
+
+.rst-content dl:not(.docutils) dt {
+
+ background-color: inherit;
+ color: #000000;
+ border-top: solid 0px #000000;
+
+}
+
+.rst-content dl:not(.docutils) dt:before {
+ color: #333333;
+}
+
+.rst-content .line-block {
+ margin-bottom: 0px;
+}
+
+.wy-side-nav-search,
+.wy-nav-top {
+ background-color: #000000;
+ padding: 0;
+}
+
+.wy-side-nav-search img {
+ padding: 0px;
+ padding: 0px 0px;
+ margin-bottom: 0;
+}
+
+.wy-side-nav-search input[type=text] {
+ border-radius: 0px;
+}
+
+
+.wy-menu-vertical p.caption {
+ color: #76b900;
+}
+
+
+.wy-side-nav-search>a img.logo,
+.wy-side-nav-search .wy-dropdown>a img.logo {
+ margin: 0px 0px 0px 0px;
+}
+
+.wy-nav-content {
+ margin: 0;
+ min-height: 100%;
+ height: 100%;
+ background: #ffffff;
+}
+
+/* List (numbered, bulleted) padding Fix */
+
+
+.wy-plain-list-decimal li {
+ margin-top: -6px;
+ margin-bottom: -6px;
+}
+
+.rst-content .section ol.loweralpha {
+ margin-top: -6px;
+ margin-bottom: 12px;
+}
+
+.wy-plain-list-disc,
+.rst-content .toctree-wrapper ul,
+article ul {
+ margin-top: 0px !important;
+ margin-bottom: 12px;
+}
+
+/* Alert Boxes */
+/* Background color of Alert Box Title */
+
+.rst-content .section ul {
+ margin-top: -12px;
+ margin-bottom: 16px;
+}
+
+.wy-alert.wy-alert-info .wy-alert-title,
+.rst-content .note .wy-alert-title,
+.rst-content .wy-alert-info.attention .wy-alert-title,
+.rst-content .wy-alert-info.caution .wy-alert-title,
+.rst-content .wy-alert-info.danger .wy-alert-title,
+.rst-content .wy-alert-info.error .wy-alert-title,
+.rst-content .wy-alert-info.hint .wy-alert-title,
+.rst-content .wy-alert-info.important .wy-alert-title,
+.rst-content .wy-alert-info.tip .wy-alert-title,
+.rst-content .wy-alert-info.warning .wy-alert-title,
+.rst-content .seealso .wy-alert-title,
+.rst-content .wy-alert-info.admonition-todo .wy-alert-title,
+.rst-content .wy-alert-info.admonition .wy-alert-title,
+.wy-alert.wy-alert-info .rst-content .admonition-title,
+.rst-content .wy-alert.wy-alert-info .admonition-title,
+.rst-content .note .admonition-title,
+.rst-content .wy-alert-info.attention .admonition-title,
+.rst-content .wy-alert-info.caution .admonition-title,
+.rst-content .wy-alert-info.danger .admonition-title,
+.rst-content .wy-alert-info.error .admonition-title,
+.rst-content .wy-alert-info.hint .admonition-title,
+.rst-content .wy-alert-info.important .admonition-title,
+.rst-content .wy-alert-info.tip .admonition-title,
+.rst-content .wy-alert-info.warning .admonition-title,
+.rst-content .seealso .admonition-title,
+.rst-content .wy-alert-info.admonition-todo .admonition-title,
+.rst-content .wy-alert-info.admonition .admonition-title {
+ background: #76b900;
+}
+
+/* Background and Font Color of Alert Box Main Body*/
+.wy-alert.wy-alert-info,
+.rst-content .note,
+.rst-content .wy-alert-info.attention,
+.rst-content .wy-alert-info.caution,
+.rst-content .wy-alert-info.danger,
+.rst-content .wy-alert-info.error,
+.rst-content .wy-alert-info.hint,
+.rst-content .wy-alert-info.important,
+.rst-content .wy-alert-info.tip,
+.rst-content .wy-alert-info.warning,
+.rst-content .seealso,
+.rst-content .wy-alert-info.admonition-todo,
+.rst-content .wy-alert-info.admonition {
+ background: #333333;
+ color: #999999;
+}
+
+.section {
+ margin-top: 50px;
+}
+
+/* Logo */
+.navbar-brand-box {
+ background-color: #ffffff;
+}
+
+/* ---------------------------------------------- Media Queries --------------------------------------- */
+@media (min-width: 1200px) {
+ .container-xl {
+ max-width: 100%;
+ }
+}
+
+@media (min-width: 1400px) {
+ body {
+ font-size: 18px;
+ }
+
+ #site-navigation nav ul.nav {
+ font-size: 18px;
+ }
+
+ #site-navigation nav.bd-links p {
+ font-size: 18px;
+ }
+
+ #site-navigation {
+ width: 350px;
+ }
+
+ .toc-h2 {
+ font-size: 18px;
+ }
+
+ .toc-h3 {
+ font-size: 1rem;
+ }
+
+ .toc-h4 {
+ font-size: 0.85rem;
+ }
+
+ .header-article .bd-toc {
+ font-size: 18px;
+ }
+
+ #main-content>div {
+ margin-left: 10%;
+ margin-right: 10%;
+ }
+}
\ No newline at end of file
diff --git a/docs/source/_static/js/pk_scripts.js b/docs/source/_static/js/pk_scripts.js
new file mode 100644
index 0000000000000000000000000000000000000000..23c74982d3aad11ab94c31e623b60e0ebe66972a
--- /dev/null
+++ b/docs/source/_static/js/pk_scripts.js
@@ -0,0 +1,19 @@
+document.addEventListener("DOMContentLoaded", function () {
+ var params = window.location.search.substring(1).split("&").reduce(function (params, param) {
+ if (!param) {
+ return params;
+ }
+
+ var values = param.split("=");
+ var name = values[0];
+ var value = values[1];
+ params[name] = value;
+ return params;
+ }, {});
+
+ var form = document.getElementById("feedback-form");
+ for (var name in params) {
+ var input = form.querySelector("[name=" + name + "]");
+ input.value = params[name];
+ }
+});
\ No newline at end of file
diff --git a/docs/source/_templates/layout.html b/docs/source/_templates/layout.html
new file mode 100644
index 0000000000000000000000000000000000000000..c8651c293491cbc0eadfc36138eaadcb9552d359
--- /dev/null
+++ b/docs/source/_templates/layout.html
@@ -0,0 +1,14 @@
+{% extends "!layout.html" %}
+
+{% block extrahead %}
+
+
+
+{% endblock %}
+
+{% block footer %}
+
+
+
+{% endblock %}
\ No newline at end of file
diff --git a/docs/source/asr/api.rst b/docs/source/asr/api.rst
new file mode 100644
index 0000000000000000000000000000000000000000..5735990dc82ad40fb888227eea97a7e5baf99886
--- /dev/null
+++ b/docs/source/asr/api.rst
@@ -0,0 +1,299 @@
+NeMo ASR collection API
+=======================
+
+
+Model Classes
+-------------
+
+.. autoclass:: nemo.collections.asr.models.EncDecCTCModel
+ :show-inheritance:
+ :members: transcribe, change_vocabulary, setup_training_data, setup_optimization, setup_validation_data, setup_test_data, register_artifact
+
+
+.. autoclass:: nemo.collections.asr.models.EncDecCTCModelBPE
+ :show-inheritance:
+ :members: transcribe, change_vocabulary, setup_training_data, setup_optimization, setup_validation_data, setup_test_data, register_artifact
+
+
+.. autoclass:: nemo.collections.asr.models.EncDecRNNTModel
+ :show-inheritance:
+ :members: transcribe, change_vocabulary, setup_training_data, setup_optimization, setup_validation_data, setup_test_data, register_artifact
+
+
+.. autoclass:: nemo.collections.asr.models.EncDecRNNTBPEModel
+ :show-inheritance:
+ :members: transcribe, change_vocabulary, setup_training_data, setup_optimization, setup_validation_data, setup_test_data, register_artifact
+
+
+.. autoclass:: nemo.collections.asr.models.EncDecClassificationModel
+ :show-inheritance:
+ :members: setup_training_data, setup_optimization, setup_validation_data, setup_test_data, register_artifact
+
+
+.. autoclass:: nemo.collections.asr.models.EncDecSpeakerLabelModel
+ :show-inheritance:
+ :members: setup_training_data, setup_optimization, setup_validation_data, setup_test_data, register_artifact
+
+
+Modules
+-------
+
+.. autoclass:: nemo.collections.asr.modules.ConvASREncoder
+ :show-inheritance:
+ :members:
+
+.. autoclass:: nemo.collections.asr.modules.ConvASRDecoder
+ :show-inheritance:
+ :members:
+
+.. autoclass:: nemo.collections.asr.modules.ConvASRDecoderClassification
+ :show-inheritance:
+ :members:
+
+.. autoclass:: nemo.collections.asr.modules.SpeakerDecoder
+ :show-inheritance:
+ :members:
+
+.. _conformer-encoder-api:
+
+.. autoclass:: nemo.collections.asr.modules.ConformerEncoder
+ :show-inheritance:
+ :members:
+
+.. _squeezeformer-encoder-api:
+
+.. autoclass:: nemo.collections.asr.modules.SqueezeformerEncoder
+ :show-inheritance:
+ :members:
+
+.. _rnn-encoder-api:
+
+.. autoclass:: nemo.collections.asr.modules.RNNEncoder
+ :show-inheritance:
+ :members:
+
+.. _rnnt-decoder-api:
+
+.. autoclass:: nemo.collections.asr.modules.RNNTDecoder
+ :show-inheritance:
+ :members:
+
+.. autoclass:: nemo.collections.asr.modules.StatelessTransducerDecoder
+ :show-inheritance:
+ :members:
+
+.. _rnnt-joint-api:
+
+.. autoclass:: nemo.collections.asr.modules.RNNTJoint
+ :show-inheritance:
+ :members:
+
+.. autoclass:: nemo.collections.asr.modules.SampledRNNTJoint
+ :show-inheritance:
+ :members:
+
+
+
+Parts
+-----
+
+.. autoclass:: nemo.collections.asr.parts.submodules.jasper.JasperBlock
+ :show-inheritance:
+ :members:
+
+
+Mixins
+------
+
+.. autoclass:: nemo.collections.asr.parts.mixins.mixins.ASRBPEMixin
+ :show-inheritance:
+ :members:
+
+.. autoclass:: nemo.collections.asr.parts.mixins.mixins.ASRModuleMixin
+ :show-inheritance:
+ :members:
+
+.. autoclass:: nemo.collections.asr.parts.mixins.interctc_mixin.InterCTCMixin
+ :show-inheritance:
+ :members:
+
+Datasets
+--------
+
+Character Encoding Datasets
+~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+.. autoclass:: nemo.collections.asr.data.audio_to_text.AudioToCharDataset
+ :show-inheritance:
+ :members:
+
+.. autoclass:: nemo.collections.asr.data.audio_to_text.TarredAudioToCharDataset
+ :show-inheritance:
+ :members:
+
+Subword Encoding Datasets
+~~~~~~~~~~~~~~~~~~~~~~~~~
+
+.. autoclass:: nemo.collections.asr.data.audio_to_text.AudioToBPEDataset
+ :show-inheritance:
+ :members:
+
+.. autoclass:: nemo.collections.asr.data.audio_to_text.TarredAudioToBPEDataset
+ :show-inheritance:
+ :members:
+
+Audio Preprocessors
+-------------------
+
+.. autoclass:: nemo.collections.asr.modules.AudioToMelSpectrogramPreprocessor
+ :show-inheritance:
+ :members:
+
+.. autoclass:: nemo.collections.asr.modules.AudioToMFCCPreprocessor
+ :show-inheritance:
+ :members:
+
+Audio Augmentors
+----------------
+
+.. autoclass:: nemo.collections.asr.modules.SpectrogramAugmentation
+ :show-inheritance:
+ :members:
+
+.. autoclass:: nemo.collections.asr.modules.CropOrPadSpectrogramAugmentation
+ :show-inheritance:
+ :members:
+
+.. autoclass:: nemo.collections.asr.parts.preprocessing.perturb.SpeedPerturbation
+ :show-inheritance:
+ :members:
+
+.. autoclass:: nemo.collections.asr.parts.preprocessing.perturb.TimeStretchPerturbation
+ :show-inheritance:
+ :members:
+
+.. autoclass:: nemo.collections.asr.parts.preprocessing.perturb.GainPerturbation
+ :show-inheritance:
+ :members:
+
+.. autoclass:: nemo.collections.asr.parts.preprocessing.perturb.ImpulsePerturbation
+ :show-inheritance:
+ :members:
+
+.. autoclass:: nemo.collections.asr.parts.preprocessing.perturb.ShiftPerturbation
+ :show-inheritance:
+ :members:
+
+.. autoclass:: nemo.collections.asr.parts.preprocessing.perturb.NoisePerturbation
+ :show-inheritance:
+ :members:
+
+.. autoclass:: nemo.collections.asr.parts.preprocessing.perturb.WhiteNoisePerturbation
+ :show-inheritance:
+ :members:
+
+.. autoclass:: nemo.collections.asr.parts.preprocessing.perturb.RirAndNoisePerturbation
+ :show-inheritance:
+ :members:
+
+.. autoclass:: nemo.collections.asr.parts.preprocessing.perturb.TranscodePerturbation
+ :show-inheritance:
+ :members:
+
+Miscellaneous Classes
+---------------------
+
+CTC Decoding
+~~~~~~~~~~~~
+
+.. autoclass:: nemo.collections.asr.metrics.wer.CTCDecoding
+ :show-inheritance:
+ :members:
+
+.. autoclass:: nemo.collections.asr.metrics.wer_bpe.CTCBPEDecoding
+ :show-inheritance:
+ :members:
+
+.. autoclass:: nemo.collections.asr.parts.submodules.ctc_greedy_decoding.GreedyCTCInfer
+ :show-inheritance:
+ :members:
+
+.. autoclass:: nemo.collections.asr.parts.submodules.ctc_beam_decoding.BeamCTCInfer
+ :show-inheritance:
+ :members:
+
+RNNT Decoding
+~~~~~~~~~~~~~
+
+.. autoclass:: nemo.collections.asr.metrics.rnnt_wer.RNNTDecoding
+ :show-inheritance:
+ :members:
+
+.. autoclass:: nemo.collections.asr.metrics.rnnt_wer_bpe.RNNTBPEDecoding
+ :show-inheritance:
+ :members:
+
+.. autoclass:: nemo.collections.asr.parts.submodules.rnnt_greedy_decoding.GreedyRNNTInfer
+ :show-inheritance:
+ :members:
+
+.. autoclass:: nemo.collections.asr.parts.submodules.rnnt_greedy_decoding.GreedyBatchedRNNTInfer
+ :show-inheritance:
+ :members:
+
+.. autoclass:: nemo.collections.asr.parts.submodules.rnnt_beam_decoding.BeamRNNTInfer
+ :show-inheritance:
+ :members:
+
+Hypotheses
+~~~~~~~~~~
+
+.. autoclass:: nemo.collections.asr.parts.utils.rnnt_utils.Hypothesis
+ :show-inheritance:
+ :no-members:
+
+.. autoclass:: nemo.collections.asr.parts.utils.rnnt_utils.NBestHypotheses
+ :show-inheritance:
+ :no-members:
+
+Adapter Networks
+~~~~~~~~~~~~~~~~
+
+.. autoclass:: nemo.collections.asr.parts.submodules.adapters.multi_head_attention_adapter_module.MultiHeadAttentionAdapter
+ :show-inheritance:
+ :members:
+ :member-order: bysource
+
+-----
+
+.. autoclass:: nemo.collections.asr.parts.submodules.adapters.multi_head_attention_adapter_module.RelPositionMultiHeadAttentionAdapter
+ :show-inheritance:
+ :members:
+ :member-order: bysource
+
+-----
+
+.. autoclass:: nemo.collections.asr.parts.submodules.adapters.multi_head_attention_adapter_module.PositionalEncodingAdapter
+ :show-inheritance:
+ :members:
+ :member-order: bysource
+
+-----
+
+.. autoclass:: nemo.collections.asr.parts.submodules.adapters.multi_head_attention_adapter_module.RelPositionalEncodingAdapter
+ :show-inheritance:
+ :members:
+ :member-order: bysource
+
+
+Adapter Strategies
+~~~~~~~~~~~~~~~~~~
+
+.. autoclass:: nemo.collections.asr.parts.submodules.adapters.multi_head_attention_adapter_module.MHAResidualAddAdapterStrategy
+ :show-inheritance:
+ :members:
+ :member-order: bysource
+ :undoc-members: adapter_module_names
+
+-----
+
diff --git a/docs/source/asr/asr_all.bib b/docs/source/asr/asr_all.bib
new file mode 100644
index 0000000000000000000000000000000000000000..01c765f68f371557b5b37d38598c899711c7abf7
--- /dev/null
+++ b/docs/source/asr/asr_all.bib
@@ -0,0 +1,1043 @@
+@article{matchboxnet,
+ title={{MatchboxNet}: 1D Time-Channel Separable Convolutional Neural Network Architecture for Speech Commands Recognition},
+ author={Majumdar, Somshubra and Ginsburg, Boris},
+ journal={Proc. Interspeech 2020},
+ year={2020}
+}
+
+@article{marblenet,
+ title={MarbleNet: Deep 1D Time-Channel Separable Convolutional Neural Network for Voice Activity Detection},
+ author={Jia, Fei and Majumdar, Somshubra and Ginsburg, Boris},
+ journal={arXiv preprint arXiv:2010.13886},
+ year={2020}
+}
+
+@inproceedings{panayotov2015librispeech,
+ title={Librispeech: an ASR corpus based on public domain audio books},
+ author={Panayotov, Vassil and Chen, Guoguo and Povey, Daniel and Khudanpur, Sanjeev},
+ booktitle={Acoustics, Speech and Signal Processing (ICASSP), 2015 IEEE International Conference on},
+ pages={5206--5210},
+ year={2015},
+ organization={IEEE}
+}
+
+@article{luong17,
+ author = {Minh{-}Thang Luong and Eugene Brevdo and Rui Zhao},
+ title = {Neural Machine Translation (seq2seq) Tutorial},
+ journal = {https://github.com/tensorflow/nmt},
+ year = {2017},
+}
+
+@INPROCEEDINGS{LaurentSeqWiseBN,
+author={C. {Laurent} and G. {Pereyra} and P. {Brakel} and Y. {Zhang} and Y. {Bengio}},
+booktitle={2016 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP)},
+title={Batch normalized recurrent neural networks},
+year={2016},
+volume={},
+number={},
+pages={2657-2661},
+keywords={feedforward neural nets;learning (artificial intelligence);recurrent neural nets;speech recognition;batch normalized recurrent neural networks;RNN;sequential data;long-term dependency learning;convergence rate improvement;intermediate representation normalization;feedforward neural networks;speech recognition task;language modeling;training criterion;Training;Recurrent neural networks;Convergence;Speech recognition;Computer architecture;Speech;batch normalization;RNN;LSTM;optimization},
+doi={10.1109/ICASSP.2016.7472159},
+ISSN={2379-190X},
+month={March},}
+
+@article{graves2005,
+ author = {Alex Graves and Jurgen Schmidhuber},
+ title = {Framewise phoneme classification with bidirectional LSTM and other neural network architectures},
+ journal = {Neural Networks, vol. 18},
+ pages={602–-610},
+ year = {2005},
+}
+
+@inproceedings{graves2006,
+ title={Connectionist temporal classification: labelling unsegmented sequence data with recurrent neural networks},
+ author={Graves, Alex and Fern{\'a}ndez, Santiago and Gomez, Faustino and Schmidhuber, J{\"u}rgen},
+ booktitle={Proceedings of the 23rd international conference on Machine learning},
+ pages={369--376},
+ year={2006},
+ organization={ACM}
+}
+
+@article{li2019jasper,
+ title={Jasper: An End-to-End Convolutional Neural Acoustic Model},
+ author={Li, Jason and Lavrukhin, Vitaly and Ginsburg, Boris and Leary, Ryan and Kuchaiev, Oleksii and Cohen, Jonathan M and Nguyen, Huyen and Gadde, Ravi Teja},
+ journal={arXiv preprint arXiv:1904.03288},
+ year={2019}
+}
+
+@misc{ardila2019common,
+ title={Common Voice: A Massively-Multilingual Speech Corpus},
+ author={Rosana Ardila and Megan Branson and Kelly Davis and Michael Henretty and Michael Kohler and Josh Meyer and Reuben Morais and Lindsay Saunders and Francis M. Tyers and Gregor Weber},
+ year={2019},
+ eprint={1912.06670},
+ archivePrefix={arXiv},
+ primaryClass={cs.CL}
+}
+
+@article{graves2012,
+ title={Sequence Transduction with Recurrent Neural Networks},
+ author={Graves, Alex},
+ journal={arXiv preprint arXiv:1211.3711},
+ year={2012}
+}
+
+
+@article{graves2013,
+ title={Generating sequences with recurrent neural networks},
+ author={Graves, Alex},
+ journal={arXiv preprint arXiv:1308.0850},
+ year={2013}
+}
+
+@article{sergeev2018horovod,
+ title={Horovod: fast and easy distributed deep learning in TensorFlow},
+ author={Sergeev, Alexander and Del Balso, Mike},
+ journal={arXiv preprint arXiv:1802.05799},
+ year={2018}
+}
+
+@misc{NVVolta,
+ title = {NVIDIA TESLA V100 GPU ARCHITECTURE},
+ howpublished = {\url{http://images.nvidia.com/content/volta-architecture/pdf/volta-architecture-whitepaper.pdf}},
+ note = {Accessed: 2018-10-09}
+}
+
+@article{NVTuring,
+ title = {NVIDIA TURING GPU ARCHITECTURE},
+ howpublished = {\url{https://www.nvidia.com/content/dam/en-zz/Solutions/design-visualization/technologies/turing-architecture/NVIDIA-Turing-Architecture-Whitepaper.pdf}},
+ author = {NVIDIA},
+ year = {2018},
+ note = {Accessed: 2018-10-09}
+}
+
+@misc{Rygaard2015,
+ title = {Using Synthesized Speech to Improve Speech Recognition for Low-Resource Languages},
+ author = {Luise Valentin Rygaard},
+ howpublished = {\url{https://parasol.tamu.edu/dreu2015/Rygaard/report.pdf}},
+ year = {2015},
+}
+
+@misc{OpenSeq2Seq,
+ title = {OpenSeq2Seq: extensible toolkit for distributed and mixed precision training of sequence-to-sequence models},
+ author = {Kuchaiev, Oleksii and Ginsburg, Boris and Gitman, Igor and Lavrukhin,Vitaly and Case, Carl and Micikevicius, Paulius},
+ howpublished = {\url{https://arxiv.org/abs/1805.10387}},
+ year = {2018},
+}
+
+@misc{MPGuide,
+ title = {Training with Mixed Precision},
+ howpublished = {\url{http://docs.nvidia.com/deeplearning/sdk/mixed-precision-training/}},
+ note = {Accessed: 2018-04-06},
+}
+
+@misc{Mozilla,
+ title = {Mozilla: A Journey to less than 10\% Word Error Rate},
+ howpublished = {\url{https://hacks.mozilla.org/2017/11/a-journey-to-10-word-error-rate/}},
+ note = {Accessed: 2018-04-06},
+}
+
+@article{Waibel1989,
+ title={A time-delay neural network architecture for isolated word recognition},
+ author={Waibel, Alexander, and Hanazawa, Toshiyki and Hinton,Geoffrey and Shirano, Kiyohiro and Lang, Kevin },
+ journal={IEEE Trans. on Acoustics, Speech and Signal Processing},
+ year={1989}
+}
+
+@article{Lang1990,
+ title={A time-delay neural network architecture for isolated word recognition},
+ author={Lang, Kevin and Waibel, Alexander, and Hinton,Geoffrey },
+ journal={Neural Networks},
+ year={1990}
+}
+
+@book{Bengio1996,
+ Author = {Bengio, Y.},
+ Publisher = {International Thomson Computer Press},
+ Title = {Neural Networks for Speech and Sequence Recognition},
+ Year = {1996}
+}
+
+@article{Bengio1992,
+ title={Global optimization of a neural network-hidden Markov model hybrid},
+ author={Bengio, Y., and De Mori, R., and Flammia, G., and Kompe, R. },
+ journal={IEEE Transactions on Neural Networks, 3(2), 252–259},
+ year={1992}
+}
+
+@article{Bourlard1994,
+ title={Connectionist speech recognition: a hybrid approach},
+ author={Bourlard, H. A. and Morgan, N.},
+ journal={volume 247 Springer },
+ year={1994}
+}
+
+@article{srivastava14a,
+ author = {Nitish Srivastava, and Geoffrey Hinton, and Alex Krizhevsky, and Ilya Sutskever, and Ruslan Salakhutdinov},
+ title = {Dropout: A Simple Way to Prevent Neural Networks from Overfitting},
+ journal = {Journal of Machine Learning Research},
+ year = {2014},
+ volume = {15},
+ pages = {1929-1958},
+ url = {http://jmlr.org/papers/v15/srivastava14a.html}
+}
+
+
+@article{Hinton2012,
+ title={Deep Neural Networks for Acoustic Modeling in Speech Recognition},
+ author={ Hinton,Geoffrey and Deng, Li and Yu, Dong and Dahl,George and Mohamed,Abdel-rahman and Jaitly, Navdeep and Senior, Andrew and Vanhoucke, Vincent and Nguyen, Patrick and Kingsbury, Brian and Sainath, Tara},
+ journal={IEEE Signal Processing Magazine},
+ year={2012}
+}
+
+@article{Graves2014,
+ title={Towards End-to-End Speech Recognition with Recurrent Neural Networks},
+ author={Graves, Alex and Jaitly, Navdeep},
+ journal={International Conference on Machine Learning},
+ year={2014}
+}
+
+@article{Chorowski2014,
+ title={End-to-end Continuous Speech Recognition using Attention-based Recurrent NN: First Results},
+ author={ Chorowski, Jan, and Bahdanau, Dzmitry , and Cho, Kyunghyun , and Bengio, Yoshua },
+ journal={Neural Information Processing Systems: Workshop Deep Learning and Representation Learning Workshop },
+ year={2014}
+}
+
+@article{Sak2014,
+ title={Long short-term memory recurrent neural network architectures for large scale acoustic modeling},
+ author={Sak, Hasim and Senior, Andrew and Beaufays, Francoise },
+ journal={Interspeech 2014},
+ year={2014}
+}
+
+@article{Ko2015,
+ title={Audio Augmentation for Speech Recognition},
+ author={Tom, Ko and Vijayaditya, Peddinti and Daniel, Povey
+ and Sanjeev, Khudanpur },
+ journal={Interspeech 2015},
+ year={2015}
+}
+
+@article{Tjandra2017,
+ title={Listening while Speaking: Speech Chain by Deep Learning},
+ author={Andros, Tjandra and Sakriani, Sakti and Satoshi, Nakamura },
+ journal={ASRU 2017},
+ year={2017}
+}
+
+@article{Tjandra2018,
+ title={Machine Speech Chain with One-shot Speaker Adaptation},
+ author={Andros, Tjandra and Sakriani, Sakti and Satoshi, Nakamura },
+ journal={Interspeech 2018},
+ year={2018}
+}
+
+@article{bahdanau2014neural,
+ title={Neural machine translation by jointly learning to align and translate},
+ author={Bahdanau, Dzmitry and Cho, Kyunghyun and Bengio, Yoshua},
+ journal={arXiv preprint arXiv:1409.0473},
+ year={2014}
+}
+
+@article{cho2014learning,
+ title={Learning phrase representations using RNN encoder-decoder for statistical machine translation},
+ author={Cho, Kyunghyun and Van Merri{\"e}nboer, Bart and Gulcehre, Caglar and Bahdanau, Dzmitry and Bougares, Fethi and Schwenk, Holger and Bengio, Yoshua},
+ journal={arXiv preprint arXiv:1406.1078},
+ year={2014}
+}
+
+@article{rush2015neural,
+ title={A neural attention model for abstractive sentence summarization},
+ author={Rush, Alexander M and Chopra, Sumit and Weston, Jason},
+ journal={arXiv preprint arXiv:1509.00685},
+ year={2015}
+}
+
+@article{micikevicius2017mixed,
+ title={Mixed precision training},
+ author={Micikevicius, Paulius and Narang, Sharan and Alben, Jonah and Diamos, Gregory and Elsen, Erich and Garcia, David and Ginsburg, Boris and Houston, Michael and Kuchaev, Oleksii and Venkatesh, Ganesh and others},
+ journal={arXiv preprint arXiv:1710.03740},
+ year={2017}
+}
+
+@ARTICLE{Britz:2017,
+ author = {{Britz}, Denny and {Goldie}, Anna and {Luong}, Thang and {Le}, Quoc},
+ title = {Massive Exploration of Neural Machine Translation Architectures},
+ journal = {ArXiv e-prints arXiv:1703.03906},
+ archivePrefix = "arXiv",
+ eprinttype = {arxiv},
+ eprint = {1703.03906},
+ primaryClass = "cs.CL",
+ keywords = {Computer Science - Computation and Language},
+ year = 2017,
+ month = mar
+}
+
+@inproceedings{abadi2016tensorflow,
+ title={TensorFlow: A System for Large-Scale Machine Learning.},
+ author={Abadi, Mart{\'\i}n and Barham, Paul and Chen, Jianmin and Chen, Zhifeng and Davis, Andy and Dean, Jeffrey and Devin, Matthieu and Ghemawat, Sanjay and Irving, Geoffrey and Isard, Michael and others},
+ booktitle={OSDI},
+ volume={16},
+ pages={265--283},
+ year={2016}
+}
+
+@article{tensor2tensor,
+ author = {Ashish Vaswani and Samy Bengio and Eugene Brevdo and Francois Chollet and Aidan N. Gomez and Stephan Gouws and Llion Jones and \L{}ukasz Kaiser and Nal Kalchbrenner and Niki Parmar and Ryan Sepassi and
+ Noam Shazeer and Jakob Uszkoreit},
+ title = {Tensor2Tensor for Neural Machine Translation},
+ journal = {CoRR},
+ volume = {abs/1803.07416},
+ year = {2018},
+ url = {http://arxiv.org/abs/1803.07416},
+}
+
+@article{gehring2017convs2s,
+ author = {Gehring, Jonas, and Auli, Michael and Grangier, David and Yarats, Denis and Dauphin, Yann N},
+ title = "{Convolutional Sequence to Sequence Learning}",
+ journal = {ArXiv e-prints arXiv:1705.03122},
+ archivePrefix = "arXiv",
+ eprinttype = {arxiv},
+ eprint = {1705.03122},
+ primaryClass = "cs.CL",
+ keywords = {Computer Science - Computation and Language},
+ year = 2017,
+ month = May,
+}
+
+@inproceedings{chan2015,
+ title={Listen, attend and spell},
+ author={Chan, William and Jaitly, Navdeep and Le, Quoc V and Vinyals, Oriol},
+ booktitle={Acoustics, Speech and Signal Processing (ICASSP), 2016 IEEE International Conference on},
+ pages={5206--5210},
+ year={2016},
+ organization={IEEE}
+}
+
+@inproceedings{xu2015show,
+ title={Show, attend and tell: Neural image caption generation with visual attention},
+ author={Xu, Kelvin and Ba, Jimmy and Kiros, Ryan and Cho, Kyunghyun and Courville, Aaron and Salakhudinov, Ruslan and Zemel, Rich and Bengio, Yoshua},
+ booktitle={International Conference on Machine Learning},
+ pages={2048--2057},
+ year={2015}
+}
+
+@incollection{Sutskever2014,
+ title = {Sequence to Sequence Learning with Neural Networks},
+ author = {Sutskever, Ilya and Vinyals, Oriol and Le, Quoc V},
+ booktitle = {Advances in Neural Information Processing Systems 27},
+ editor = {Z. Ghahramani and M. Welling and C. Cortes and N. D. Lawrence and K. Q. Weinberger},
+ pages = {3104--3112},
+ year = {2014},
+ publisher = {Curran Associates, Inc.},
+ url = {http://papers.nips.cc/paper/5346-sequence-to-sequence-learning-with-neural-networks.pdf}
+}
+
+@article{DeepSpeech2014,
+ title = {Deep Speech: Scaling up end-to-end speech recognition},
+ author = {Awni Y. Hannun and Carl Case and Jared Casper and Bryan Catanzaro and Greg Diamos and Erich Elsen and Ryan Prenger and Sanjeev Satheesh and Shubho Sengupta and Adam Coates and Andrew Y. Ng},
+ journal = {CoRR},
+ volume = {abs/1412.5567},
+ year = {2014},
+ url = {http://arxiv.org/abs/1412.5567},
+ archivePrefix = {arXiv},
+ eprint = {1412.5567},
+ timestamp = {Mon, 13 Aug 2018 16:48:07 +0200},
+ biburl = {https://dblp.org/rec/bib/journals/corr/HannunCCCDEPSSCN14},
+ bibsource = {dblp computer science bibliography, https://dblp.org}
+}
+
+@inproceedings{DeepSpeech2,
+ author = {Amodei, Dario and Ananthanarayanan, Sundaram and Anubhai, Rishita and Bai, Jingliang and Battenberg, Eric and Case, Carl and Casper, Jared and Catanzaro, Bryan and Cheng, Qiang and Chen, Guoliang and Chen, Jie and Chen, Jingdong and Chen, Zhijie and Chrzanowski, Mike and Coates, Adam and Diamos, Greg and Ding, Ke and Du, Niandong and Elsen, Erich and Engel, Jesse and Fang, Weiwei and Fan, Linxi and Fougner, Christopher and Gao, Liang and Gong, Caixia and Hannun, Awni and Han, Tony and Johannes, Lappi Vaino and Jiang, Bing and Ju, Cai and Jun, Billy and LeGresley, Patrick and Lin, Libby and Liu, Junjie and Liu, Yang and Li, Weigao and Li, Xiangang and Ma, Dongpeng and Narang, Sharan and Ng, Andrew and Ozair, Sherjil and Peng, Yiping and Prenger, Ryan and Qian, Sheng and Quan, Zongfeng and Raiman, Jonathan and Rao, Vinay and Satheesh, Sanjeev and Seetapun, David and Sengupta, Shubho and Srinet, Kavya and Sriram, Anuroop and Tang, Haiyuan and Tang, Liliang and Wang, Chong and Wang, Jidong and Wang, Kaifu and Wang, Yi and Wang, Zhijian and Wang, Zhiqian and Wu, Shuang and Wei, Likai and Xiao, Bo and Xie, Wen and Xie, Yan and Yogatama, Dani and Yuan, Bin and Zhan, Jun and Zhu, Zhenyao},
+ title = {Deep Speech 2: End-to-end Speech Recognition in English and Mandarin},
+ booktitle = {Proceedings of the 33rd International Conference on International Conference on Machine Learning - Volume 48},
+ series = {ICML'16},
+ year = {2016},
+ location = {New York, NY, USA},
+ pages = {173--182},
+ numpages = {10},
+ url = {http://dl.acm.org/citation.cfm?id=3045390.3045410},
+ acmid = {3045410},
+ publisher = {JMLR.org},
+}
+
+@inproceedings{prabhavalkar2017comparison,
+ title={A comparison of sequence-to-sequence models for speech recognition},
+ author={Prabhavalkar, Rohit and Rao, Kanishka and Sainath, Tara N and Li, Bo and Johnson, Leif and Jaitly, Navdeep},
+ booktitle={Proc. Interspeech},
+ pages={939--943},
+ year={2017}
+}
+
+@article{chiu2017state,
+ title={State-of-the-art speech recognition with sequence-to-sequence models},
+ author={Chiu, Chung-Cheng and Sainath, Tara N and Wu, Yonghui and Prabhavalkar, Rohit and Nguyen, Patrick and Chen, Zhifeng and Kannan, Anjuli and Weiss, Ron J and Rao, Kanishka and Gonina, Katya and others},
+ journal={arXiv preprint arXiv:1712.01769},
+ year={2017}
+}
+
+@misc{NVMixed,
+ title = {{NVIDA's Mixed-Precision Training - TensorFlow example}},
+ howpublished = {\url{https://docs.nvidia.com/deeplearning/sdk/mixed-precision-training/#example_tensorflow}},
+ author={NVIDIA},
+ note = {Accessed: 2018-10-09},
+ year={2018}
+}
+
+@article{gehring2017,
+ title={Convolutional sequence to sequence learning},
+ author={Gehring, Jonas and Auli, Michael and Grangier, David and Yarats, Denis and Dauphin, Yann N},
+ journal={arXiv preprint arXiv:1705.03122},
+ year={2017}
+}
+
+@article{collobert2016,
+ title={Wav2letter: an end-to-end convnet-based speech recognition system},
+ author={Collobert, Ronan and Puhrsch, Christian and Synnaeve, Gabriel},
+ journal={arXiv preprint arXiv:1609.03193},
+ year={2016}
+}
+
+@inproceedings{Zhang2016,
+author={Ying Zhang and Mohammad Pezeshki and Philémon Brakel and Saizheng Zhang and César Laurent and Yoshua Bengio and Aaron Courville},
+title={Towards End-to-End Speech Recognition with Deep Convolutional Neural Networks},
+year=2016,
+booktitle={Interspeech 2016},
+doi={10.21437/Interspeech.2016-1446},
+url={http://dx.doi.org/10.21437/Interspeech.2016-1446},
+pages={410--414}
+}
+
+@inproceedings{Zhang2017,
+ title={Very deep convolutional networks for end-to-end speech recognition},
+ author={Zhang, Yu, and Chan, William, and Jaitly, Navdeep},
+ booktitle={Acoustics, Speech and Signal Processing (ICASSP), 2017 IEEE International Conference on},
+ year={2017},
+ organization={IEEE}
+}
+
+
+@article{Wang2017,
+ title={Tacotron: Towards End-to-End Speech Synthesis},
+ author={ Wang, Yuxuan, and Skerry-Ryan, RJ, and Stanton, Daisy and Wu, Yonghui and Weiss, Ron, and Jaitly, Navdeep and Yang, Zongheng and Xiao, Ying and Chen,Zhifeng and Bengio, Samy and Le, Quoc and Agiomyrgiannakis, Yannis and Clark,Rob and Saurous, Rif A.},
+ journal={arXiv preprint arXiv:1703.10135},
+ year={2017}
+}
+
+@article{griffin1984signal,
+ title={Signal estimation from modified short-time Fourier transform},
+ author={Griffin, Daniel and Lim, Jae},
+ journal={IEEE Transactions on Acoustics, Speech, and Signal Processing},
+ volume={32},
+ number={2},
+ pages={236--243},
+ year={1984},
+ publisher={IEEE}
+}
+
+@misc{ito2017lj,
+ title={The LJ speech dataset},
+ author={Ito, Keith and others},
+ year={2017}
+}
+
+@misc{mailabs,
+ title = {{The M-AILABS Speech Dataset}},
+ howpublished = {\url{http://www.m-ailabs.bayern/en/the-mailabs-speech-dataset/}},
+ author={M-AILABS},
+ note = {Accessed: 2018-10-09},
+ year={2018}
+}
+
+@article{merity2016pointer,
+ title={Pointer sentinel mixture models},
+ author={Merity, Stephen and Xiong, Caiming and Bradbury, James and Socher, Richard},
+ journal={arXiv preprint arXiv:1609.07843},
+ year={2016}
+}
+
+@inproceedings{socher2013recursive,
+ title={Recursive deep models for semantic compositionality over a sentiment treebank},
+ author={Socher, Richard and Perelygin, Alex and Wu, Jean and Chuang, Jason and Manning, Christopher D and Ng, Andrew and Potts, Christopher},
+ booktitle={Proceedings of the 2013 conference on empirical methods in natural language processing},
+ pages={1631--1642},
+ year={2013}
+}
+
+@InProceedings{maas-EtAl:2011:ACL-HLT2011,
+ author = {Maas, Andrew L. and Daly, Raymond E. and Pham, Peter T. and Huang, Dan and Ng, Andrew Y. and Potts, Christopher},
+ title = {Learning Word Vectors for Sentiment Analysis},
+ booktitle = {Proceedings of the 49th Annual Meeting of the Association for Computational Linguistics: Human Language Technologies},
+ month = {June},
+ year = {2011},
+ address = {Portland, Oregon, USA},
+ publisher = {Association for Computational Linguistics},
+ pages = {142--150},
+ url = {http://www.aclweb.org/anthology/P11-1015}
+}
+
+@inproceedings{Povey2018SemiOrthogonalLM,
+ title={Semi-Orthogonal Low-Rank Matrix Factorization for Deep Neural Networks},
+ author={Daniel Povey and Gaofeng Cheng and Yiming Wang and Ke Li and Hainan Xu and Mahsa Yarmohammadi and Sanjeev Khudanpur},
+ booktitle={Interspeech},
+ year={2018}
+}
+
+@article{CAPIO2017,
+ author = {Kyu J. Han and Akshay Chandrashekaran and Jungsuk Kim and Ian R. Lane},
+ title = {The {CAPIO} 2017 Conversational Speech Recognition System},
+ journal = {CoRR},
+ volume = {abs/1801.00059},
+ year = {2018},
+ url = {http://arxiv.org/abs/1801.00059},
+ archivePrefix = {arXiv},
+ eprint = {1801.00059},
+ timestamp = {Mon, 13 Aug 2018 16:49:10 +0200},
+ biburl = {https://dblp.org/rec/bib/journals/corr/abs-1801-00059},
+ bibsource = {dblp computer science bibliography, https://dblp.org}
+}
+
+@article{WaveNet,
+ author = {A{\"{a}}ron van den Oord and Sander Dieleman and Heiga Zen and Karen Simonyan and Oriol Vinyals and Alex Graves and Nal Kalchbrenner and Andrew W. Senior and Koray Kavukcuoglu},
+ title = {WaveNet: {A} Generative Model for Raw Audio},
+ journal = {CoRR},
+ volume = {abs/1609.03499},
+ year = {2016},
+ url = {http://arxiv.org/abs/1609.03499},
+ archivePrefix = {arXiv},
+ eprint = {1609.03499},
+ timestamp = {Mon, 13 Aug 2018 16:49:15 +0200},
+ biburl = {https://dblp.org/rec/bib/journals/corr/OordDZSVGKSK16},
+ bibsource = {dblp computer science bibliography, https://dblp.org}
+}
+
+@article{FacebookGERENGBackTranslation,
+ author = {Rico Sennrich and Barry Haddow and Alexandra Birch},
+ title = {Improving Neural Machine Translation Models with Monolingual Data},
+ journal = {CoRR},
+ volume = {abs/1511.06709},
+ year = {2015},
+ url = {http://arxiv.org/abs/1511.06709},
+ archivePrefix = {arXiv},
+ eprint = {1511.06709},
+ timestamp = {Mon, 13 Aug 2018 16:47:05 +0200},
+ biburl = {https://dblp.org/rec/bib/journals/corr/SennrichHB15a},
+ bibsource = {dblp computer science bibliography, https://dblp.org}
+}
+
+@article{GlobalStyleTokens,
+ author = {Yuxuan Wang and Daisy Stanton and Yu Zhang and R. J. Skerry{-}Ryan and Eric Battenberg and Joel Shor and Ying Xiao and Fei Ren and Ye Jia and Rif A. Saurous},
+ title = {Style Tokens: Unsupervised Style Modeling, Control and Transfer in End-to-End Speech Synthesis},
+ journal = {CoRR},
+ volume = {abs/1803.09017},
+ year = {2018},
+ url = {http://arxiv.org/abs/1803.09017},
+ archivePrefix = {arXiv},
+ eprint = {1803.09017},
+ timestamp = {Mon, 13 Aug 2018 16:46:53 +0200},
+ biburl = {https://dblp.org/rec/bib/journals/corr/abs-1803-09017},
+ bibsource = {dblp computer science bibliography, https://dblp.org}
+}
+
+@article{IoffeS15BatchNorm,
+ author = {Sergey Ioffe and Christian Szegedy},
+ title = {Batch Normalization: Accelerating Deep Network Training by Reducing Internal Covariate Shift},
+ journal = {CoRR},
+ volume = {abs/1502.03167},
+ year = {2015},
+ url = {http://arxiv.org/abs/1502.03167},
+ archivePrefix = {arXiv},
+ eprint = {1502.03167},
+ timestamp = {Mon, 13 Aug 2018 16:47:06 +0200},
+ biburl = {https://dblp.org/rec/bib/journals/corr/IoffeS15},
+ bibsource = {dblp computer science bibliography, https://dblp.org}
+}
+
+@article{kingma,
+ author = {Diederik P. Kingma and
+ Jimmy Ba},
+ title = {Adam: {A} Method for Stochastic Optimization},
+ journal = {CoRR},
+ volume = {abs/1412.6980},
+ year = {2014},
+ url = {http://arxiv.org/abs/1412.6980},
+ archivePrefix = {arXiv},
+ eprint = {1412.6980},
+ timestamp = {Mon, 13 Aug 2018 01:00:00 +0200},
+ biburl = {https://dblp.org/rec/bib/journals/corr/KingmaB14},
+ bibsource = {dblp computer science bibliography, https://dblp.org}
+}
+
+@incollection{Salimans2016WeightNorm,
+ title = {Weight Normalization: A Simple Reparameterization to Accelerate Training of Deep Neural Networks},
+ author = {Salimans, Tim and Kingma, Durk P},
+ booktitle = {Advances in Neural Information Processing Systems 29},
+ editor = {D. D. Lee and M. Sugiyama and U. V. Luxburg and I. Guyon and R. Garnett},
+ pages = {901--909},
+ year = {2016},
+ publisher = {Curran Associates, Inc.},
+ url = {http://papers.nips.cc/paper/6114-weight-normalization-a-simple-reparameterization-to-accelerate-training-of-deep-neural-networks.pdf}
+}
+
+@article{wu2016google,
+ title={Google's neural machine translation system: Bridging the gap between human and machine translation},
+ author={Wu, Yonghui and Schuster, Mike and Chen, Zhifeng and Le, Quoc V and Norouzi, Mohammad and Macherey, Zolfgang and Krikun, Maxim and Cao, Yuan and Gao, Qin and Macherey, Klaus and others},
+ journal={arXiv preprint arXiv:1609.08144},
+ year={2016}
+}
+
+@inproceedings{opennmt,
+ author = {Guillaume Klein and Yoon Kim and Yuntian Deng and Jean Senellart and Alexander M. Rush},
+ title = {OpenNMT: Open-Source Toolkit for Neural Machine Translation},
+ booktitle = {Proc. ACL},
+ year = {2017},
+ url = {https://doi.org/10.18653/v1/P17-4012},
+ doi = {10.18653/v1/P17-4012}
+}
+
+@article{paszke2017automatic,
+ title={Automatic differentiation in PyTorch},
+ author={Paszke, Adam and Gross, Sam and Chintala, Soumith and Chanan, Gregory and Yang, Edward and DeVito, Zachary and Lin, Zeming and Desmaison, Alban and Antiga, Luca and Lerer, Adam},
+ year={2017}
+}
+
+@article{yu2014introduction,
+ title={An introduction to computational networks and the computational network toolkit},
+ author={Yu, Dong and Eversole, Adam and Seltzer, Mike and Yao, Kaisheng and Huang, Zhiheng and Guenter, Brian and Kuchaiev, Oleksii and Zhang, Yu and Seide, Frank and Wang, Huaming and others},
+ journal={Microsoft Technical Report MSR-TR-2014--112},
+ year={2014}
+}
+
+@article{nvidia2017v100,
+ title={V100 GPU architecture. The world’s most advanced data center GPU. Version WP-08608-001\_v1. 1},
+ author={NVIDIA, Tesla},
+ journal={NVIDIA. Aug},
+ pages={108},
+ year={2017}
+}
+
+@article{Ba2016LayerNorm,
+ author = {Jimmy Lei Ba and Jamie Ryan Kiros and Geoffrey E Hinton},
+ title = {Layer normalization},
+ journal = {CoRR},
+ volume = {abs/1607.06450},
+ year = {2016},
+ url = {http://arxiv.org/abs/1607.06450},
+ archivePrefix = {arXiv},
+}
+
+@inproceedings{Dauphin2017GLU,
+ author = {Dauphin, Yann N. and Fan, Angela and Auli, Michael and Grangier, David},
+ title = {Language Modeling with Gated Convolutional Networks},
+ booktitle = {Proceedings of the 34th International Conference on Machine Learning - Volume 70},
+ series = {ICML'17},
+ year = {2017},
+ location = {Sydney, NSW, Australia},
+ pages = {933--941},
+ numpages = {9},
+ url = {http://dl.acm.org/citation.cfm?id=3305381.3305478},
+ acmid = {3305478},
+ publisher = {JMLR.org},
+}
+
+@incollection{Oord2016PixelCNN,
+title = {Conditional Image Generation with PixelCNN Decoders},
+author = {van den Oord, Aaron and Kalchbrenner, Nal and Espeholt, Lasse and kavukcuoglu, koray and Vinyals, Oriol and Graves, Alex},
+booktitle = {Advances in Neural Information Processing Systems 29},
+editor = {D. D. Lee and M. Sugiyama and U. V. Luxburg and I. Guyon and R. Garnett},
+pages = {4790--4798},
+year = {2016},
+publisher = {Curran Associates, Inc.},
+url = {http://papers.nips.cc/paper/6527-conditional-image-generation-with-pixelcnn-decoders.pdf}
+}
+
+@article{he2015,
+ title={Deep residual learning for image recognition},
+ author={K. He, and X. Zhang, and S. Ren, and J. Sun},
+ journal={arXiv preprint arXiv:1512.03385},
+ year={2015}
+}
+
+@article{huang2016,
+ title={Densely Connected Convolutional Networks},
+ author={Gao Huang, and Zhuang Liu, and Laurens van der Maaten, and Kilian Q. Weinberger},
+ journal={arXiv preprint arXiv:1608.06993},
+ year={2016}
+}
+
+@inproceedings{heafield2011kenlm,
+ title={KenLM: Faster and smaller language model queries},
+ author={Heafield, Kenneth},
+ booktitle={Proceedings of the sixth workshop on statistical machine translation},
+ pages={187--197},
+ year={2011},
+ organization={Association for Computational Linguistics}
+}
+
+@article{dai2018transformer,
+ title={Transformer-XL: Language Modeling with Longer-Term Dependency},
+ author={Dai, Zihang and Yang, Zhilin and Yang, Yiming and Cohen, William W and Carbonell, Jaime and Le, Quoc V and Salakhutdinov, Ruslan},
+ year={2018},
+ journal = {CoRR},
+ volume = {abs/1901.02860},
+ url = {http://arxiv.org/abs/1901.02860},
+ archivePrefix = {arXiv},
+ eprint = {1901.02860},
+ timestamp = {Fri, 01 Feb 2019 13:39:59 +0100},
+ biburl = {https://dblp.org/rec/bib/journals/corr/abs-1901-02860},
+ bibsource = {dblp computer science bibliography, https://dblp.org}
+}
+
+@inproceedings{Saon+2016,
+author={George Saon and Tom Sercu and Steven Rennie and Hong-Kwang J. Kuo},
+title={The IBM 2016 English Conversational Telephone Speech Recognition System},
+year=2016,
+booktitle={Interspeech 2016},
+doi={10.21437/Interspeech.2016-1460},
+url={http://dx.doi.org/10.21437/Interspeech.2016-1460},
+pages={7--11}
+}
+
+@INPROCEEDINGS{Sercu-2016,
+author={T. {Sercu} and C. {Puhrsch} and B. {Kingsbury} and Y. {LeCun}},
+booktitle={2016 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP)},
+title={Very deep multilingual convolutional neural networks for LVCSR},
+year={2016},
+volume={},
+number={},
+pages={4955-4959},
+keywords={natural language processing;neural nets;speech recognition;very deep multilingual convolutional neural networks;LVCSR;CNN;large vocabulary continuous speech recognition systems;word error rate;Training;Context;Hidden Markov models;Neural networks;Computer architecture;Kernel;Training data;Convolutional Networks;Multilingual;Acoustic Modeling;Speech Recognition;Neural Networks},
+doi={10.1109/ICASSP.2016.7472620},
+ISSN={2379-190X},
+month={March},}
+
+
+@inproceedings{Sercu+2016,
+author={Tom Sercu and Vaibhava Goel},
+title={Advances in Very Deep Convolutional Neural Networks for LVCSR},
+year=2016,
+booktitle={Interspeech 2016},
+doi={10.21437/Interspeech.2016-1033},
+url={http://dx.doi.org/10.21437/Interspeech.2016-1033},
+pages={3429--3433}
+}
+
+@INPROCEEDINGS{Xiong-2018,
+author={W. {Xiong} and L. {Wu} and F. {Alleva} and J. {Droppo} and X. {Huang} and A. {Stolcke}},
+booktitle={2018 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP)},
+title={The Microsoft 2017 Conversational Speech Recognition System},
+year={2018},
+volume={},
+number={},
+pages={5934-5938},
+keywords={convolution;feedforward neural nets;natural language processing;speaker recognition;speech processing;language model rescoring step;senone level;switchboard domains;character-based LSTM language models;NIST 2000 switchboard test set;frame level;word-level voting;acoustic model posteriors;dialog session aware LSTM language models;CNN-BLSTM acoustic model;Microsoft 2017 conversational speech recognition system;Acoustics;Error analysis;Training;Speech recognition;Switches;Computational modeling;Context modeling;Conversational speech recognition;CNN;LACE;BLSTM;LSTM-LM;system combination;human parity},
+doi={10.1109/ICASSP.2018.8461870},
+ISSN={2379-190X},
+month={April},}
+
+@inproceedings{zeyer2018improved,
+ author={Albert Zeyer and Kazuki Irie and Ralf Schlüter and Hermann Ney},
+ title={Improved Training of End-to-end Attention Models for Speech Recognition},
+ year=2018,
+ booktitle={Proc. Interspeech 2018},
+ pages={7--11},
+ doi={10.21437/Interspeech.2018-1616},
+ url={http://dx.doi.org/10.21437/Interspeech.2018-1616}
+}
+
+@article{Wav2LetterV2,
+ author = {Vitaliy Liptchinsky and
+ Gabriel Synnaeve and
+ Ronan Collobert},
+ title = {Letter-Based Speech Recognition with Gated ConvNets},
+ journal = {CoRR},
+ volume = {abs/1712.09444},
+ year = {2017},
+ url = {http://arxiv.org/abs/1712.09444},
+ archivePrefix = {arXiv},
+ eprint = {1712.09444},
+ timestamp = {Mon, 13 Aug 2018 16:46:33 +0200},
+ biburl = {https://dblp.org/rec/bib/journals/corr/abs-1712-09444},
+ bibsource = {dblp computer science bibliography, https://dblp.org}
+}
+
+@article{zeghidour2018,
+ author = {Neil Zeghidour and
+ Qiantong Xu and
+ Vitaliy Liptchinsky and
+ Nicolas Usunier and
+ Gabriel Synnaeve and
+ Ronan Collobert},
+ title = {Fully Convolutional Speech Recognition},
+ journal = {CoRR},
+ volume = {abs/1812.06864},
+ year = {2018},
+ url = {http://arxiv.org/abs/1812.06864},
+ archivePrefix = {arXiv},
+ eprint = {1812.06864},
+ timestamp = {Tue, 01 Jan 2019 15:01:25 +0100},
+ biburl = {https://dblp.org/rec/bib/journals/corr/abs-1812-06864},
+ bibsource = {dblp computer science bibliography, https://dblp.org}
+}
+
+@inproceedings{Hadian2018,
+ author={Hossein Hadian and Hossein Sameti and Daniel Povey and Sanjeev Khudanpur},
+ title={End-to-end Speech Recognition Using Lattice-free MMI},
+ year=2018,
+ booktitle={Proc. Interspeech 2018},
+ pages={12--16},
+ doi={10.21437/Interspeech.2018-1423},
+ url={http://dx.doi.org/10.21437/Interspeech.2018-1423}
+}
+
+@inproceedings{Tang2018,
+ author={Jian Tang and Yan Song and Lirong Dai and Ian McLoughlin},
+ title={Acoustic Modeling with Densely Connected Residual Network for Multichannel Speech Recognition},
+ year=2018,
+ booktitle={Proc. Interspeech 2018},
+ pages={1783--1787},
+ doi={10.21437/Interspeech.2018-1089},
+ url={http://dx.doi.org/10.21437/Interspeech.2018-1089}
+}
+
+@article{Kurata2017LanguageMW,
+ title={Language modeling with highway LSTM},
+ author={Gakuto Kurata and Bhuvana Ramabhadran and George Saon and Abhinav Sethy},
+ journal={2017 IEEE Automatic Speech Recognition and Understanding Workshop (ASRU)},
+ year={2017},
+ pages={244-251}
+}
+
+@inproceedings{Saon2017,
+ author={George Saon and Gakuto Kurata and Tom Sercu and Kartik Audhkhasi and Samuel Thomas and Dimitrios Dimitriadis and Xiaodong Cui and Bhuvana Ramabhadran and Michael Picheny and Lynn-Li Lim and Bergul Roomi and Phil Hall},
+ title={English Conversational Telephone Speech Recognition by Humans and Machines},
+ year=2017,
+ booktitle={Proc. Interspeech 2017},
+ pages={132--136},
+ doi={10.21437/Interspeech.2017-405},
+ url={http://dx.doi.org/10.21437/Interspeech.2017-405}
+}
+
+@inproceedings{Povey+2016,
+author={Daniel Povey and Vijayaditya Peddinti and Daniel Galvez and Pegah Ghahremani and Vimal Manohar and Xingyu Na and Yiming Wang and Sanjeev Khudanpur},
+title={Purely Sequence-Trained Neural Networks for ASR Based on Lattice-Free MMI},
+year=2016,
+booktitle={Interspeech 2016},
+doi={10.21437/Interspeech.2016-595},
+url={http://dx.doi.org/10.21437/Interspeech.2016-595},
+pages={2751--2755}
+}
+
+@article{Yang2018,
+ author = {Xuerui Yang and
+ Jiwei Li and
+ Xi Zhou},
+ title = {A novel pyramidal-FSMN architecture with lattice-free {MMI} for speech
+ recognition},
+ journal = {CoRR},
+ volume = {abs/1810.11352},
+ year = {2018},
+ url = {http://arxiv.org/abs/1810.11352},
+ archivePrefix = {arXiv},
+ eprint = {1810.11352},
+ timestamp = {Wed, 31 Oct 2018 14:24:29 +0100},
+ biburl = {https://dblp.org/rec/bib/journals/corr/abs-1810-11352},
+ bibsource = {dblp computer science bibliography, https://dblp.org}
+}
+
+@article{liptchinsky2017based,
+ title={Letter-Based Speech Recognition with Gated ConvNets},
+ author={Liptchinsky, Vitaliy and Synnaeve, Gabriel and Collobert, Ronan},
+ journal={arXiv preprint arXiv:1712.09444},
+ year={2017}
+}
+
+@inproceedings{Weng2018,
+ author={Chao Weng and Jia Cui and Guangsen Wang and Jun Wang and Chengzhu Yu and Dan Su and Dong Yu},
+ title={Improving Attention Based Sequence-to-Sequence Models for End-to-End English Conversational Speech Recognition},
+ year=2018,
+ booktitle={Proc. Interspeech 2018},
+ pages={761--765},
+ doi={10.21437/Interspeech.2018-1030},
+ url={http://dx.doi.org/10.21437/Interspeech.2018-1030}
+}
+
+@INPROCEEDINGS{Battenberg2017,
+author={E. {Battenberg} and J. {Chen} and R. {Child} and A. {Coates} and Y. G. Y. {Li} and H. {Liu} and S. {Satheesh} and A. {Sriram} and Z. {Zhu}},
+booktitle={2017 IEEE Automatic Speech Recognition and Understanding Workshop (ASRU)},
+title={Exploring neural transducers for end-to-end speech recognition},
+year={2017},
+volume={},
+number={},
+pages={206-213},
+keywords={recurrent neural nets;speech recognition;Hub500 benchmark;CTC models;speech recognition pipeline;RNN-Transducer models;language model;Seq2Seq models;end-to-end speech recognition;neural transducers;Decoding;Hidden Markov models;Transducers;Task analysis;Speech;Mathematical model;Neural networks},
+doi={10.1109/ASRU.2017.8268937},
+ISSN={},
+month={Dec},
+}
+
+@inproceedings{
+loshchilov2018,
+title={Decoupled Weight Decay Regularization},
+author={Ilya Loshchilov and Frank Hutter},
+booktitle={International Conference on Learning Representations},
+year={2019},
+url={https://openreview.net/forum?id=Bkg6RiCqY7},
+}
+
+@article{zhang2017ndadam,
+ author = {Zijun Zhang and Lin Ma and Zongpeng Li and Chuan Wu},
+ title = {Normalized Direction-preserving Adam},
+ journal = {arXiv e-prints arXiv:1709.04546},
+ year = {2017},
+}
+
+@article{park2019,
+ author = {{Park}, Daniel S. and {Chan}, William and {Zhang}, Yu and
+ {Chiu}, Chung-Cheng and {Zoph}, Barret and {Cubuk}, Ekin D. and
+ {Le}, Quoc V.},
+ title = "{SpecAugment: A Simple Data Augmentation Method for Automatic Speech Recognition}",
+ journal = {arXiv e-prints},
+ year = "2019",
+ eid = {arXiv:1904.08779},
+ eprint = {1904.08779},
+}
+
+@article{novograd2019,
+ author = {{Ginsburg}, Boris and {Castonguay}, Patrice and {Hrinchuk}, Oleksii and
+ {Kuchaiev}, Oleksii and {Lavrukhin}, Vitaly and {Leary}, Ryan and
+ {Li}, Jason and {Nguyen}, Huyen and {Cohen}, Jonathan M.},
+ title = "{Stochastic Gradient Methods with Layer-wise Adaptive Moments for Training of Deep Networks}",
+ journal = {arXiv e-prints},
+ year = "2019",
+ eid = {arXiv:1905.11286},
+ eprint = {1905.11286},
+}
+
+@article{kriman2019quartznet,
+ title={Quartznet: {Deep} automatic speech recognition with 1d time-channel separable convolutions},
+ author={Kriman, Samuel and Beliaev, Stanislav and Ginsburg, Boris and Huang, Jocelyn and Kuchaiev, Oleksii and Lavrukhin, Vitaly and Leary, Ryan and Li, Jason and Zhang, Yang},
+ journal={arXiv preprint arXiv:1910.10261},
+ year={2019}
+}
+
+@misc{itu1988g711,
+ title={{ITU-T} {G.711} - {Pulse} code modulation ({PCM}) of voice frequencies},
+ author={ITU-T Geneva Switzerland},
+ year={1988},
+}
+
+@article{han2020contextnet,
+ title={ContextNet: Improving convolutional neural networks for automatic speech recognition with global context},
+ author={Han, Wei and Zhang, Zhengdong and Zhang, Yu and Yu, Jiahui and Chiu, Chung-Cheng and Qin, James and Gulati, Anmol and Pang, Ruoming and Wu, Yonghui},
+ journal={arXiv:2005.03191},
+ year={2020}
+}
+
+@inproceedings{hu2018squeeze,
+ title={Squeeze-and-excitation networks},
+ author={Hu, Jie and Shen, Li and Sun, Gang},
+ booktitle={ICVPR},
+ year={2018}
+}
+
+@article{koluguri2020speakernet,
+ title={SpeakerNet: 1D Depth-wise Separable Convolutional Network for Text-Independent Speaker Recognition and Verification},
+ author={Koluguri, Nithin Rao and Li, Jason and Lavrukhin, Vitaly and Ginsburg, Boris},
+ journal={arXiv preprint arXiv:2010.12653},
+ year={2020}
+}
+
+@article{gulati2020conformer,
+ title={Conformer: Convolution-augmented transformer for speech recognition},
+ author={Gulati, Anmol and Qin, James and Chiu, Chung-Cheng and Parmar, Niki and Zhang, Yu and Yu, Jiahui and Han, Wei and Wang, Shibo and Zhang, Zhengdong and Wu, Yonghui and others},
+ journal={arXiv preprint arXiv:2005.08100},
+ year={2020}
+}
+
+@article{koluguri2021titanet,
+ title={TitaNet: Neural Model for speaker representation with 1D Depth-wise separable convolutions and global context},
+ author={Koluguri, Nithin Rao and Park, Taejin and Ginsburg, Boris},
+ journal={arXiv preprint arXiv:2110.04410},
+ year={2021}
+}
+
+@article{Dawalatabad_2021,
+ title={ECAPA-TDNN Embeddings for Speaker Diarization},
+ url={http://dx.doi.org/10.21437/Interspeech.2021-941},
+ DOI={10.21437/interspeech.2021-941},
+ journal={Interspeech 2021},
+ publisher={ISCA},
+ author={Dawalatabad, Nauman and Ravanelli, Mirco and Grondin, François and Thienpondt, Jenthe and Desplanques, Brecht and Na, Hwidong},
+ year={2021},
+ month={Aug}
+}
+
+@article{park2022multi,
+ title = {Multi-scale Speaker Diarization with Dynamic Scale Weighting},
+ author = {Park, Tae Jin and Koluguri, Nithin Rao and Balam, Jagadeesh and Ginsburg, Boris},
+ journal = {https://arxiv.org/abs/2203.15974},
+ year = {2022}
+}
+
+
+@inproceedings{he2019streaming,
+ title={Streaming end-to-end speech recognition for mobile devices},
+ author={He, Yanzhang and Sainath, Tara N and Prabhavalkar, Rohit and McGraw, Ian and Alvarez, Raziel and Zhao, Ding and Rybach, David and Kannan, Anjuli and Wu, Yonghui and Pang, Ruoming and others},
+ booktitle={ICASSP 2019-2019 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP)},
+ pages={6381--6385},
+ year={2019},
+ organization={IEEE}
+}
+
+@misc{wav2vec2,
+ doi = {10.48550/ARXIV.2006.11477},
+ url = {https://arxiv.org/abs/2006.11477},
+ author = {Baevski, Alexei and Zhou, Henry and Mohamed, Abdelrahman and Auli, Michael},
+ title = {wav2vec 2.0: A Framework for Self-Supervised Learning of Speech Representations},
+ publisher = {arXiv},
+ year = {2020},
+ copyright = {arXiv.org perpetual, non-exclusive license}
+}
+
+@misc{w2v_bert,
+ doi = {10.48550/ARXIV.2108.06209},
+ url = {https://arxiv.org/abs/2108.06209},
+ author = {Chung, Yu-An and Zhang, Yu and Han, Wei and Chiu, Chung-Cheng and Qin, James and Pang, Ruoming and Wu, Yonghui},
+ title = {W2v-BERT: Combining Contrastive Learning and Masked Language Modeling for Self-Supervised Speech Pre-Training},
+ publisher = {arXiv},
+ year = {2021},
+ copyright = {arXiv.org perpetual, non-exclusive license}
+}
+
+@misc{ssl_inter,
+ doi = {10.48550/ARXIV.2112.08778},
+ url = {https://arxiv.org/abs/2112.08778},
+ author = {Wang, Chengyi and Wu, Yu and Chen, Sanyuan and Liu, Shujie and Li, Jinyu and Qian, Yao and Yang, Zhenglu},
+ title = {Self-Supervised Learning for speech recognition with Intermediate layer supervision},
+ publisher = {arXiv},
+ year = {2021},
+ copyright = {arXiv.org perpetual, non-exclusive license}
+}
+
+@misc{kim2022squeezeformer,
+ doi = {10.48550/ARXIV.2206.00888},
+ url = {https://arxiv.org/abs/2206.00888},
+ author = {Kim, Sehoon and Gholami, Amir and Shaw, Albert and Lee, Nicholas and Mangalam, Karttikeya and Malik, Jitendra and Mahoney, Michael W. and Keutzer, Kurt},
+ keywords = {Audio and Speech Processing (eess.AS), Computation and Language (cs.CL), Sound (cs.SD), FOS: Electrical engineering, electronic engineering, information engineering, FOS: Electrical engineering, electronic engineering, information engineering, FOS: Computer and information sciences, FOS: Computer and information sciences},
+ title = {Squeezeformer: An Efficient Transformer for Automatic Speech Recognition},
+ publisher = {arXiv},
+ year = {2022},
+ copyright = {arXiv.org perpetual, non-exclusive license}
+}
+
+@misc{park2022multi,
+ doi = {10.48550/ARXIV.2203.15974},
+ url = {https://arxiv.org/abs/2203.15974},
+ author = {Park, Tae Jin and Koluguri, Nithin Rao and Balam, Jagadeesh and Ginsburg, Boris},
+ keywords = {Audio and Speech Processing (eess.AS), Computation and Language (cs.CL), FOS: Electrical engineering, electronic engineering, information engineering, FOS: Electrical engineering, electronic engineering, information engineering, FOS: Computer and information sciences, FOS: Computer and information sciences},
+ title = {Multi-scale Speaker Diarization with Dynamic Scale Weighting},
+ publisher = {arXiv},
+ year = {2022},
+ copyright = {Creative Commons Attribution 4.0 International}
+}
diff --git a/docs/source/asr/asr_language_modeling.rst b/docs/source/asr/asr_language_modeling.rst
new file mode 100644
index 0000000000000000000000000000000000000000..5692e25e0ace7186293bef13b736820f27405e9a
--- /dev/null
+++ b/docs/source/asr/asr_language_modeling.rst
@@ -0,0 +1,395 @@
+#####################
+ASR Language Modeling
+#####################
+
+Language models have shown to help the accuracy of ASR models. NeMo supports the following two approaches to incorporate language models into the ASR models:
+
+* :ref:`ngram_modeling`
+* :ref:`neural_rescoring`
+
+It is possible to use both approaches on the same ASR model.
+
+
+.. _ngram_modeling:
+
+************************
+N-gram Language Modeling
+************************
+
+In this approach, an N-gram LM is trained on text data, then it is used in fusion with beam search decoding to find the
+best candidates. The beam search decoders in NeMo support language models trained with KenLM library (
+`https://github.com/kpu/kenlm `__).
+The beam search decoders and KenLM library are not installed by default in NeMo, and you need to install them to be
+able to use beam search decoding and N-gram LM.
+Please refer to `scripts/asr_language_modeling/ngram_lm/install_beamsearch_decoders.sh` on how to install them.
+
+NeMo supports both character-based and BPE-based models for N-gram LMs. An N-gram LM can be used with beam search
+decoders on top of the ASR models to produce more accurate candidates. The beam search decoder would incorporate
+the scores produced by the N-gram LM into its score calculations as the following:
+
+.. code-block::
+
+ final_score = acoustic_score + beam_alpha*lm_score + beam_beta*seq_length
+
+where acoustic_score is the score predicted by the acoustic encoder and lm_score is the one estimated by the LM.
+Parameter 'beam_alpha' specifies amount of importance to place on the N-gram language model, and 'beam_beta' is a
+penalty term to consider the sequence length in the scores. Larger alpha means more importance on the LM and less
+importance on the acoustic model. Negative values for beta will give penalty to longer sequences and make the decoder
+to prefer shorter predictions, while positive values would result in longer candidates.
+
+
+Train N-gram LM
+===============
+
+The script to train an N-gram language model with KenLM can be found at
+`scripts/asr_language_modeling/ngram_lm/train_kenlm.py `__.
+
+This script would train an N-gram language model with KenLM library which can be used with the beam search decoders
+on top of the ASR models. This script supports both character level and BPE level encodings and models which is
+detected automatically from the type of the model.
+
+
+You may train the N-gram model as the following:
+
+.. code-block::
+
+ python train_kenlm.py --nemo_model_file \
+ --train_file \
+ --kenlm_model_file \
+ --ngram_length \
+ --preserve_arpa
+
+The train file specified by `--train_file` can be a text file or JSON manifest. If the file's extension is anything
+other than `.json`, it assumes that data format is plain text. For plain text format, each line should contain one
+sample. For JSON manifest file, the file need to contain json formatted samples per each line like this:
+
+.. code-block::
+
+ {"audio_filepath": "/data_path/file1.wav", "text": "The transcript of the audio file."}
+
+It just extracts the `text` field from each line to create the training text file. After the N-gram model is trained,
+it is stored at the path specified by `--kenlm_model_file`.
+
+The following is the list of the arguments for the training script:
+
++------------------+----------+-------------+-------------------------------------------------------------------------------------------------+
+| **Argument** | **Type** | **Default** | **Description** |
++------------------+----------+-------------+-------------------------------------------------------------------------------------------------+
+| nemo_model_file | str | Required | The path of the `.nemo` file of the ASR model. It is needed to extract the tokenizer. |
++------------------+----------+-------------+-------------------------------------------------------------------------------------------------+
+| train_file | str | Required | Path to the training file, it can be a text file or JSON manifest. |
++------------------+----------+-------------+-------------------------------------------------------------------------------------------------+
+| kenlm_model_file | str | Required | The path to store the KenLM binary model file. |
++------------------+----------+-------------+-------------------------------------------------------------------------------------------------+
+| kenlm_bin_path | str | Required | The path to the bin folder of KenLM. It is a folder named `bin` under where KenLM is installed. |
++------------------+----------+-------------+-------------------------------------------------------------------------------------------------+
+| ngram_length** | int | Required | Specifies order of N-gram LM. |
++------------------+----------+-------------+-------------------------------------------------------------------------------------------------+
+| do_lower_case | bool | ``False`` | Whether to make the training text all lower case. |
++------------------+----------+-------------+-------------------------------------------------------------------------------------------------+
+| preserve_arpa | bool | ``False`` | Whether to preserve the intermediate ARPA file after construction of the BIN file. |
++------------------+----------+-------------+-------------------------------------------------------------------------------------------------+
+
+** Note: Recommend to use 6 as the order of the N-gram model for BPE-based models. Higher orders may need the re-compilation of KenLM to support it.
+
+Evaluate by Beam Search Decoding and N-gram LM
+==============================================
+
+NeMo's beam search decoders are capable of using the KenLM's N-gram models to find the best candidates.
+The script to evaluate an ASR model with beam search decoding and N-gram models can be found at
+`scripts/asr_language_modeling/ngram_lm/eval_beamsearch_ngram.py `__.
+
+This script has a large number of possible argument overrides, therefore it is advised to use ``python eval_beamsearch_ngram.py --help`` to see the full list of arguments.
+
+You may evaluate an ASR model as the following:
+
+.. code-block::
+
+ python eval_beamsearch_ngram.py nemo_model_file= \
+ input_manifest= \
+ beam_width=[] \
+ beam_alpha=[] \
+ beam_beta=[] \
+ preds_output_folder= \
+ probs_cache_file=null \
+ decoding_mode=beamsearch_ngram \
+ decoding_strategy=""
+
+It can evaluate a model in the three following modes by setting the argument `--decoding_mode`:
+
+* greedy: Just greedy decoding is done, and no beam search decoding is performed.
+* beamsearch: The beam search decoding is done but without using the N-gram language model, final results would be equivalent to setting the weight of LM (beam_beta) to zero.
+* beamsearch_ngram: The beam search decoding is done with N-gram LM.
+
+The `beamsearch` mode would evaluate by beam search decoding without any language model.
+It would report the performances in terms of Word Error Rate (WER) and Character Error Rate (CER). Moreover,
+the WER/CER of the model when the best candidate is selected among the candidates is also reported as the best WER/CER.
+It can be an indicator of how good the predicted candidates are.
+
+The script would initially load the ASR model and predict the outputs of the model's encoder as log probabilities.
+This part would be computed in batches on a device selected by `--device`, which can be CPU (`--device=cpu`) or a
+single GPU (`--device=cuda:0`). The batch size of this part can get specified by `--acoustic_batch_size`. You may use
+the largest batch size feasible to speed up the step of calculating the log probabilities. You may also use `--use_amp`
+to speed up the calculation of log probabilities and make it possible to use larger sizes for `--acoustic_batch_size`.
+Currently multi-GPU is not supported for calculating the log probabilities, but using `--probs_cache_file` can help.
+It stores the log probabilities produced from the model's encoder into a pickle file so that next time the first step
+can get skipped.
+
+The following is the list of the important arguments for the evaluation script:
+
++---------------------+----------+------------------+-------------------------------------------------------------------------+
+| **Argument** | **Type** | **Default** | **Description** |
++---------------------+----------+------------------+-------------------------------------------------------------------------+
+| nemo_model_file | str | Required | The path of the `.nemo` file of the ASR model to extract the tokenizer. |
++---------------------+----------+------------------+-------------------------------------------------------------------------+
+| input_manifest | str | Required | Path to the training file, it can be a text file or JSON manifest. |
++---------------------+----------+------------------+-------------------------------------------------------------------------+
+| kenlm_model_file | str | Required | The path to store the KenLM binary model file. |
++---------------------+----------+------------------+-------------------------------------------------------------------------+
+| preds_output_folder | str | None | The path to an optional folder to store the predictions. |
++---------------------+----------+------------------+-------------------------------------------------------------------------+
+| probs_cache_file | str | None | The cache file for storing the outputs of the model. |
++---------------------+----------+------------------+-------------------------------------------------------------------------+
+| acoustic_batch_size | int | 16 | The batch size to calculate log probabilities. |
++---------------------+----------+------------------+-------------------------------------------------------------------------+
+| use_amp | bool | False | Whether to use AMP if available to calculate log probabilities. |
++---------------------+----------+------------------+-------------------------------------------------------------------------+
+| device | str | cuda | The device to load the model onto to calculate log probabilities. |
+| | | | It can `cpu`, `cuda`, `cuda:0`, `cuda:1`, ... |
++---------------------+----------+------------------+-------------------------------------------------------------------------+
+| decoding_mode | str | beamsearch_ngram | The decoding scheme to be used for evaluation. |
++---------------------+----------+------------------+-------------------------------------------------------------------------+
+| beam_width | float | Required | List of the width or list of the widths of the beam search decoding. |
++---------------------+----------+------------------+-------------------------------------------------------------------------+
+| beam_alpha | float | Required | List of the alpha parameter for the beam search decoding. |
++---------------------+----------+------------------+-------------------------------------------------------------------------+
+| beam_beta | float | Required | List of the beta parameter for the beam search decoding. |
++---------------------+----------+------------------+-------------------------------------------------------------------------+
+| beam_batch_size | int | 128 | The batch size to be used for beam search decoding. |
+| | | | Larger batch size can be a little faster, but uses larger memory. |
++---------------------+----------+------------------+-------------------------------------------------------------------------+
+| decoding_strategy | str | beam | String argument for type of decoding strategy for the model. |
++---------------------+----------+------------------+-------------------------------------------------------------------------+
+| decoding | Dict | BeamCTC | Subdict of beam search configs. Values found via |
+| | Config | InferConfig | python eval_beamsearch_ngram.py --help |
++---------------------+----------+------------------+-------------------------------------------------------------------------+
+
+Width of the beam search (`--beam_width`) specifies the number of top candidates/predictions the beam search decoder
+would search for. Larger beams result in more accurate but slower predictions.
+
+.. note::
+
+ The ``eval_beamsearch_ngram.py`` script contains the entire subconfig used for CTC Beam Decoding.
+ Therefore it is possible to forward arguments for various beam search libraries such as ``flashlight``
+ and ``pyctcdecode`` via the ``decoding`` subconfig.
+
+There is also a tutorial to learn more about evaluating the ASR models with N-gram LM here:
+`Offline ASR Inference with Beam Search and External Language Model Rescoring `_
+
+Beam Search Engines
+-------------------
+
+NeMo ASR CTC supports multiple beam search engines for decoding. The default engine is ``beam`` which is the OpenSeq2Seq
+decoding library.
+
+OpenSeq2Seq (``beam``)
+~~~~~~~~~~~~~~~~~~~~~~
+
+CPU-based beam search engine that is quite efficient and supports char and subword models. It requires a character/subword
+KenLM model to be provided.
+
+The config for this decoding library is described above.
+
+Flashlight (``flashlight``)
+~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Flashlight is a C++ library for ASR decoding provided at `https://github.com/flashlight/flashlight `_. It is a CPU and CUDA-based beam search engine that is quite efficient and supports
+char and subword models. It an ARPA KenLM file.
+
+It supports several advanced features such as lexicon based / lexicon free decoding, beam pruning threshold, and more.
+
+.. code-block:: python
+
+ @dataclass
+ class FlashlightConfig:
+ lexicon_path: Optional[str] = None
+ beam_size_token: int = 16
+ beam_threshold: float = 20.0
+ unk_weight: float = -math.inf
+ sil_weight: float = 0.0
+ unit_lm: bool = False
+
+.. code-block::
+
+ # Lexicon-based decoding
+ python eval_beamsearch_ngram.py ... \
+ decoding_strategy="flashlight" \
+ decoding.beam.flashlight_cfg.lexicon_path='/path/to/lexicon.lexicon' \
+ decoding.beam.flashlight_cfg.beam_size_token = 32 \
+ decoding.beam.flashlight_cfg.beam_threshold = 25.0
+
+ # Lexicon-free decoding
+ python eval_beamsearch_ngram.py ... \
+ decoding_strategy="flashlight" \
+ decoding.beam.flashlight_cfg.beam_size_token = 32 \
+ decoding.beam.flashlight_cfg.beam_threshold = 25.0
+
+
+PyCTCDecode (``pyctcdecode``)
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+PyCTCDecode is a Python library for ASR decoding provided at `https://github.com/kensho-technologies/pyctcdecode `_. It is a CPU-based beam search engine that is somewhat efficient for a pure python library, and supports char and subword models. It requires a character/subword KenLM ARPA / BINARY model to be provided.
+
+It has advanced features such as word boosting which can be useful for transcript customization.
+
+.. code-block:: python
+
+ @dataclass
+ class PyCTCDecodeConfig:
+ beam_prune_logp: float = -10.0
+ token_min_logp: float = -5.0
+ prune_history: bool = False
+ hotwords: Optional[List[str]] = None
+ hotword_weight: float = 10.0
+
+.. code-block::
+
+ # PyCTCDecoding
+ python eval_beamsearch_ngram.py ... \
+ decoding_strategy="pyctcdecode" \
+ decoding.beam.pyctcdecode_cfg.beam_prune_logp = -10. \
+ decoding.beam.pyctcdecode_cfg.token_min_logp = -5. \
+ decoding.beam.pyctcdecode_cfg.hotwords=[] \
+ decoding.beam.pyctcdecode_cfg.hotword_weight=10.0
+
+
+Hyperparameter Grid Search
+--------------------------
+
+Beam search decoding with N-gram LM has three main hyperparameters: `beam_width`, `beam_alpha`, and `beam_beta`.
+The accuracy of the model is dependent to the values of these parameters, specially beam_alpha and beam_beta.
+You may specify a single or list of values for each of these parameters to perform grid search. It would perform the
+beam search decoding on all the combinations of the these three hyperparameters.
+For instance, the following set of parameters would results in 2*1*2=4 beam search decodings:
+
+.. code-block::
+
+ python eval_beamsearch_ngram.py ... \
+ beam_width=[64,128] \
+ beam_alpha=[1.0] \
+ beam_beta=[1.0,0.5]
+
+
+.. _neural_rescoring:
+
+****************
+Neural Rescoring
+****************
+
+In this approach a neural network is used which can gives scores to a candidate. A candidate is the text transcript predicted by the decoder of the ASR model.
+The top K candidates produced by the beam search decoding (beam width of K) are given to a neural language model to rank them.
+Ranking can be done by a language model which gives a score to each candidate.
+This score is usually combined with the scores from the beam search decoding to produce the final scores and rankings.
+
+Train Neural Rescorer
+=====================
+
+An example script to train such a language model with Transformer can be found at `examples/nlp/language_modeling/transformer_lm.py `__.
+It trains a ``TransformerLMModel`` which can be used as a neural rescorer for an ASR system. Full documentation on language models training is available at:
+
+:doc:`../nlp/language_modeling`
+
+You may also use a pretrained language model from HuggingFace library like Transformer-XL and GPT instead of training your model.
+Models like BERT and RoBERTa are not supported by this script as they are trained as a Masked Language Model and are not efficient and effective to score sentences out of the box.
+
+
+Evaluation
+==========
+
+Given a trained TransformerLMModel `.nemo` file or a pretrained HF model, the script available at
+`scripts/asr_language_modeling/neural_rescorer/eval_neural_rescorer.py `__
+can be used to re-score beams obtained with ASR model. You need the `.tsv` file containing the candidates produced
+by the acoustic model and the beam search decoding to use this script. The candidates can be the result of just the beam
+search decoding or the result of fusion with an N-gram LM. You may generate this file by specifying `--preds_output_folder' for
+`scripts/asr_language_modeling/ngram_lm/eval_beamsearch_ngram.py `__.
+
+The neural rescorer would rescore the beams/candidates by using two parameters of `rescorer_alpha` and `rescorer_beta` as the following:
+
+.. code-block::
+
+ final_score = beam_search_score + rescorer_alpha*neural_rescorer_score + rescorer_beta*seq_length
+
+Parameter `rescorer_alpha` specifies amount of importance to place on the neural rescorer model, and `rescorer_beta` is
+a penalty term to consider the sequence length in the scores. They have similar effects like the parameters
+`beam_alpha` and `beam_beta` of beam search decoder and N-gram LM.
+
+You may follow the following steps to evaluate a neural LM:
+
+#. Obtain `.tsv` file with beams and their corresponding scores. Scores can be from a regular beam search decoder or
+ in fusion with an N-gram LM scores. For a given beam size `beam_size` and a number of examples
+ for evaluation `num_eval_examples`, it should contain (`num_eval_examples` x `beam_size`) lines of
+ form `beam_candidate_text \t score`. This file can be generated by `scripts/asr_language_modeling/ngram_lm/eval_beamsearch_ngram.py `__
+
+#. Rescore the candidates by `scripts/asr_language_modeling/neural_rescorer/eval_neural_rescorer.py `__.
+
+.. code-block::
+
+ python eval_neural_rescorer.py
+ --lm_model=[path to .nemo file of the LM or the name of a HF pretrained model]
+ --beams_file=[path to beams .tsv file]
+ --beam_size=[size of the beams]
+ --eval_manifest=[path to eval manifest .json file]
+ --batch_size=[batch size used for inference on the LM model]
+ --alpha=[the value for the parameter rescorer_alpha]
+ --beta=[the value for the parameter rescorer_beta]
+ --scores_output_file=[the optional path to store the rescored candidates]
+
+The candidates along with their new scores would be stored at the file specified by `--scores_output_file`.
+
+The following is the list of the arguments for the evaluation script:
+
++---------------------+--------+------------------+-------------------------------------------------------------------------+
+| **Argument** |**Type**| **Default** | **Description** |
++---------------------+--------+------------------+-------------------------------------------------------------------------+
+| lm_model | str | Required | The path of the '.nemo' file of an ASR model, or the name of a |
+| | | | HuggingFace pretrained model like 'transfo-xl-wt103' or 'gpt2' |
++---------------------+--------+------------------+-------------------------------------------------------------------------+
+| eval_manifest | str | Required | Path to the evaluation manifest file (.json manifest file) |
++---------------------+--------+------------------+-------------------------------------------------------------------------+
+| beams_file | str | Required | path to beams file (.tsv) containing the candidates and their scores |
++---------------------+--------+------------------+-------------------------------------------------------------------------+
+| beam_size | int | Required | The width of the beams (number of candidates) generated by the decoder |
++---------------------+--------+------------------+-------------------------------------------------------------------------+
+| alpha | float | None | The value for parameter rescorer_alpha |
+| | | | Not passing value would enable linear search for rescorer_alpha |
++---------------------+--------+------------------+-------------------------------------------------------------------------+
+| beta | float | None | The value for parameter rescorer_beta |
+| | | | Not passing value would enable linear search for rescorer_beta |
++---------------------+--------+------------------+-------------------------------------------------------------------------+
+| batch_size | int | 16 | The batch size used to calculate the scores |
++---------------------+--------+------------------+-------------------------------------------------------------------------+
+| max_seq_length | int | 512 | Maximum sequence length (in tokens) for the input |
++---------------------+--------+------------------+-------------------------------------------------------------------------+
+| scores_output_file | str | None | The optional file to store the rescored beams |
++---------------------+--------+------------------+-------------------------------------------------------------------------+
+| use_amp | bool | ``False`` | Whether to use AMP if available calculate the scores |
++---------------------+--------+------------------+-------------------------------------------------------------------------+
+| device | str | cuda | The device to load LM model onto to calculate the scores |
+| | | | It can be 'cpu', 'cuda', 'cuda:0', 'cuda:1', ... |
++---------------------+--------+------------------+-------------------------------------------------------------------------+
+
+
+Hyperparameter Linear Search
+----------------------------
+
+This script also supports linear search for parameters `alpha` and `beta`. If any of the two is not
+provided, a linear search is performed to find the best value for that parameter. When linear search is used, initially
+`beta` is set to zero and the best value for `alpha` is found, then `alpha` is fixed with
+that value and another linear search is done to find the best value for `beta`.
+If any of the of these two parameters is already specified, then search for that one is skipped. After each search for a
+parameter, the plot of WER% for different values of the parameter is also shown.
+
+It is recommended to first use the linear search for both parameters on a validation set by not providing any values for `--alpha` and `--beta`.
+Then check the WER curves and decide on the best values for each parameter. Finally, evaluate the best values on the test set.
diff --git a/docs/source/asr/configs.rst b/docs/source/asr/configs.rst
new file mode 100644
index 0000000000000000000000000000000000000000..80ec488fe0c3a787eb7d2e7782f27cbbece08da5
--- /dev/null
+++ b/docs/source/asr/configs.rst
@@ -0,0 +1,929 @@
+NeMo ASR Configuration Files
+============================
+
+This section describes the NeMo configuration file setup that is specific to models in the ASR collection. For general information
+about how to set up and run experiments that is common to all NeMo models (e.g. Experiment Manager and PyTorch Lightning trainer
+parameters), see the :doc:`../core/core` section.
+
+The model section of the NeMo ASR configuration files generally requires information about the dataset(s) being used, the preprocessor
+for audio files, parameters for any augmentation being performed, as well as the model architecture specification. The sections on
+this page cover each of these in more detail.
+
+Example configuration files for all of the NeMo ASR scripts can be found in the
+`config directory of the examples `_.
+
+
+Dataset Configuration
+---------------------
+
+Training, validation, and test parameters are specified using the ``train_ds``, ``validation_ds``, and
+``test_ds`` sections in the configuration file, respectively. Depending on the task, there may be arguments specifying the sample rate
+of the audio files, the vocabulary of the dataset (for character prediction), whether or not to shuffle the dataset, and so on. You may
+also decide to leave fields such as the ``manifest_filepath`` blank, to be specified via the command-line at runtime.
+
+Any initialization parameter that is accepted for the Dataset class used in the experiment can be set in the config file.
+Refer to the `Datasets <./api.html#Datasets>`__ section of the API for a list of Datasets and their respective parameters.
+
+An example ASR train and validation configuration should look similar to the following:
+
+.. code-block:: yaml
+
+ # Specified at the beginning of the config file
+ labels: &labels [" ", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m",
+ "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "'"]
+
+ model:
+ train_ds:
+ manifest_filepath: ???
+ sample_rate: 16000
+ labels: *labels # Uses the labels above
+ batch_size: 32
+ trim_silence: True
+ max_duration: 16.7
+ shuffle: True
+ num_workers: 8
+ pin_memory: true
+ # tarred datasets
+ is_tarred: false # If set to true, uses the tarred version of the Dataset
+ tarred_audio_filepaths: null # Not used if is_tarred is false
+ shuffle_n: 2048 # Not used if is_tarred is false
+ # bucketing params
+ bucketing_strategy: "synced_randomized"
+ bucketing_batch_size: null
+ bucketing_weights: null
+
+ validation_ds:
+ manifest_filepath: ???
+ sample_rate: 16000
+ labels: *labels # Uses the labels above
+ batch_size: 32
+ shuffle: False # No need to shuffle the validation data
+ num_workers: 8
+ pin_memory: true
+
+By default, dataloaders are set up when the model is instantiated. However, dataloader setup can be deferred to
+model's `setup()` method by setting ``defer_setup`` in the configuration.
+
+For example, training data setup can be deferred as follows:
+
+.. code-block:: yaml
+
+ model:
+ train_ds:
+ # Configure training data as usual
+ ...
+ # Defer train dataloader setup from `__init__` to `setup`
+ defer_setup: true
+
+
+Preprocessor Configuration
+--------------------------
+
+If you are loading audio files for your experiment, you will likely want to use a preprocessor to convert from the
+raw audio signal to features (e.g. mel-spectrogram or MFCC). The ``preprocessor`` section of the config specifies the audio
+preprocessor to be used via the ``_target_`` field, as well as any initialization parameters for that preprocessor.
+
+An example of specifying a preprocessor is as follows:
+
+.. code-block:: yaml
+
+ model:
+ ...
+ preprocessor:
+ # _target_ is the audio preprocessor module you want to use
+ _target_: nemo.collections.asr.modules.AudioToMelSpectrogramPreprocessor
+ normalize: "per_feature"
+ window_size: 0.02
+ ...
+ # Other parameters for the preprocessor
+
+Refer to the `Audio Preprocessors <./api.html#Audio Preprocessors>`__ API section for the preprocessor options, expected arguments,
+and defaults.
+
+Augmentation Configurations
+---------------------------
+
+There are a few on-the-fly spectrogram augmentation options for NeMo ASR, which can be specified by the
+configuration file using a ``spec_augment`` section.
+
+For example, there are options for `Cutout `_ and
+`SpecAugment `_ available via the ``SpectrogramAugmentation`` module.
+
+The following example sets up both ``Cutout`` (via the ``rect_*`` parameters) and ``SpecAugment`` (via the ``freq_*``
+and ``time_*`` parameters).
+
+.. code-block:: yaml
+
+ model:
+ ...
+ spec_augment:
+ _target_: nemo.collections.asr.modules.SpectrogramAugmentation
+ # Cutout parameters
+ rect_masks: 5 # Number of rectangles to cut from any given spectrogram
+ rect_freq: 50 # Max cut of size 50 along the frequency dimension
+ rect_time: 120 # Max cut of size 120 along the time dimension
+ # SpecAugment parameters
+ freq_masks: 2 # Cut two frequency bands
+ freq_width: 15 # ... of width 15 at maximum
+ time_masks: 5 # Cut out 10 time bands
+ time_width: 25 # ... of width 25 at maximum
+
+You can use any combination of ``Cutout``, frequency/time ``SpecAugment``, or neither of them.
+
+With NeMo ASR, you can also add augmentation pipelines that can be used to simulate various kinds of noise
+added to audio in the channel. Augmentors in a pipeline are applied on the audio data read in the data layer. Online
+augmentors can be specified in the config file using an ``augmentor`` section in ``train_ds``. The following example
+adds an augmentation pipeline that first adds white noise to an audio sample with a probability of 0.5 and at a level
+randomly picked between -50 dB and -10 dB and then passes the resultant samples through a room impulse response randomly
+picked from the manifest file provided for ``impulse`` augmentation in the config file.
+
+.. code-block:: yaml
+
+ model:
+ ...
+ train_ds:
+ ...
+ augmentor:
+ white_noise:
+ prob: 0.5
+ min_level: -50
+ max_level: -10
+ impulse:
+ prob: 0.3
+ manifest_path: /path/to/impulse_manifest.json
+
+Refer to the `Audio Augmentors <./api.html#Audio Augmentors>`__ API section for more details.
+
+Tokenizer Configurations
+------------------------
+
+Some models utilize sub-word encoding via an external tokenizer instead of explicitly defining their vocabulary.
+
+For such models, a ``tokenizer`` section is added to the model config. ASR models currently support two types of
+custom tokenizers:
+
+- Google Sentencepiece tokenizers (tokenizer type of ``bpe`` in the config)
+- HuggingFace WordPiece tokenizers (tokenizer type of ``wpe`` in the config)
+- Aggregate tokenizers ((tokenizer type of ``agg`` in the config), see below)
+
+In order to build custom tokenizers, refer to the ``ASR_with_Subword_Tokenization`` notebook available in the
+ASR tutorials directory.
+
+The following example sets up a ``SentencePiece Tokenizer`` at a path specified by the user:
+
+.. code-block:: yaml
+
+ model:
+ ...
+ tokenizer:
+ dir: ""
+ type: "bpe" # can be "bpe" or "wpe"
+
+The Aggregate (``agg``) tokenizer feature makes it possible to combine tokenizers in order to train multilingual
+models. The config file would look like this:
+
+.. code-block:: yaml
+
+ model:
+ ...
+ tokenizer:
+ type: "agg" # aggregate tokenizer
+ langs:
+ en:
+ dir: ""
+ type: "bpe" # can be "bpe" or "wpe"
+ es:
+ dir: ""
+ type: "bpe" # can be "bpe" or "wpe"
+
+In the above config file, each language is associated with its own pre-trained tokenizer, which gets assigned
+a token id range in the order the tokenizers are listed. To train a multilingual model, one needs to populate the
+``lang`` field in the manifest file, allowing the routing of each sample to the correct tokenizer. At inference time,
+the routing is done based on the inferred token id range.
+
+For models which utilize sub-word tokenization, we share the decoder module (``ConvASRDecoder``) with character tokenization models.
+All parameters are shared, but for models which utilize sub-word encoding, there are minor differences when setting up the config. For
+such models, the tokenizer is utilized to fill in the missing information when the model is constructed automatically.
+
+For example, a decoder config corresponding to a sub-word tokenization model should look similar to the following:
+
+.. code-block:: yaml
+
+ model:
+ ...
+ decoder:
+ _target_: nemo.collections.asr.modules.ConvASRDecoder
+ feat_in: *enc_final
+ num_classes: -1 # filled with vocabulary size from tokenizer at runtime
+ vocabulary: [] # filled with vocabulary from tokenizer at runtime
+
+
+Model Architecture Configurations
+---------------------------------
+
+Each configuration file should describe the model architecture being used for the experiment. Models in the NeMo ASR collection need
+an ``encoder`` section and a ``decoder`` section, with the ``_target_`` field specifying the module to use for each.
+
+Here is the list of the parameters in the model section which are shared among most of the ASR models:
+
++-------------------------+------------------+---------------------------------------------------------------------------------------------------------------+---------------------------------+
+| **Parameter** | **Datatype** | **Description** | **Supported Values** |
++=========================+==================+===============================================================================================================+=================================+
+| :code:`log_prediction` | bool | Whether a random sample should be printed in the output at each step, along with its predicted transcript. | |
++-------------------------+------------------+---------------------------------------------------------------------------------------------------------------+---------------------------------+
+| :code:`ctc_reduction` | string | Specifies the reduction type of CTC loss. Defaults to ``mean_batch`` which would take the average over the | :code:`none`, |
+| | | batch after taking the average over the length of each sample. | :code:`mean_batch` |
+| | | | :code:`mean`, :code:`sum` |
++-------------------------+------------------+---------------------------------------------------------------------------------------------------------------+---------------------------------+
+
+The following sections go into more detail about the specific configurations of each model architecture.
+
+For more information about the ASR models, refer to the :doc:`Models <./models>` section.
+
+Jasper and QuartzNet
+~~~~~~~~~~~~~~~~~~~~
+
+The `Jasper <./models.html#Jasper>`__ and `QuartzNet <./models.html#QuartzNet>`__ models are very similar, and as such the components in their
+configs are very similar as well.
+
+Both architectures use the ``ConvASREncoder`` for the ``encoder``, with parameters detailed in the table below. The encoder parameters
+include details about the Jasper/QuartzNet ``[BxR]`` encoder architecture, including how many blocks to use (``B``), how many times
+to repeat each sub-block (``R``), and the convolution parameters for each block.
+
+The number of blocks ``B`` is determined by the number of list elements under ``jasper`` minus the one prologue and two epilogue blocks.
+The number of sub-blocks ``R`` is determined by setting the ``repeat`` parameter.
+
+To use QuartzNet (which uses more compact time-channel separable convolutions) instead of Jasper, add :code:`separable: true` to all
+but the last block in the architecture.
+
+Change the parameter name ``jasper``.
+
++-------------------------+------------------+---------------------------------------------------------------------------------------------------------------+-------------------------------------+
+| **Parameter** | **Datatype** | **Description** | **Supported Values** |
++=========================+==================+===============================================================================================================+=====================================+
+| :code:`feat_in` | int | The number of input features. Should be equal to :code:`features` in the preprocessor parameters. | |
++-------------------------+------------------+---------------------------------------------------------------------------------------------------------------+-------------------------------------+
+| :code:`activation` | string | Which activation function to use in the encoder. | :code:`hardtanh`, :code:`relu`, |
+| | | | :code:`selu`, :code:`swish` |
++-------------------------+------------------+---------------------------------------------------------------------------------------------------------------+-------------------------------------+
+| :code:`conv_mask` | bool | Whether to use masked convolutions in the encoder. Defaults to ``true``. | |
++-------------------------+------------------+---------------------------------------------------------------------------------------------------------------+-------------------------------------+
+| :code:`jasper` | | A list of blocks that specifies your encoder architecture. Each entry in this list represents one block in | |
+| | | the architecture and contains the parameters for that block, including convolution parameters, dropout, and | |
+| | | the number of times the block is repeated. Refer to the `Jasper `_ and | |
+| | | `QuartzNet `_ papers for details about specific model configurations. | |
++-------------------------+------------------+---------------------------------------------------------------------------------------------------------------+-------------------------------------+
+
+A QuartzNet 15x5 (fifteen blocks, each sub-block repeated five times) encoder configuration should look similar to the following example:
+
+.. code-block:: yaml
+
+ # Specified at the beginning of the file for convenience
+ n_mels: &n_mels 64 # Used for both the preprocessor and encoder as number of input features
+ repeat: &repeat 5 # R=5
+ dropout: &dropout 0.0
+ separable: &separable true # Set to true for QN. Set to false for Jasper.
+
+ model:
+ ...
+ encoder:
+ _target_: nemo.collections.asr.modules.ConvASREncoder
+ feat_in: *n_mels # Should match "features" in the preprocessor.
+ activation: relu
+ conv_mask: true
+
+ jasper: # This field name should be "jasper" for both types of models.
+
+ # Prologue block
+ - dilation: [1]
+ dropout: *dropout
+ filters: 256
+ kernel: [33]
+ repeat: 1 # Prologue block is not repeated.
+ residual: false
+ separable: *separable
+ stride: [2]
+
+ # Block 1
+ - dilation: [1]
+ dropout: *dropout
+ filters: 256
+ kernel: [33]
+ repeat: *repeat
+ residual: true
+ separable: *separable
+ stride: [1]
+
+ ... # Entries for blocks 2~14
+
+ # Block 15
+ - dilation: [1]
+ dropout: *dropout
+ filters: 512
+ kernel: [75]
+ repeat: *repeat
+ residual: true
+ separable: *separable
+ stride: [1]
+
+ # Two epilogue blocks
+ - dilation: [2]
+ dropout: *dropout
+ filters: 512
+ kernel: [87]
+ repeat: 1 # Epilogue blocks are not repeated
+ residual: false
+ separable: *separable
+ stride: [1]
+
+ - dilation: [1]
+ dropout: *dropout
+ filters: &enc_filters 1024
+ kernel: [1]
+ repeat: 1 # Epilogue blocks are not repeated
+ residual: false
+ stride: [1]
+
+Both Jasper and QuartzNet use the ``ConvASRDecoder`` as the decoder. The decoder parameters are detailed in the following table.
+
++-------------------------+------------------+---------------------------------------------------------------------------------------------------------------+---------------------------------+
+| **Parameter** | **Datatype** | **Description** | **Supported Values** |
++=========================+==================+===============================================================================================================+=================================+
+| :code:`feat_in` | int | The number of input features to the decoder. Should be equal to the number of filters in the last block of | |
+| | | the encoder. | |
++-------------------------+------------------+---------------------------------------------------------------------------------------------------------------+---------------------------------+
+| :code:`vocabulary` | list | A list of the valid output characters for your model. For example, for an English dataset, this could be a | |
+| | | list of all lowercase letters, space, and apostrophe. | |
++-------------------------+------------------+---------------------------------------------------------------------------------------------------------------+---------------------------------+
+| :code:`num_classes` | int | Number of output classes, i.e. the length of :code:`vocabulary`. | |
++-------------------------+------------------+---------------------------------------------------------------------------------------------------------------+---------------------------------+
+
+For example, a decoder config corresponding to the encoder above should look similar to the following:
+
+.. code-block:: yaml
+
+ model:
+ ...
+ decoder:
+ _target_: nemo.collections.asr.modules.ConvASRDecoder
+ feat_in: *enc_filters
+ vocabulary: *labels
+ num_classes: 28 # Length of the vocabulary list
+
+Citrinet
+~~~~~~~~
+
+The `Citrinet <./models.html#Citrinet>`__ and `QuartzNet <./models.html#QuartzNet>`__ models are very similar, and as such the
+components in their configs are very similar as well. Citrinet utilizes Squeeze and Excitation, as well as sub-word tokenization, in
+contrast to QuartzNet. Depending on the dataset, we utilize different tokenizers. For Librispeech, we utilize the HuggingFace WordPiece
+tokenizer, and for all other datasets we utilize the Google Sentencepiece tokenizer - usually the ``unigram`` tokenizer type.
+
+Both architectures use the ``ConvASREncoder`` for the ``encoder``, with parameters detailed above. The encoder parameters include
+details about the Citrinet-C encoder architecture, including how many filters are used per channel (``C``). The Citrinet-C
+configuration is a shortform notation for Citrinet-21x5xC, such that ``B = 21`` and ``R = 5`` are the default and should generally
+not be changed.
+
+To use Citrinet instead of QuartzNet, refer to the ``citrinet_512.yaml`` configuration found inside the ``examples/asr/conf/citrinet``
+directory. Citrinet is primarily comprised of the same :class:`~nemo.collections.asr.parts.submodules.jasper.JasperBlock` as ``Jasper`` or
+``QuartzNet``.
+
+While the configs for Citrinet and QuartzNet are similar, we note the additional flags used for Citrinet below. Refer to the
+``JasperBlock`` documentation for the meaning of these arguments.
+
++---------------------------+------------------+-----------------------------------------------------------------------------------------------------------+-----------------------------------+
+| **Parameter** | **Datatype** | **Description** | **Supported Values** |
++===========================+==================+===========================================================================================================+===================================+
+| :code:`se` | bool | Whether to apply squeeze-and-excitation mechanism or not. | :code:`true` or :code:`false` |
++---------------------------+------------------+-----------------------------------------------------------------------------------------------------------+-----------------------------------+
+| :code:`se_context_size` | int | SE context size. -1 means global context. | :code:`-1` or :code:`+ve int` |
++---------------------------+------------------+-----------------------------------------------------------------------------------------------------------+-----------------------------------+
+| :code:`stride_last` | bool | Stride on the final repeated block or all repeated blocks. | :code:`true` or :code:`false` |
++---------------------------+------------------+-----------------------------------------------------------------------------------------------------------+-----------------------------------+
+| :code:`residual_mode` | str | Type of residual branch to construct. | :code:`"add"` or |
+| | | Can be pointwise residual addition or pointwise strided residual attention | :code:`"stride_add"` |
++---------------------------+------------------+-----------------------------------------------------------------------------------------------------------+-----------------------------------+
+
+A Citrinet-512 config should look similar to the following:
+
+.. code-block:: yaml
+
+ model:
+ ...
+ # Specify some defaults across the entire model
+ model_defaults:
+ repeat: 5
+ dropout: 0.1
+ separable: true
+ se: true
+ se_context_size: -1
+ ...
+ encoder:
+ _target_: nemo.collections.asr.modules.ConvASREncoder
+ feat_in: *n_mels # Should match "features" in the preprocessor.
+ activation: relu
+ conv_mask: true
+
+ jasper: # This field name should be "jasper" for the JasperBlock (which constructs Citrinet).
+
+ # Prologue block
+ - filters: 512
+ repeat: 1
+ kernel: [5]
+ stride: [1]
+ dilation: [1]
+ dropout: 0.0
+ residual: false
+ separable: ${model.model_defaults.separable}
+ se: ${model.model_defaults.se}
+ se_context_size: ${model.model_defaults.se_context_size}
+
+ # Block 1
+ - filters: 512
+ repeat: ${model.model_defaults.repeat}
+ kernel: [11]
+ stride: [2]
+ dilation: [1]
+ dropout: ${model.model_defaults.dropout}
+ residual: true
+ separable: ${model.model_defaults.separable}
+ se: ${model.model_defaults.se}
+ se_context_size: ${model.model_defaults.se_context_size}
+ stride_last: true
+ residual_mode: "stride_add"
+
+ ... # Entries for blocks 2~21
+
+ # Block 22
+ - filters: 512
+ repeat: ${model.model_defaults.repeat}
+ kernel: [39]
+ stride: [1]
+ dilation: [1]
+ dropout: ${model.model_defaults.dropout}
+ residual: true
+ separable: ${model.model_defaults.separable}
+ se: ${model.model_defaults.se}
+ se_context_size: ${model.model_defaults.se_context_size}
+
+ # Epilogue block
+
+ - filters: &enc_final 640
+ repeat: 1
+ kernel: [41]
+ stride: [1]
+ dilation: [1]
+ dropout: 0.0
+ residual: false
+ separable: ${model.model_defaults.separable}
+ se: ${model.model_defaults.se}
+ se_context_size: ${model.model_defaults.se_context_size}
+
+As mentioned above, Citrinet uses the ``ConvASRDecoder`` as the decoder layer similar to QuartzNet. Only the configuration must be
+changed slightly as Citrinet utilizes sub-word tokenization.
+
+.. note::
+ The following information is relevant to any of the above models that implements its encoder as an :class:`~nemo.collections.asr.modules.conv_asr.ConvASREncoder`, and utilizes the ``SqueezeExcite`` mechanism.
+
+The ``SqueezeExcite`` block within a :class:`~nemo.collections.asr.modules.conv_asr.ConvASREncoder` network can be modified to utilize a different context window after the model has been instantiated (even after the model has been trained) so as to evaluate the model with limited context. This can be achieved using the :meth:`~nemo.collections.asr.parts.mixins.mixins.ASRModuleMixin.change_conv_asr_se_context_window`
+
+.. code-block:: python
+
+ # Here, model can be any model that has a `ConvASREncoder` as its encoder, and utilized `SqueezeExcite` blocks
+ # `context_window` : It is an integer representing the number of timeframes (each corresponding to some window stride).
+ # `update_config` : Bool flag which determines whether the config of the model should be updated to reflect the new context window.
+
+ # Here, we specify that 128 timeframes of 0.01s stride should be the context window
+ # This is equivalent to 128 * 0.01s context window for `SqueezeExcite`
+ model.change_conv_asr_se_context_window(context_window=128, update_config=True)
+
+Conformer-CTC
+~~~~~~~~~~~~~
+
+The config files for Conformer-CTC model contain character-based encoding and sub-word encoding at
+``/examples/asr/conf/conformer/conformer_ctc_char.yaml`` and ``/examples/asr/conf/conformer/conformer_ctc_bpe.yaml``
+respectively. Some components of the configs of `Conformer-CTC <./models.html#Conformer-CTC>`__ include the following datasets:
+
+* ``train_ds``, ``validation_ds``, and ``test_ds``
+* opimizer (``optim``)
+* augmentation (``spec_augment``)
+* ``decoder``
+* ``trainer``
+* ``exp_manager``
+
+These datasets are similar to other ASR models like `QuartzNet <./models.html#QuartzNet>`__. There should be a tokenizer section where you can
+specify the tokenizer if you want to use sub-word encoding instead of character-based encoding.
+
+
+The encoder section includes the details about the Conformer-CTC encoder architecture. You may find more information in the
+config files and also :ref:`nemo.collections.asr.modules.ConformerEncoder `.
+
+Squeezeformer-CTC
+~~~~~~~~~~~~~~~~~
+
+The config files for Squeezeformer-CTC model contain character-based encoding and sub-word encoding at
+``/examples/asr/conf/squeezeformer/squeezeformer_ctc_char.yaml`` and ``/examples/asr/conf/squeezeformer/squeezeformer_ctc_bpe.yaml``
+respectively. Components of the configs of `Squeezeformer-CTC <./models.html#Squeezeformer-CTC>`__ are similar to Conformer config - `QuartzNet <./configs.html#Conformer-CTC>`__.
+
+The encoder section includes the details about the Squeezeformer-CTC encoder architecture. You may find more information in the
+config files and also :ref:`nemo.collections.asr.modules.SqueezeformerEncoder `.
+
+
+ContextNet
+~~~~~~~~~~
+
+Please refer to the model page of `ContextNet <./models.html#ContextNet>`__ for more information on this model.
+
+Conformer-Transducer
+~~~~~~~~~~~~~~~~~~~~
+
+Please refer to the model page of `Conformer-Transducer <./models.html#Conformer-Transducer>`__ for more information on this model.
+
+LSTM-Transducer and LSTM-CTC
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+The config files for LSTM-Transducer and LSTM-CTC models can be found at ``/examples/asr/conf/lstm/lstm_transducer_bpe.yaml`` and ``/examples/asr/conf/lstm/lstm_ctc_bpe.yaml`` respectively.
+Most of the of the configs of are similar to other ctc or transducer models. The main difference is the encoder part.
+The encoder section includes the details about the RNN-based encoder architecture. You may find more information in the
+config files and also :ref:`nemo.collections.asr.modules.RNNEncoder `.
+
+
+InterCTC Config
+---------------
+
+All CTC-based models also support `InterCTC loss `_. To use it, you need to specify
+2 parameters as in example below
+
+.. code-block:: yaml
+
+ model:
+ # ...
+ interctc:
+ loss_weights: [0.3]
+ apply_at_layers: [8]
+
+which can be used to reproduce the default setup from the paper (assuming the total number of layers is 18).
+You can also specify multiple CTC losses from different layers, e.g., to get 2 losses from layers 3 and 8 with
+weights 0.1 and 0.3, specify:
+
+.. code-block:: yaml
+
+ model:
+ # ...
+ interctc:
+ loss_weights: [0.1, 0.3]
+ apply_at_layers: [3, 8]
+
+Note that the final-layer CTC loss weight is automatically computed to normalize
+all weight to 1 (0.6 in the example above).
+
+
+Stochastic Depth Config
+-----------------------
+
+`Stochastic Depth `_ is a useful technique for regularizing ASR model training.
+Currently it's only supported for :ref:`nemo.collections.asr.modules.ConformerEncoder `. To
+use it, specify the following parameters in the encoder config file to reproduce the default setup from the paper:
+
+.. code-block:: yaml
+
+ model:
+ # ...
+ encoder:
+ # ...
+ stochastic_depth_drop_prob: 0.3
+ stochastic_depth_mode: linear # linear or uniform
+ stochastic_depth_start_layer: 1
+
+See :ref:`documentation of ConformerEncoder ` for more details. Note that stochastic depth
+is supported for both CTC and Transducer model variations (or any other kind of model/loss that's using
+conformer as encoder).
+
+
+Transducer Configurations
+-------------------------
+
+All CTC-based ASR model configs can be modified to support Transducer loss training. Below, we discuss the modifications required in the config to enable Transducer training. All modifications are made to the ``model`` config.
+
+Model Defaults
+~~~~~~~~~~~~~~
+
+It is a subsection to the model config representing the default values shared across the entire model represented as ``model.model_defaults``.
+
+There are three values that are primary components of a transducer model. They are :
+
+* ``enc_hidden``: The hidden dimension of the final layer of the Encoder network.
+* ``pred_hidden``: The hidden dimension of the final layer of the Prediction network.
+* ``joint_hidden``: The hidden dimension of the intermediate layer of the Joint network.
+
+One can access these values inside the config by using OmegaConf interpolation as follows :
+
+.. code-block:: yaml
+
+ model:
+ ...
+ model_defaults:
+ enc_hidden: 256
+ pred_hidden: 256
+ joint_hidden: 256
+ ...
+ decoder:
+ ...
+ prednet:
+ pred_hidden: ${model.model_defaults.pred_hidden}
+
+Acoustic Encoder Model
+~~~~~~~~~~~~~~~~~~~~~~
+
+The transducer model is comprised of three models combined. One of these models is the Acoustic (encoder) model. We should be able to drop in any CTC Acoustic model config into this section of the transducer config.
+
+The only condition that needs to be met is that **the final layer of the acoustic model must have the hidden dimension defined in ``model_defaults.enc_hidden``**.
+
+Decoder / Prediction Model
+~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+The Prediction model is generally an autoregressive, causal model that consumes text tokens and returns embeddings that will be used by the Joint model. The base config for an LSTM based Prediction network can be found in the the ``decoder`` section of `ContextNet <./models.html#ContextNet>`__ or other Transducer architectures. For further information refer to the ``Intro to Transducers`` tutorial in the ASR tutorial section.
+
+**This config can be copy-pasted into any custom transducer model with no modification.**
+
+Let us discuss some of the important arguments:
+
+* ``blank_as_pad``: In ordinary transducer models, the embedding matrix does not acknowledge the ``Transducer Blank`` token (similar to CTC Blank). However, this causes the autoregressive loop to be more complicated and less efficient. Instead, this flag which is set by default, will add the ``Transducer Blank`` token to the embedding matrix - and use it as a pad value (zeros tensor). This enables more efficient inference without harming training. For further information refer to the ``Intro to Transducers`` tutorial in the ASR tutorial section.
+
+* ``prednet.pred_hidden``: The hidden dimension of the LSTM and the output dimension of the Prediction network.
+
+.. code-block:: yaml
+
+ decoder:
+ _target_: nemo.collections.asr.modules.RNNTDecoder
+ normalization_mode: null
+ random_state_sampling: false
+ blank_as_pad: true
+
+ prednet:
+ pred_hidden: ${model.model_defaults.pred_hidden}
+ pred_rnn_layers: 1
+ t_max: null
+ dropout: 0.0
+
+Joint Model
+~~~~~~~~~~~
+
+The Joint model is a simple feed-forward Multi-Layer Perceptron network. This MLP accepts the output of the Acoustic and Prediction models and computes a joint probability distribution over the entire vocabulary space. The base config for the Joint network can be found in the the ``joint`` section of `ContextNet <./models.html#ContextNet>`__ or other Transducer architectures. For further information refer to the ``Intro to Transducers`` tutorial in the ASR tutorial section.
+
+**This config can be copy-pasted into any custom transducer model with no modification.**
+
+The Joint model config has several essential components which we discuss below :
+
+* ``log_softmax``: Due to the cost of computing softmax on such large tensors, the Numba CUDA implementation of RNNT loss will implicitly compute the log softmax when called (so its inputs should be logits). The CPU version of the loss doesn't face such memory issues so it requires log-probabilities instead. Since the behaviour is different for CPU-GPU, the ``None`` value will automatically switch behaviour dependent on whether the input tensor is on a CPU or GPU device.
+
+* ``preserve_memory``: This flag will call ``torch.cuda.empty_cache()`` at certain critical sections when computing the Joint tensor. While this operation might allow us to preserve some memory, the empty_cache() operation is tremendously slow and will slow down training by an order of magnitude or more. It is available to use but not recommended.
+
+* ``fuse_loss_wer``: This flag performs "batch splitting" and then "fused loss + metric" calculation. It will be discussed in detail in the next tutorial that will train a Transducer model.
+
+* ``fused_batch_size``: When the above flag is set to True, the model will have two distinct "batch sizes". The batch size provided in the three data loader configs (``model.*_ds.batch_size``) will now be the ``Acoustic model`` batch size, whereas the ``fused_batch_size`` will be the batch size of the ``Prediction model``, the ``Joint model``, the ``transducer loss`` module and the ``decoding`` module.
+
+* ``jointnet.joint_hidden``: The hidden intermediate dimension of the joint network.
+
+.. code-block:: yaml
+
+ joint:
+ _target_: nemo.collections.asr.modules.RNNTJoint
+ log_softmax: null # sets it according to cpu/gpu device
+
+ # fused mode
+ fuse_loss_wer: false
+ fused_batch_size: 16
+
+ jointnet:
+ joint_hidden: ${model.model_defaults.joint_hidden}
+ activation: "relu"
+ dropout: 0.0
+
+Sampled Softmax Joint Model
+^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+There are some situations where a large vocabulary with a Transducer model - such as for multilingual models with a large
+number of languages. In this setting, we need to consider the cost of memory of training Transducer networks which does
+not allow large vocabulary.
+
+For such cases, one can instead utilize the ``SampledRNNTJoint`` module instead of the usual ``RNNTJoint`` module, in order
+to compute the loss using a sampled subset of the vocabulary rather than the full vocabulary file.
+
+It adds only one additional parameter :
+
+* ``n_samples``: Specifies the minimum number of tokens to sample from the vocabulary space,
+ excluding the RNNT blank token. If a given value is larger than the entire vocabulary size,
+ then the full vocabulary will be used.
+
+The only difference in config required is to replace ``nemo.collections.asr.modules.RNNTJoint`` with ``nemo.collections.asr.modules.SampledRNNTJoint``
+
+.. code-block:: yaml
+
+ joint:
+ _target_: nemo.collections.asr.modules.SampledRNNTJoint
+ n_samples: 500
+ ... # All other arguments from RNNTJoint can be used after this.
+
+
+Effect of Batch Splitting / Fused Batch step
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+The following information below explain why memory is an issue when training Transducer models and how NeMo tackles the issue with its Fused Batch step. The material can be read for a thorough understanding, otherwise, it can be skipped. You can also follow these steps in the "ASR_with_Transducers" tutorial.
+
+**Diving deeper into the memory costs of Transducer Joint**
+
+One of the significant limitations of Transducers is the exorbitant memory cost of computing the Joint module. The Joint module is comprised of two steps.
+
+1) Projecting the Acoustic and Transcription feature dimensions to some standard hidden dimension (specified by model.model_defaults.joint_hidden)
+
+2) Projecting this intermediate hidden dimension to the final vocabulary space to obtain the transcription.
+
+Take the following example.
+
+BS=32 ; T (after 2x stride) = 800, U (with character encoding) = 400-450 tokens, Vocabulary size V = 28 (26 alphabet chars, space and apostrophe). Let the hidden dimension of the Joint model be 640 (Most Google Transducer papers use hidden dimension of 640).
+
+* :math:`Memory \, (Hidden, \, gb) = 32 \times 800 \times 450 \times 640 \times 4 = 29.49` gigabytes (4 bytes per float).
+
+* :math:`Memory \, (Joint, \, gb) = 32 \times 800 \times 450 \times 28 \times 4 = 1.290` gigabytes (4 bytes per float)
+
+**NOTE**: This is just for the forward pass! We need to double this memory to store gradients! This much memory is also just for the Joint model **alone**. Far more memory is required for the Prediction model as well as the large Acoustic model itself and its gradients!
+
+Even with mixed precision, that's $\sim 30$ GB of GPU RAM for just 1 part of the network + its gradients.
+
+Effect of Fused Batch Step
+^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+The fundamental problem is that the joint tensor grows in size when ``[T x U]`` grows in size. This growth in memory cost is due to many reasons - either by model construction (downsampling) or the choice of dataset preprocessing (character tokenization vs. sub-word tokenization).
+
+Another dimension that NeMo can control is **batch**. Due to how we batch our samples, small and large samples all get clumped together into a single batch. So even though the individual samples are not all as long as the maximum length of T and U in that batch, when a batch of such samples is constructed, it will consume a significant amount of memory for the sake of compute efficiency.
+
+So as is always the case - **trade-off compute speed for memory savings**.
+
+The fused operation goes as follows :
+
+1) Forward the entire acoustic model in a single pass. (Use global batch size here for acoustic model - found in ``model.*_ds.batch_size``)
+
+2) Split the Acoustic Model's logits by ``fused_batch_size`` and loop over these sub-batches.
+
+3) Construct a sub-batch of same ``fused_batch_size`` for the Prediction model. Now the target sequence length is :math:`U_{sub-batch} < U`.
+
+4) Feed this :math:`U_{sub-batch}` into the Joint model, along with a sub-batch from the Acoustic model (with :math:`T_{sub-batch} < T)`. Remember, we only have to slice off a part of the acoustic model here since we have the full batch of samples :math:`(B, T, D)` from the acoustic model.
+
+5) Performing steps (3) and (4) yields :math:`T_{sub-batch}` and :math:`U_{sub-batch}`. Perform sub-batch joint step - costing an intermediate :math:`(B, T_{sub-batch}, U_{sub-batch}, V)` in memory.
+
+6) Compute loss on sub-batch and preserve in a list to be later concatenated.
+
+7) Compute sub-batch metrics (such as Character / Word Error Rate) using the above Joint tensor and sub-batch of ground truth labels. Preserve the scores to be averaged across the entire batch later.
+
+8) Delete the sub-batch joint matrix :math:`(B, T_{sub-batch}, U_{sub-batch}, V)`. Only gradients from .backward() are preserved now in the computation graph.
+
+9) Repeat steps (3) - (8) until all sub-batches are consumed.
+
+10) Cleanup step. Compute full batch WER and log. Concatenate loss list and pass to PTL to compute the equivalent of the original (full batch) Joint step. Delete ancillary objects necessary for sub-batching.
+
+Transducer Decoding
+~~~~~~~~~~~~~~~~~~~
+
+Models which have been trained with CTC can transcribe text simply by performing a regular argmax over the output of their decoder. For transducer-based models, the three networks must operate in a synchronized manner in order to transcribe the acoustic features. The base config for the Transducer decoding step can be found in the the ``decoding`` section of `ContextNet <./models.html#ContextNet>`__ or other Transducer architectures. For further information refer to the ``Intro to Transducers`` tutorial in the ASR tutorial section.
+
+**This config can be copy-pasted into any custom transducer model with no modification.**
+
+The most important component at the top level is the ``strategy``. It can take one of many values:
+
+* ``greedy``: This is sample-level greedy decoding. It is generally exceptionally slow as each sample in the batch will be decoded independently. For publications, this should be used alongside batch size of 1 for exact results.
+
+* ``greedy_batch``: This is the general default and should nearly match the ``greedy`` decoding scores (if the acoustic features are not affected by feature mixing in batch mode). Even for small batch sizes, this strategy is significantly faster than ``greedy``.
+
+* ``beam``: Runs beam search with the implicit language model of the Prediction model. It will generally be quite slow, and might need some tuning of the beam size to get better transcriptions.
+
+* ``tsd``: Time synchronous decoding. Please refer to the paper: `Alignment-Length Synchronous Decoding for RNN Transducer `_ for details on the algorithm implemented. Time synchronous decoding (TSD) execution time grows by the factor T * max_symmetric_expansions. For longer sequences, T is greater and can therefore take a long time for beams to obtain good results. TSD also requires more memory to execute.
+
+* ``alsd``: Alignment-length synchronous decoding. Please refer to the paper: `Alignment-Length Synchronous Decoding for RNN Transducer `_ for details on the algorithm implemented. Alignment-length synchronous decoding (ALSD) execution time is faster than TSD, with a growth factor of T + U_max, where U_max is the maximum target length expected during execution. Generally, T + U_max < T * max_symmetric_expansions. However, ALSD beams are non-unique. Therefore it is required to use larger beam sizes to achieve the same (or close to the same) decoding accuracy as TSD. For a given decoding accuracy, it is possible to attain faster decoding via ALSD than TSD.
+
+* ``maes``: Modified Adaptive Expansion Search Decoding. Please refer to the paper `Accelerating RNN Transducer Inference via Adaptive Expansion Search `_. Modified Adaptive Synchronous Decoding (mAES) execution time is adaptive w.r.t the number of expansions (for tokens) required per timestep. The number of expansions can usually be constrained to 1 or 2, and in most cases 2 is sufficient. This beam search technique can possibly obtain superior WER while sacrificing some evaluation time.
+
+.. code-block:: yaml
+
+ decoding:
+ strategy: "greedy_batch"
+
+ # preserve decoding alignments
+ preserve_alignments: false
+
+ # Overrides the fused batch size after training.
+ # Setting it to -1 will process whole batch at once when combined with `greedy_batch` decoding strategy
+ fused_batch_size: Optional[int] = -1
+
+ # greedy strategy config
+ greedy:
+ max_symbols: 10
+
+ # beam strategy config
+ beam:
+ beam_size: 2
+ score_norm: true
+ softmax_temperature: 1.0 # scale the logits by some temperature prior to softmax
+ tsd_max_sym_exp: 10 # for Time Synchronous Decoding, int > 0
+ alsd_max_target_len: 5.0 # for Alignment-Length Synchronous Decoding, float > 1.0
+ maes_num_steps: 2 # for modified Adaptive Expansion Search, int > 0
+ maes_prefix_alpha: 1 # for modified Adaptive Expansion Search, int > 0
+ maes_expansion_beta: 2 # for modified Adaptive Expansion Search, int >= 0
+ maes_expansion_gamma: 2.3 # for modified Adaptive Expansion Search, float >= 0
+
+Transducer Loss
+~~~~~~~~~~~~~~~
+
+This section configures the type of Transducer loss itself, along with possible sub-sections. By default, an optimized implementation of Transducer loss will be used which depends on Numba for CUDA acceleration. The base config for the Transducer loss section can be found in the the ``loss`` section of `ContextNet <./models.html#ContextNet>`__ or other Transducer architectures. For further information refer to the ``Intro to Transducers`` tutorial in the ASR tutorial section.
+
+**This config can be copy-pasted into any custom transducer model with no modification.**
+
+The loss config is based on a resolver pattern and can be used as follows:
+
+1) ``loss_name``: ``default`` is generally a good option. Will select one of the available resolved losses and match the kwargs from a sub-configs passed via explicit ``{loss_name}_kwargs`` sub-config.
+
+2) ``{loss_name}_kwargs``: This sub-config is passed to the resolved loss above and can be used to configure the resolved loss.
+
+
+.. code-block:: yaml
+
+ loss:
+ loss_name: "default"
+ warprnnt_numba_kwargs:
+ fastemit_lambda: 0.0
+
+FastEmit Regularization
+^^^^^^^^^^^^^^^^^^^^^^^
+
+FastEmit Regularization is supported for the default Numba based WarpRNNT loss. Recently proposed regularization approach - `FastEmit: Low-latency Streaming ASR with Sequence-level Emission Regularization `_ allows us near-direct control over the latency of transducer models.
+
+Refer to the above paper for results and recommendations of ``fastemit_lambda``.
+
+
+Fine-tuning Configurations
+--------------------------
+
+All ASR scripts support easy fine-tuning by partially/fully loading the pretrained weights from a checkpoint into the **currently instantiated model**. Note that the currently instantiated model should have parameters that match the pre-trained checkpoint (such that weights may load properly). In order to directly fine-tune a pre-existing checkpoint, please follow the tutorial `ASR Language Fine-tuning. `_
+
+Pre-trained weights can be provided in multiple ways -
+
+1) Providing a path to a NeMo model (via ``init_from_nemo_model``)
+2) Providing a name of a pretrained NeMo model (which will be downloaded via the cloud) (via ``init_from_pretrained_model``)
+3) Providing a path to a Pytorch Lightning checkpoint file (via ``init_from_ptl_ckpt``)
+
+There are multiple ASR subtasks inside the ``examples/asr/`` directory, you can substitute the ```` tag below.
+
+Fine-tuning via a NeMo model
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+.. code-block:: sh
+
+ python examples/asr//script_to_.py \
+ --config-path= \
+ --config-name=) \
+ model.train_ds.manifest_filepath="" \
+ model.validation_ds.manifest_filepath="" \
+ trainer.devices=-1 \
+ trainer.accelerator='gpu' \
+ trainer.max_epochs=50 \
+ +init_from_nemo_model=""
+
+
+Fine-tuning via a NeMo pretrained model name
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+.. code-block:: sh
+
+ python examples/asr//script_to_.py \
+ --config-path= \
+ --config-name=) \
+ model.train_ds.manifest_filepath="" \
+ model.validation_ds.manifest_filepath="" \
+ trainer.devices=-1 \
+ trainer.accelerator='gpu' \
+ trainer.max_epochs=50 \
+ +init_from_pretrained_model=""
+
+Fine-tuning via a Pytorch Lightning checkpoint
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+.. code-block:: sh
+
+ python examples/asr//script_to_.py \
+ --config-path= \
+ --config-name=) \
+ model.train_ds.manifest_filepath="" \
+ model.validation_ds.manifest_filepath="" \
+ trainer.devices=-1 \
+ trainer.accelerator='gpu' \
+ trainer.max_epochs=50 \
+ +init_from_ptl_ckpt=""
+
+Fine-tuning Execution Flow Diagram
+----------------------------------
+
+When preparing your own training or fine-tuning scripts, please follow the execution flow diagram order for correct inference.
+
+Depending on the type of model, there may be extra steps that must be performed -
+
+* CTC Models - `Examples directory for CTC Models `_
+* RNN Transducer Models - `Examples directory for Transducer Models `_
diff --git a/docs/source/asr/data/asrlm_results.csv b/docs/source/asr/data/asrlm_results.csv
new file mode 100644
index 0000000000000000000000000000000000000000..d9a395cb8b75ffc59300341feeeba2c8be2aa5fa
--- /dev/null
+++ b/docs/source/asr/data/asrlm_results.csv
@@ -0,0 +1,2 @@
+Model Name,Model Base Class,Model Card
+asrlm_en_transformer_large_ls,TransformerLMModel,"https://ngc.nvidia.com/catalog/models/nvidia:nemo:asrlm_en_transformer_large_ls"
diff --git a/docs/source/asr/data/benchmark_ca.csv b/docs/source/asr/data/benchmark_ca.csv
new file mode 100644
index 0000000000000000000000000000000000000000..bd7e174b922faaf7e099ad843ede10cda6b46b8c
--- /dev/null
+++ b/docs/source/asr/data/benchmark_ca.csv
@@ -0,0 +1,4 @@
+Model,Model Base Class,Model Card
+stt_ca_quartznet15x5,EncDecCTCModel,"https://ngc.nvidia.com/catalog/models/nvidia:nemo:stt_ca_quartznet15x5"
+stt_ca_conformer_ctc_large,EncDecCTCModel,"https://ngc.nvidia.com/catalog/models/nvidia:nemo:stt_ca_conformer_ctc_large"
+stt_ca_conformer_transducer_large,EncDecRNNTBPEModel,"https://ngc.nvidia.com/catalog/models/nvidia:nemo:stt_ca_conformer_transducer_large"
\ No newline at end of file
diff --git a/docs/source/asr/data/benchmark_de.csv b/docs/source/asr/data/benchmark_de.csv
new file mode 100644
index 0000000000000000000000000000000000000000..99e221a6b835517eed8023592af27c91afef70b2
--- /dev/null
+++ b/docs/source/asr/data/benchmark_de.csv
@@ -0,0 +1,6 @@
+Model,Model Base Class,Model Card
+stt_de_quartznet15x5,EncDecCTCModel,"https://ngc.nvidia.com/catalog/models/nvidia:nemo:stt_de_quartznet15x5"
+stt_de_citrinet_1024,EncDecCTCModel,"https://ngc.nvidia.com/catalog/models/nvidia:nemo:stt_de_citrinet_1024"
+stt_de_contextnet_1024,EncDecRNNTBPEModel,"https://ngc.nvidia.com/catalog/models/nvidia:nemo:stt_de_contextnet_1024"
+stt_de_conformer_ctc_large,EncDecCTCModelBPE,"https://ngc.nvidia.com/catalog/models/nvidia:nemo:stt_de_conformer_ctc_large"
+stt_de_conformer_transducer_large,EncDecRNNTBPEModel,"https://ngc.nvidia.com/catalog/models/nvidia:nemo:stt_de_conformer_transducer_large"
diff --git a/docs/source/asr/data/benchmark_en.csv b/docs/source/asr/data/benchmark_en.csv
new file mode 100644
index 0000000000000000000000000000000000000000..0f03452d034ddebff39b98dfbe1302d9ce71b64a
--- /dev/null
+++ b/docs/source/asr/data/benchmark_en.csv
@@ -0,0 +1,28 @@
+Model Name,Model Base Class,Model Card
+QuartzNet15x5Base-En,EncDecCTCModel,"https://ngc.nvidia.com/catalog/models/nvidia:nemospeechmodels"
+stt_en_jasper10x5dr,EncDecCTCModel,"https://ngc.nvidia.com/catalog/models/nvidia:nemo:stt_en_jasper10x5dr"
+stt_en_citrinet_256,EncDecCTCModelBPE,"https://ngc.nvidia.com/catalog/models/nvidia:nemo:stt_en_citrinet_256"
+stt_en_citrinet_512,EncDecCTCModelBPE,"https://ngc.nvidia.com/catalog/models/nvidia:nemo:stt_en_citrinet_512"
+stt_en_citrinet_1024,EncDecCTCModelBPE,"https://ngc.nvidia.com/catalog/models/nvidia:nemo:stt_en_citrinet_1024"
+stt_en_citrinet_256_gamma_0_25,EncDecCTCModelBPE,"https://ngc.nvidia.com/catalog/models/nvidia:nemo:stt_en_citrinet_256_gamma_0_25"
+stt_en_citrinet_512_gamma_0_25,EncDecCTCModelBPE,"https://ngc.nvidia.com/catalog/models/nvidia:nemo:stt_en_citrinet_512_gamma_0_25"
+stt_en_citrinet_1024_gamma_0_25,EncDecCTCModelBPE,"https://ngc.nvidia.com/catalog/models/nvidia:nemo:stt_en_citrinet_1024_gamma_0_25"
+stt_en_contextnet_256_mls,EncDecRNNTBPEModel,"https://ngc.nvidia.com/catalog/models/nvidia:nemo:stt_en_contextnet_256_mls"
+stt_en_contextnet_512_mls,EncDecRNNTBPEModel,"https://ngc.nvidia.com/catalog/models/nvidia:nemo:stt_en_contextnet_512_mls"
+stt_en_contextnet_1024_mls,EncDecRNNTBPEModel,"https://ngc.nvidia.com/catalog/models/nvidia:nemo:stt_en_contextnet_1024_mls"
+stt_en_contextnet_256,EncDecRNNTBPEModel,"https://ngc.nvidia.com/catalog/models/nvidia:nemo:stt_en_contextnet_256"
+stt_en_contextnet_512,EncDecRNNTBPEModel,"https://ngc.nvidia.com/catalog/models/nvidia:nemo:stt_en_contextnet_512"
+stt_en_contextnet_1024,EncDecRNNTBPEModel,"https://ngc.nvidia.com/catalog/models/nvidia:nemo:stt_en_contextnet_1024"
+stt_en_conformer_ctc_small,EncDecCTCModelBPE,"https://ngc.nvidia.com/catalog/models/nvidia:nemo:stt_en_conformer_ctc_small"
+stt_en_conformer_ctc_medium,EncDecCTCModelBPE,"https://ngc.nvidia.com/catalog/models/nvidia:nemo:stt_en_conformer_ctc_medium"
+stt_en_conformer_ctc_large,EncDecCTCModelBPE,"https://ngc.nvidia.com/catalog/models/nvidia:nemo:stt_en_conformer_ctc_large"
+stt_en_conformer_ctc_xlarge,EncDecCTCModelBPE,"https://ngc.nvidia.com/catalog/models/nvidia:nemo:stt_en_conformer_ctc_xlarge"
+stt_en_conformer_ctc_small_ls,EncDecCTCModelBPE,"https://ngc.nvidia.com/catalog/models/nvidia:nemo:stt_en_conformer_ctc_small_ls"
+stt_en_conformer_ctc_medium_ls,EncDecCTCModelBPE,"https://ngc.nvidia.com/catalog/models/nvidia:nemo:stt_en_conformer_ctc_medium_ls"
+stt_en_conformer_ctc_large_ls,EncDecCTCModelBPE,"https://ngc.nvidia.com/catalog/models/nvidia:nemo:stt_en_conformer_ctc_large_ls"
+stt_en_conformer_transducer_large_ls,EncDecRNNTBPEModel,"https://ngc.nvidia.com/catalog/models/nvidia:nemo:stt_en_conformer_transducer_large_ls"
+stt_en_conformer_transducer_small,EncDecRNNTBPEModel,"https://ngc.nvidia.com/catalog/models/nvidia:nemo:stt_en_conformer_transducer_small"
+stt_en_conformer_transducer_medium,EncDecRNNTBPEModel,"https://ngc.nvidia.com/catalog/models/nvidia:nemo:stt_en_conformer_transducer_medium"
+stt_en_conformer_transducer_large,EncDecRNNTBPEModel,"https://ngc.nvidia.com/catalog/models/nvidia:nemo:stt_en_conformer_transducer_large"
+stt_en_conformer_transducer_xlarge,EncDecRNNTBPEModel,"https://ngc.nvidia.com/catalog/models/nvidia:nemo:stt_en_conformer_transducer_xlarge"
+stt_en_conformer_transducer_xxlarge,EncDecRNNTBPEModel,"https://ngc.nvidia.com/catalog/models/nvidia:nemo:stt_en_conformer_transducer_xxlarge"
\ No newline at end of file
diff --git a/docs/source/asr/data/benchmark_es.csv b/docs/source/asr/data/benchmark_es.csv
new file mode 100644
index 0000000000000000000000000000000000000000..1e1ade3a739c4d6e9d1c14b493845ae8f29e3aa0
--- /dev/null
+++ b/docs/source/asr/data/benchmark_es.csv
@@ -0,0 +1,7 @@
+Model,Model Base Class,Model Card
+stt_es_quartznet15x5,EncDecCTCModel,"https://ngc.nvidia.com/catalog/models/nvidia:nemo:stt_es_quartznet15x5"
+stt_es_citrinet_512,EncDecCTCModelBPE,"https://ngc.nvidia.com/catalog/models/nvidia:nemo:stt_es_citrinet_512"
+stt_es_citrinet_1024_gamma_0_25,EncDecCTCModelBPE,"https://ngc.nvidia.com/catalog/models/nvidia:nemo:stt_es_citrinet_1024_gamma_0_25"
+stt_es_conformer_ctc_large,EncDecCTCModelBPE,"https://ngc.nvidia.com/catalog/models/nvidia:nemo:stt_es_conformer_ctc_large"
+stt_es_conformer_transducer_large,EncDecRNNTBPEModel,"https://ngc.nvidia.com/catalog/models/nvidia:nemo:stt_es_conformer_transducer_large"
+stt_es_contextnet_1024,EncDecRNNTBPEModel,"https://ngc.nvidia.com/catalog/models/nvidia:nemo:stt_es_contextnet_1024"
\ No newline at end of file
diff --git a/docs/source/asr/data/benchmark_fr.csv b/docs/source/asr/data/benchmark_fr.csv
new file mode 100644
index 0000000000000000000000000000000000000000..2f27a0ab200959959bf389bb72074dd946f34a7f
--- /dev/null
+++ b/docs/source/asr/data/benchmark_fr.csv
@@ -0,0 +1,8 @@
+Model,Model Base Class,Model Card
+stt_fr_quartznet15x5,EncDecCTCModel,"https://ngc.nvidia.com/catalog/models/nvidia:nemo:stt_fr_quartznet15x5"
+stt_fr_citrinet_1024_gamma_0_25,EncDecCTCModelBPE,"https://ngc.nvidia.com/catalog/models/nvidia:nemo:stt_fr_citrinet_1024_gamma_0_25"
+stt_fr_no_hyphen_citrinet_1024_gamma_0_25,EncDecCTCModelBPE,"https://ngc.nvidia.com/catalog/models/nvidia:nemo:stt_fr_citrinet_1024_gamma_0_25"
+stt_fr_contextnet_1024,EncDecRNNTBPEModel,"https://ngc.nvidia.com/catalog/models/nvidia:nemo:stt_fr_contextnet_1024"
+stt_fr_conformer_ctc_large,EncDecCTCModelBPE,"https://ngc.nvidia.com/catalog/models/nvidia:nemo:stt_fr_conformer_ctc_large"
+stt_fr_no_hyphen_conformer_ctc_large,EncDecCTCModelBPE,"https://ngc.nvidia.com/catalog/models/nvidia:nemo:stt_fr_conformer_ctc_large"
+stt_fr_conformer_transducer_large,EncDecRNNTBPEModel,"https://ngc.nvidia.com/catalog/models/nvidia:nemo:stt_fr_conformer_transducer_large"
\ No newline at end of file
diff --git a/docs/source/asr/data/benchmark_hi.csv b/docs/source/asr/data/benchmark_hi.csv
new file mode 100644
index 0000000000000000000000000000000000000000..4d3df532ed2e253f74d0e7a0c66f5ae0381bb75e
--- /dev/null
+++ b/docs/source/asr/data/benchmark_hi.csv
@@ -0,0 +1,2 @@
+Model Name,Model Base Class,Model Card
+stt_hi_conformer_ctc_medium,EncDecCTCModelBPE,"https://catalog.ngc.nvidia.com/orgs/nvidia/teams/nemo/models/stt_hi_conformer_ctc_medium"
diff --git a/docs/source/asr/data/benchmark_hr.csv b/docs/source/asr/data/benchmark_hr.csv
new file mode 100644
index 0000000000000000000000000000000000000000..ea506eed34324bee914e70145fdd0a82fda7ca75
--- /dev/null
+++ b/docs/source/asr/data/benchmark_hr.csv
@@ -0,0 +1,3 @@
+Model,Model Base Class,Model Card
+stt_hr_conformer_ctc_large,EncDecCTCModel,"https://ngc.nvidia.com/catalog/models/nvidia:nemo:stt_hr_conformer_ctc_large"
+stt_hr_conformer_transducer_large,EncDecRNNTBPEModel,"https://ngc.nvidia.com/catalog/models/nvidia:nemo:stt_hr_conformer_transducer_large"
diff --git a/docs/source/asr/data/benchmark_it.csv b/docs/source/asr/data/benchmark_it.csv
new file mode 100644
index 0000000000000000000000000000000000000000..d605b68809eb6481c576340a0f5be843b0c504a4
--- /dev/null
+++ b/docs/source/asr/data/benchmark_it.csv
@@ -0,0 +1,3 @@
+Model,Model Base Class,Model Card
+stt_it_quartznet15x5,EncDecCTCModel,"https://ngc.nvidia.com/catalog/models/nvidia:nemo:stt_it_quartznet15x5"
+
diff --git a/docs/source/asr/data/benchmark_kab.csv b/docs/source/asr/data/benchmark_kab.csv
new file mode 100644
index 0000000000000000000000000000000000000000..76a54cfe42de4de29f8d702b50262abc546b193a
--- /dev/null
+++ b/docs/source/asr/data/benchmark_kab.csv
@@ -0,0 +1,2 @@
+Model,Model Base Class,Model Card
+stt_kab_conformer_transducer_large,EncDecRNNTBPEModel,"https://ngc.nvidia.com/catalog/models/nvidia:nemo:stt_kab_conformer_transducer_large"
diff --git a/docs/source/asr/data/benchmark_mr.csv b/docs/source/asr/data/benchmark_mr.csv
new file mode 100644
index 0000000000000000000000000000000000000000..00ae7211bd75729b5305deca275e26c140896e0c
--- /dev/null
+++ b/docs/source/asr/data/benchmark_mr.csv
@@ -0,0 +1,3 @@
+Model Name,Model Base Class,Model Card
+stt_mr_conformer_ctc_medium,EncDecCTCModelBPE,"https://catalog.ngc.nvidia.com/orgs/nvidia/teams/nemo/models/stt_mr_conformer_ctc_medium"
+
diff --git a/docs/source/asr/data/benchmark_pl.csv b/docs/source/asr/data/benchmark_pl.csv
new file mode 100644
index 0000000000000000000000000000000000000000..bf646e107306ab01498d09ea842742662ee5cc47
--- /dev/null
+++ b/docs/source/asr/data/benchmark_pl.csv
@@ -0,0 +1,2 @@
+Model,Model Base Class,Model Card
+stt_pl_quartznet15x5,EncDecCTCModel,"https://ngc.nvidia.com/catalog/models/nvidia:nemo:stt_pl_quartznet15x5"
diff --git a/docs/source/asr/data/benchmark_ru.csv b/docs/source/asr/data/benchmark_ru.csv
new file mode 100644
index 0000000000000000000000000000000000000000..b46d4d9ca65cb5521fcd192494f58fe56689973c
--- /dev/null
+++ b/docs/source/asr/data/benchmark_ru.csv
@@ -0,0 +1,3 @@
+Model,Model Base Class,Model Card
+stt_ru_quartznet15x5,EncDecCTCModel,"https://ngc.nvidia.com/catalog/models/nvidia:nemo:stt_ru_quartznet15x5"
+
diff --git a/docs/source/asr/data/benchmark_rw.csv b/docs/source/asr/data/benchmark_rw.csv
new file mode 100644
index 0000000000000000000000000000000000000000..0264fc8a70cdc40ba96ce38701c7e837ee773f4f
--- /dev/null
+++ b/docs/source/asr/data/benchmark_rw.csv
@@ -0,0 +1,3 @@
+Model,Model Base Class,Model Card
+stt_rw_conformer_ctc_large,EncDecCTCModel,"https://ngc.nvidia.com/catalog/models/nvidia:nemo:stt_rw_conformer_ctc_large"
+stt_rw_conformer_transducer_large,EncDecRNNTBPEModel,"https://ngc.nvidia.com/catalog/models/nvidia:nemo:stt_rw_conformer_transducer_large"
\ No newline at end of file
diff --git a/docs/source/asr/data/benchmark_zh.csv b/docs/source/asr/data/benchmark_zh.csv
new file mode 100644
index 0000000000000000000000000000000000000000..3d98f2fa4cec36cc1652fe2a18e4032dd0e377eb
--- /dev/null
+++ b/docs/source/asr/data/benchmark_zh.csv
@@ -0,0 +1,4 @@
+Model,Model Base Class,Model Card
+stt_zh_citrinet_512,EncDecCTCModel,"https://ngc.nvidia.com/catalog/models/nvidia:nemo:stt_zh_citrinet_512"
+stt_zh_citrinet_1024_gamma_0_25,EncDecCTCModel,"https://ngc.nvidia.com/catalog/models/nvidia:nemo:stt_zh_citrinet_1024_gamma_0_25"
+stt_zh_conformer_transducer_large,EncDecRNNTModel,"https://ngc.nvidia.com/catalog/models/nvidia:nemo:stt_zh_conformer_transducer_large"
diff --git a/docs/source/asr/data/scores/be/conformer_be.csv b/docs/source/asr/data/scores/be/conformer_be.csv
new file mode 100644
index 0000000000000000000000000000000000000000..12fcfe0e554bced7865e409b5ad57e6557441425
--- /dev/null
+++ b/docs/source/asr/data/scores/be/conformer_be.csv
@@ -0,0 +1,3 @@
+Model Name,Language,MCV Test-Set v10 (be)
+stt_be_conformer_ctc_large,be,4.7 %
+stt_be_conformer_transducer_large,be,3.8 %
diff --git a/docs/source/asr/data/scores/ca/conformer_ca.csv b/docs/source/asr/data/scores/ca/conformer_ca.csv
new file mode 100644
index 0000000000000000000000000000000000000000..bc30b90a25b4f9dcf1d782fe2e4b44484b265b2c
--- /dev/null
+++ b/docs/source/asr/data/scores/ca/conformer_ca.csv
@@ -0,0 +1,3 @@
+Model Name,Language,MCV Dev-Set (v??) (ca),MCV Dev-Set v9.0 (ca),MCV Test-Set v9.0 (ca)
+stt_ca_conformer_ctc_large,ca,,4.70,4.27
+stt_ca_conformer_transducer_large,ca,,4.43,3.85
diff --git a/docs/source/asr/data/scores/ca/quartznet15x5_ca.csv b/docs/source/asr/data/scores/ca/quartznet15x5_ca.csv
new file mode 100644
index 0000000000000000000000000000000000000000..6b826662e25ecdeeb1d68483f6f2260e0f9f38fd
--- /dev/null
+++ b/docs/source/asr/data/scores/ca/quartznet15x5_ca.csv
@@ -0,0 +1,2 @@
+Model Name,Language,MCV Dev-Set (v??) (ca),MCV Dev-Set v9.0 (ca),MCV Test-Set v9.0 (ca)
+stt_ca_quartznet15x5,ca,6.0,,
diff --git a/docs/source/asr/data/scores/de/citrinet_de.csv b/docs/source/asr/data/scores/de/citrinet_de.csv
new file mode 100644
index 0000000000000000000000000000000000000000..1b3e7db093a2ed9b010dd8fbb706a4ca268fdb64
--- /dev/null
+++ b/docs/source/asr/data/scores/de/citrinet_de.csv
@@ -0,0 +1,2 @@
+Model Name,Language,MCV Dev-Set (v??) (de),MCV Dev-Set v7.0 (de),MCV Test-Set v7.0 (de),MLS Dev (en),MLS Test (en),VoxPopuli Dev (de),VoxPopuli Test (de)
+stt_de_citrinet_1024,de,,6.63,7.59,4.06,5.07,12.33,10.02
diff --git a/docs/source/asr/data/scores/de/conformer_de.csv b/docs/source/asr/data/scores/de/conformer_de.csv
new file mode 100644
index 0000000000000000000000000000000000000000..3d0a9e18d452eda69c32971a60ceed589d6e3bcf
--- /dev/null
+++ b/docs/source/asr/data/scores/de/conformer_de.csv
@@ -0,0 +1,3 @@
+Model Name,Language,MCV Dev-Set (v??) (de),MCV Dev-Set v7.0 (de),MCV Test-Set v7.0 (de),MLS Dev (en),MLS Test (en),VoxPopuli Dev (de),VoxPopuli Test (de)
+stt_de_conformer_ctc_large,de,,5.84,6.68,3.85,4.63,12.56,10.51
+stt_de_conformer_transducer_large,de,,4.75,5.36,3.46,4.19,11.21,9.14
diff --git a/docs/source/asr/data/scores/de/contextnet_de.csv b/docs/source/asr/data/scores/de/contextnet_de.csv
new file mode 100644
index 0000000000000000000000000000000000000000..b7d52d649e73bb7aebf9a5a60191fd7f00404acb
--- /dev/null
+++ b/docs/source/asr/data/scores/de/contextnet_de.csv
@@ -0,0 +1,2 @@
+Model Name,Language,MCV Dev-Set (v??) (de),MCV Dev-Set v7.0 (de),MCV Test-Set v7.0 (de),MLS Dev (en),MLS Test (en),VoxPopuli Dev (de),VoxPopuli Test (de)
+stt_de_contextnet_1024,de,,4.76,5.5,3.53,4.2,11.32,9.4
diff --git a/docs/source/asr/data/scores/de/quartznet15x5_de.csv b/docs/source/asr/data/scores/de/quartznet15x5_de.csv
new file mode 100644
index 0000000000000000000000000000000000000000..17540903f41e6b5f922a5909b935da9a05be5314
--- /dev/null
+++ b/docs/source/asr/data/scores/de/quartznet15x5_de.csv
@@ -0,0 +1,2 @@
+Model Name,Language,MCV Dev-Set (v??) (de),MCV Dev-Set v7.0 (de),MCV Test-Set v7.0 (de),MLS Dev (en),MLS Test (en),VoxPopuli Dev (de),VoxPopuli Test (de)
+stt_de_quartznet15x5,de,11.78,,,,,,
diff --git a/docs/source/asr/data/scores/en/citrinet_en.csv b/docs/source/asr/data/scores/en/citrinet_en.csv
new file mode 100644
index 0000000000000000000000000000000000000000..42d8cff2cb9b199c705adfa56ba917bad10ea5ac
--- /dev/null
+++ b/docs/source/asr/data/scores/en/citrinet_en.csv
@@ -0,0 +1,7 @@
+Model Name,Language,Librispeech Dev-Clean,Librispeech Dev-Other,Librispeech Test-Clean,Librispeech Test-Other,MCV Test-Set v8.0 (en),MLS Dev (en),MLS Test (en),NSC Part1,NSC Part6,Peoples Speech Test v1,SLR 83 Test,WSJ Dev 93,WSJ Eval 92
+stt_en_citrinet_256,en,4.2 % WER,10.7 % WER,4.4 % WER,10.7 % WER,,,,,,,,,
+stt_en_citrinet_512,en,3.7 % WER,8.9 % WER,3.7 % WER,8.9 % WER,,,,,,,,,
+stt_en_citrinet_1024,en,3.7 % WER,8.3 % WER,3.6 % WER,7.9 % WER,,,,,,,,,
+stt_en_citrinet_256_gamma_0_25,en,4.7 %,10.6 %,4.8 %,10.7 %,,,,8.3 %,,,,5.8 %,3.6 %
+stt_en_citrinet_512_gamma_0_25,en,4.0 %,9.0 %,3.9 %,9.0 %,,,,6.9 %,,,,4.4 %,3.6 %
+stt_en_citrinet_1024_gamma_0_25,en,3.4 %,7.7 %,3.4 %,7.6 %,,,,6.2 %,,,,4.0 %,2.5 %
diff --git a/docs/source/asr/data/scores/en/conformer_en.csv b/docs/source/asr/data/scores/en/conformer_en.csv
new file mode 100644
index 0000000000000000000000000000000000000000..23ec4438257837987ca1692ccf12954072ce9e17
--- /dev/null
+++ b/docs/source/asr/data/scores/en/conformer_en.csv
@@ -0,0 +1,14 @@
+Model Name,Language,Librispeech Dev-Clean,Librispeech Dev-Other,Librispeech Test-Clean,Librispeech Test-Other,MCV Test-Set v8.0 (en),MLS Dev (en),MLS Test (en),NSC Part1,NSC Part6,Peoples Speech Test v1,SLR 83 Test,WSJ Dev 93,WSJ Eval 92
+stt_en_conformer_ctc_small,en,3.6,8.1,3.7,8.1,,,,,,,,,
+stt_en_conformer_ctc_medium,en,2.5,5.8,2.6,5.9,,,,,,,,,
+stt_en_conformer_ctc_large,en,1.9,4.4,2.1,4.5,,,,,,,,,
+stt_en_conformer_ctc_xlarge,en,1.77 %,3.79 %,2.00 %,3.74 %,7.88 %,,5.99 %,,6.44 %,22.90 %,5.50 %,2.36 %,
+stt_en_conformer_ctc_small_ls,en,3.3,8.8,3.4,8.8,,,,,,,,,
+stt_en_conformer_ctc_medium_ls,en,2.7,7.4,3.0,7.3,,,,,,,,,
+stt_en_conformer_ctc_large_ls,en,2.4,6.2,2.7,6.0,,,,,,,,,
+stt_en_conformer_transducer_small,en,2.8,6.6,2.5,6.6,,,,,,,,,
+stt_en_conformer_transducer_medium,en,2.0,4.6,2.1,4.7,,,,,,,,,
+stt_en_conformer_transducer_large,en,1.6,3.5,1.7,3.7,,,,,,,,,
+stt_en_conformer_transducer_large_ls,en,2.1,5.0,2.3,5.1,,,,,,,,,
+stt_en_conformer_transducer_xlarge,en,1.48 %,2.95 %,1.62 %,3.01 %,6.46 %,4.59 %,5.32 %,5.70 %,6.47 %,21.32 %,,2.05 %,1.17 %
+stt_en_conformer_transducer_xxlarge,en,1.52 %,3.09 %,1.72 %,3.14 %,,5.29 %,5.85 %,6.64 %,,,,2.42 %,1.49 %
diff --git a/docs/source/asr/data/scores/en/contextnet_en.csv b/docs/source/asr/data/scores/en/contextnet_en.csv
new file mode 100644
index 0000000000000000000000000000000000000000..4a065dd299f8f7a232fde5e3b3d706e72b8ad64a
--- /dev/null
+++ b/docs/source/asr/data/scores/en/contextnet_en.csv
@@ -0,0 +1,7 @@
+Model Name,Language,Librispeech Dev-Clean,Librispeech Dev-Other,Librispeech Test-Clean,Librispeech Test-Other,MCV Test-Set v8.0 (en),MLS Dev (en),MLS Test (en),NSC Part1,NSC Part6,Peoples Speech Test v1,SLR 83 Test,WSJ Dev 93,WSJ Eval 92
+stt_en_contextnet_256,en,3.3 %,7.9 %,3.3 %,8.0 %,,9.7 %,11.0 %,7.1 %,,,,4.6 %,3.2 %
+stt_en_contextnet_512,en,2.0 %,4.8 %,2.2 %,5.0 %,,6.6 %,7.3 %,5.9 %,,,,2.8 %,1.4 %
+stt_en_contextnet_1024,en,1.7 %,3.8 %,1.9 %,4.0 %,7.9 %,,5.9 %,5.2 %,6.5 %,21.7 %,4.7 %,2.3 %,1.3 %
+stt_en_contextnet_256_mls,en,,9.0 %,,9.2 %,,9.4 %,10.9 %,,,,,,
+stt_en_contextnet_512_mls,en,,5.2 %,,5.2 %,,5.6 %,6.6 %,,,,,,
+stt_en_contextnet_1024_mls,en,,4.1 %,,4.2 %,,4.6 %,5.6 %,,,,,,
diff --git a/docs/source/asr/data/scores/en/jasper10x5dr_en.csv b/docs/source/asr/data/scores/en/jasper10x5dr_en.csv
new file mode 100644
index 0000000000000000000000000000000000000000..ac9b260c5bb34ce5ece0c4b02dc1359d0371c677
--- /dev/null
+++ b/docs/source/asr/data/scores/en/jasper10x5dr_en.csv
@@ -0,0 +1,2 @@
+Model Name,Language,Librispeech Dev-Clean,Librispeech Dev-Other,Librispeech Test-Clean,Librispeech Test-Other,MCV Test-Set v8.0 (en),MLS Dev (en),MLS Test (en),NSC Part1,NSC Part6,Peoples Speech Test v1,SLR 83 Test,WSJ Dev 93,WSJ Eval 92
+stt_en_jasper10x5dr,en,3.74,10.21,,,,,,,,,,,
diff --git a/docs/source/asr/data/scores/en/quartznet15x5_en.csv b/docs/source/asr/data/scores/en/quartznet15x5_en.csv
new file mode 100644
index 0000000000000000000000000000000000000000..04aef4aa49dd63e1a1f45d1b5ba0fd40372a5b74
--- /dev/null
+++ b/docs/source/asr/data/scores/en/quartznet15x5_en.csv
@@ -0,0 +1,2 @@
+Model Name,Language,Librispeech Dev-Clean,Librispeech Dev-Other,Librispeech Test-Clean,Librispeech Test-Other,MCV Test-Set v8.0 (en),MLS Dev (en),MLS Test (en),NSC Part1,NSC Part6,Peoples Speech Test v1,SLR 83 Test,WSJ Dev 93,WSJ Eval 92
+stt_en_quartznet15x5,en,4.38,11.3,,,,,,,,,,,
diff --git a/docs/source/asr/data/scores/en/squeezeformer_en.csv b/docs/source/asr/data/scores/en/squeezeformer_en.csv
new file mode 100644
index 0000000000000000000000000000000000000000..fdbd9bd99665c41235c1e60f9a0f8c4940b432a6
--- /dev/null
+++ b/docs/source/asr/data/scores/en/squeezeformer_en.csv
@@ -0,0 +1,7 @@
+Model Name,Language,Librispeech Dev-Clean,Librispeech Dev-Other,Librispeech Test-Clean,Librispeech Test-Other,MCV Test-Set v8.0 (en),MLS Dev (en),MLS Test (en),NSC Part1,NSC Part6,Peoples Speech Test v1,SLR 83 Test,WSJ Dev 93,WSJ Eval 92
+stt_en_squeezeformer_ctc_xsmall_ls,en,3.6 %,9.7 %,3.8 %,9.4 %,,,,,,,,,
+stt_en_squeezeformer_ctc_small_ls,en,2.9 %,7.4 %,3.1 %,7.4 %,,,,,,,,,
+stt_en_squeezeformer_ctc_small_medium_ls,en,2.7 %,7.0 %,2.8 %,7.1 %,,,,,,,,,
+stt_en_squeezeformer_ctc_medium_ls,en,2.4 %,6.2 %,2.6 %,6.3 %,,,,,,,,,
+stt_en_squeezeformer_ctc_medium_large_ls,en,2.3 %,6.0 %,2.5 %,5.9 %,,,,,,,,,
+stt_en_squeezeformer_ctc_large_ls,en,2.3 %,5.7 %,2.4 %,5.7 %,,,,,,,,,
diff --git a/docs/source/asr/data/scores/enes/conformer_enes.csv b/docs/source/asr/data/scores/enes/conformer_enes.csv
new file mode 100644
index 0000000000000000000000000000000000000000..983e664d4de1b60053cb43a039b0c4ceafe10a00
--- /dev/null
+++ b/docs/source/asr/data/scores/enes/conformer_enes.csv
@@ -0,0 +1,5 @@
+Model Name,Language,Fisher-Dev-En,Fisher-Dev-Es,Fisher-Test-En,Fisher-Test-Es,Librispeech Dev-Clean,Librispeech Dev-Other,Librispeech Test-Clean,Librispeech Test-Other,MCV Dev-Set v7.0 (en),MCV Dev-Set v7.0 (es),MCV Test-Set v7.0 (en),MCV Test-Set v7.0 (es),MLS Dev (en),MLS Dev (es),MLS Test (en),MLS Test (es),VoxPopuli Dev (en),VoxPopuli Dev (es),VoxPopuli Test (en),VoxPopuli Test (es)
+stt_enes_conformer_ctc_large,enes,,16.7 %,,,2.2 %,5.5 %,2.6 %,5.5 %,5.8 %,,,,,3.5 %,,,,5.7 %,,
+stt_enes_conformer_ctc_large_codesw,enes,,16.51 %,,16.31 %,2.22 %,5.36 %,2.55 %,5.38 %,,5.00 %,,5.51 %,,3.46 %,,3.73 %,,5.58 %,,6.63 %
+stt_enes_conformer_transducer_large,enes,,16.2 %,,,2.0 %,4.6 %,2.2 %,4.6 %,5.0 %,,,,,3.3 %,,,,5.3 %,,
+stt_enes_conformer_transducer_large_codesw,enes,15.70 %,,15.66 %,,1.97 %,4.54 %,2.17 %,4.53 %,4.51 %,,5.06 %,,3.27 %,,3.67 %,,5.28 %,,6.54 %,
diff --git a/docs/source/asr/data/scores/enes/contextnet_enes.csv b/docs/source/asr/data/scores/enes/contextnet_enes.csv
new file mode 100644
index 0000000000000000000000000000000000000000..72a895303bbbd8b43fd94d2f66a93753b28af9e5
--- /dev/null
+++ b/docs/source/asr/data/scores/enes/contextnet_enes.csv
@@ -0,0 +1,2 @@
+Model Name,Language,Fisher-Dev-En,Fisher-Dev-Es,Fisher-Test-En,Fisher-Test-Es,Librispeech Dev-Clean,Librispeech Dev-Other,Librispeech Test-Clean,Librispeech Test-Other,MCV Dev-Set v7.0 (en),MCV Dev-Set v7.0 (es),MCV Test-Set v7.0 (en),MCV Test-Set v7.0 (es),MLS Dev (en),MLS Dev (es),MLS Test (en),MLS Test (es),VoxPopuli Dev (en),VoxPopuli Dev (es),VoxPopuli Test (en),VoxPopuli Test (es)
+stt_enes_contextnet_large,enes,,14.8 %,,,2.2 %,5.6 %,2.3 %,5.5 %,4.7 %,,,,,3.0 %,,,,5.0 %,,
diff --git a/docs/source/asr/data/scores/eo/conformer_eo.csv b/docs/source/asr/data/scores/eo/conformer_eo.csv
new file mode 100644
index 0000000000000000000000000000000000000000..f77d4c0eadfcc5d7b954a06df2036cfbbcf50f3d
--- /dev/null
+++ b/docs/source/asr/data/scores/eo/conformer_eo.csv
@@ -0,0 +1,3 @@
+Model Name,Language,MCV Dev-Set v11.0 (eo),MCV Test-Set v11.0 (eo)
+stt_eo_conformer_ctc_large,eo,2.9 %,4.8 %
+stt_eo_conformer_transducer_large,eo,2.4 %,4.0 %
diff --git a/docs/source/asr/data/scores/es/citrinet_es.csv b/docs/source/asr/data/scores/es/citrinet_es.csv
new file mode 100644
index 0000000000000000000000000000000000000000..9311fb2b04fd18382ad0bd93e7f2ea5eeb34684b
--- /dev/null
+++ b/docs/source/asr/data/scores/es/citrinet_es.csv
@@ -0,0 +1,3 @@
+Model Name,Language,Call Home Dev Test (es),Call Home Eval Test (es),Call Home Train (es),Fisher Dev Set (es),Fisher Test Set (es),MCV Dev-Set (v??) (es),MCV Dev-Set v7.0 (es),MCV Test-Set (v??) (es),MCV Test-Set v7.0 (es),MLS Dev (en),MLS Test (en),VoxPopuli Dev (es),VoxPopuli Test (es)
+stt_es_citrinet_512,es,,,,,,9.1 % WER,,10.3 % WER,,4.9 % WER,5.2 % WER,,
+stt_es_citrinet_1024_gamma_0_25,es,19.9 %,21.3 %,19.1 %,15.8 %,15.9 %,,6.1 %,,6.8 %,3.5 %,4.1 %,5.6 %,7.0 %
diff --git a/docs/source/asr/data/scores/es/conformer_es.csv b/docs/source/asr/data/scores/es/conformer_es.csv
new file mode 100644
index 0000000000000000000000000000000000000000..10b28dc49f4efddb94c9be7b1e4d83031878b627
--- /dev/null
+++ b/docs/source/asr/data/scores/es/conformer_es.csv
@@ -0,0 +1,3 @@
+Model Name,Language,Call Home Dev Test (es),Call Home Eval Test (es),Call Home Train (es),Fisher Dev Set (es),Fisher Test Set (es),MCV Dev-Set (v??) (es),MCV Dev-Set v7.0 (es),MCV Test-Set (v??) (es),MCV Test-Set v7.0 (es),MLS Dev (en),MLS Test (en),VoxPopuli Dev (es),VoxPopuli Test (es)
+stt_es_conformer_ctc_large,es,23.7 %,25.3 %,22.4 %,18.3 %,18.5 %,,6.3 %,,6.9 %,4.3 %,4.2 %,6.1 %,7.5 %
+stt_es_conformer_transducer_large,es,18.0 %,19.4 %,17.2 %,14.7 %,14.8 %,,4.6 %,,5.2 %,2.7 %,3.2 %,4.7 %,6.0 %
diff --git a/docs/source/asr/data/scores/es/contextnet_es.csv b/docs/source/asr/data/scores/es/contextnet_es.csv
new file mode 100644
index 0000000000000000000000000000000000000000..ec20b5708d934b1377ffbda0537934f60cf0766e
--- /dev/null
+++ b/docs/source/asr/data/scores/es/contextnet_es.csv
@@ -0,0 +1,2 @@
+Model Name,Language,Call Home Dev Test (es),Call Home Eval Test (es),Call Home Train (es),Fisher Dev Set (es),Fisher Test Set (es),MCV Dev-Set (v??) (es),MCV Dev-Set v7.0 (es),MCV Test-Set (v??) (es),MCV Test-Set v7.0 (es),MLS Dev (en),MLS Test (en),VoxPopuli Dev (es),VoxPopuli Test (es)
+stt_es_contextnet_1024,es,19.1 %,20.7 %,18.2 %,15.3 %,15.1 %,,4.8 %,,5.2 %,3.1 %,3.5 %,5.1 %,6.2 %
diff --git a/docs/source/asr/data/scores/es/quartznet15x5_es.csv b/docs/source/asr/data/scores/es/quartznet15x5_es.csv
new file mode 100644
index 0000000000000000000000000000000000000000..79de5ce952d825f3c6580337ffaacf358267dd73
--- /dev/null
+++ b/docs/source/asr/data/scores/es/quartznet15x5_es.csv
@@ -0,0 +1,2 @@
+Model Name,Language,Call Home Dev Test (es),Call Home Eval Test (es),Call Home Train (es),Fisher Dev Set (es),Fisher Test Set (es),MCV Dev-Set (v??) (es),MCV Dev-Set v7.0 (es),MCV Test-Set (v??) (es),MCV Test-Set v7.0 (es),MLS Dev (en),MLS Test (en),VoxPopuli Dev (es),VoxPopuli Test (es)
+stt_es_quartznet15x5,es,,,,,,12.97,,,,,,,
diff --git a/docs/source/asr/data/scores/fr/citrinet_fr.csv b/docs/source/asr/data/scores/fr/citrinet_fr.csv
new file mode 100644
index 0000000000000000000000000000000000000000..651dcb8494400ac5053dff0280ed10ab88350abf
--- /dev/null
+++ b/docs/source/asr/data/scores/fr/citrinet_fr.csv
@@ -0,0 +1,2 @@
+Model Name,Language,MCV Dev-Set (v??) (fr),MCV Dev-Set v7.0 (fr),MCV Dev-Set v7.0 (fr) (No Hyphen),MCV Test-Set v7.0 (fr),MCV Test-Set v7.0 (fr) (No Hyphen),MLS Dev (en),MLS Dev (en) (No Hyphen),MLS Test (en),MLS Test (en) (No Hyphen)
+stt_fr_citrinet_1024_gamma_0_25,fr,,10.76,9.90,12.20,11.11,6.66,6.19,5.53,5.12
diff --git a/docs/source/asr/data/scores/fr/conformer_fr.csv b/docs/source/asr/data/scores/fr/conformer_fr.csv
new file mode 100644
index 0000000000000000000000000000000000000000..8f74dfe8cae047091e8c7f6081dcc24aca37df10
--- /dev/null
+++ b/docs/source/asr/data/scores/fr/conformer_fr.csv
@@ -0,0 +1,3 @@
+Model Name,Language,MCV Dev-Set (v??) (fr),MCV Dev-Set v7.0 (fr),MCV Dev-Set v7.0 (fr) (No Hyphen),MCV Test-Set v7.0 (fr),MCV Test-Set v7.0 (fr) (No Hyphen),MLS Dev (en),MLS Dev (en) (No Hyphen),MLS Test (en),MLS Test (en) (No Hyphen)
+stt_fr_conformer_ctc_large,fr,,8.35,7.88,9.63,9.01,5.88,5.90,4.91,4.63
+stt_fr_conformer_transducer_large,fr,,6.85,,7.95,,5.05,,4.10,
diff --git a/docs/source/asr/data/scores/fr/contextnet_fr.csv b/docs/source/asr/data/scores/fr/contextnet_fr.csv
new file mode 100644
index 0000000000000000000000000000000000000000..71f601871d1522745af18714f8691675d1c4d468
--- /dev/null
+++ b/docs/source/asr/data/scores/fr/contextnet_fr.csv
@@ -0,0 +1,2 @@
+Model Name,Language,MCV Dev-Set (v??) (fr),MCV Dev-Set v7.0 (fr),MCV Dev-Set v7.0 (fr) (No Hyphen),MCV Test-Set v7.0 (fr),MCV Test-Set v7.0 (fr) (No Hyphen),MLS Dev (en),MLS Dev (en) (No Hyphen),MLS Test (en),MLS Test (en) (No Hyphen)
+stt_fr_contextnet_1024,fr,,8.32,,9.42,,6.02,,5.01,
diff --git a/docs/source/asr/data/scores/fr/quartznet15x5_fr.csv b/docs/source/asr/data/scores/fr/quartznet15x5_fr.csv
new file mode 100644
index 0000000000000000000000000000000000000000..a30f447f42818eeb4e8e1e871e0d15dabe1955e1
--- /dev/null
+++ b/docs/source/asr/data/scores/fr/quartznet15x5_fr.csv
@@ -0,0 +1,2 @@
+Model Name,Language,MCV Dev-Set (v??) (fr),MCV Dev-Set v7.0 (fr),MCV Dev-Set v7.0 (fr) (No Hyphen),MCV Test-Set v7.0 (fr),MCV Test-Set v7.0 (fr) (No Hyphen),MLS Dev (en),MLS Dev (en) (No Hyphen),MLS Test (en),MLS Test (en) (No Hyphen)
+stt_fr_quartznet15x5,fr,14.01,,,,,,,,
diff --git a/docs/source/asr/data/scores/hr/conformer_hr.csv b/docs/source/asr/data/scores/hr/conformer_hr.csv
new file mode 100644
index 0000000000000000000000000000000000000000..04383a14e88885d656067462657f392fcd7b67c9
--- /dev/null
+++ b/docs/source/asr/data/scores/hr/conformer_hr.csv
@@ -0,0 +1,3 @@
+Model Name,Language,ParlaSpeech Dev-Set v1.0 (hr),ParlaSpeech Test-Set v1.0 (hr)
+stt_hr_conformer_ctc_large,hr,4.43,4.70
+stt_hr_conformer_transducer_large,hr,4.56,4.69
diff --git a/docs/source/asr/data/scores/it/conformer_it.csv b/docs/source/asr/data/scores/it/conformer_it.csv
new file mode 100644
index 0000000000000000000000000000000000000000..3e3854eb862ae540734071811662c9c4ef712e11
--- /dev/null
+++ b/docs/source/asr/data/scores/it/conformer_it.csv
@@ -0,0 +1,3 @@
+Model Name,Language,MCV Dev-Set (v??) (it),MCV Dev-Set v11.0 (it),MCV Test-Set v11.0 (it),MLS Dev (en),MLS Test (en),VoxPopuli Dev (it),VoxPopuli Test (it)
+stt_it_conformer_ctc_large,it,,5.38,5.92,13.16,10.62,13.43,16.75
+stt_it_conformer_transducer_large,it,,4.80,5.24,14.62,12.18,12.00,15.15
diff --git a/docs/source/asr/data/scores/it/quartznet15x5_it.csv b/docs/source/asr/data/scores/it/quartznet15x5_it.csv
new file mode 100644
index 0000000000000000000000000000000000000000..475058e38bc019c1aac22e641179357541563e76
--- /dev/null
+++ b/docs/source/asr/data/scores/it/quartznet15x5_it.csv
@@ -0,0 +1,2 @@
+Model Name,Language,MCV Dev-Set (v??) (it),MCV Dev-Set v11.0 (it),MCV Test-Set v11.0 (it),MLS Dev (en),MLS Test (en),VoxPopuli Dev (it),VoxPopuli Test (it)
+stt_it_quartznet15x5,it,15.22,,,,,,
diff --git a/docs/source/asr/data/scores/kab/conformer_kab.csv b/docs/source/asr/data/scores/kab/conformer_kab.csv
new file mode 100644
index 0000000000000000000000000000000000000000..9db989dc23778d02a380c391f9c78c7b0b0694a8
--- /dev/null
+++ b/docs/source/asr/data/scores/kab/conformer_kab.csv
@@ -0,0 +1,2 @@
+Model Name,Language,MCV Test-Set v10.0 (kab)
+stt_kab_conformer_transducer_large,kab,18.86
diff --git a/docs/source/asr/data/scores/pl/quartznet15x5_pl.csv b/docs/source/asr/data/scores/pl/quartznet15x5_pl.csv
new file mode 100644
index 0000000000000000000000000000000000000000..5692e36037ac7ec8e9284debb300256f1cbdf642
--- /dev/null
+++ b/docs/source/asr/data/scores/pl/quartznet15x5_pl.csv
@@ -0,0 +1,2 @@
+Model Name,Language,MCV Dev-Set (v??) (pl)
+stt_pl_quartznet15x5,pl,14
diff --git a/docs/source/asr/data/scores/ru/conformer_ru.csv b/docs/source/asr/data/scores/ru/conformer_ru.csv
new file mode 100644
index 0000000000000000000000000000000000000000..a4f2c20a2726a8cd55a79578edf4497dee88838b
--- /dev/null
+++ b/docs/source/asr/data/scores/ru/conformer_ru.csv
@@ -0,0 +1,3 @@
+Model Name,Language,GOLOS Crowd Test-Set (v??) (ru),GOLOS Farfield Test-Set (v??) (ru),Librispeech Test,MCV Dev-Set (v??) (ru),MCV Dev-Set v10.0 (ru),MCV Test-Set v10.0 (ru)
+stt_ru_conformer_ctc_large,ru,2.8 %,7.1 %,13.5 %,,3.9 %,4.3 %
+stt_ru_conformer_transducer_large,ru,2.7%,7.6%,12.0%,,3.5%,4.0%
diff --git a/docs/source/asr/data/scores/ru/quartznet15x5_ru.csv b/docs/source/asr/data/scores/ru/quartznet15x5_ru.csv
new file mode 100644
index 0000000000000000000000000000000000000000..db86ab2e8b6bf179d9c94659ba24f2231149b4fc
--- /dev/null
+++ b/docs/source/asr/data/scores/ru/quartznet15x5_ru.csv
@@ -0,0 +1,2 @@
+Model Name,Language,GOLOS Crowd Test-Set (v??) (ru),GOLOS Farfield Test-Set (v??) (ru),Librispeech Test,MCV Dev-Set (v??) (ru),MCV Dev-Set v10.0 (ru),MCV Test-Set v10.0 (ru)
+stt_ru_quartznet15x5,ru,,,,16.23,,
diff --git a/docs/source/asr/data/scores/rw/conformer_rw.csv b/docs/source/asr/data/scores/rw/conformer_rw.csv
new file mode 100644
index 0000000000000000000000000000000000000000..e5544a8067d55fc7d9753391e7dfefa90cca5336
--- /dev/null
+++ b/docs/source/asr/data/scores/rw/conformer_rw.csv
@@ -0,0 +1,3 @@
+Model Name,Language,MCV Test-Set v9.0 (rw)
+stt_rw_conformer_ctc_large,rw,18.2 %
+stt_rw_conformer_transducer_large,rw,16.2 %
diff --git a/docs/source/asr/data/scores/zh/citrinet_zh.csv b/docs/source/asr/data/scores/zh/citrinet_zh.csv
new file mode 100644
index 0000000000000000000000000000000000000000..2ad05e0233e1a103dbef05728d49535d70dcdbc5
--- /dev/null
+++ b/docs/source/asr/data/scores/zh/citrinet_zh.csv
@@ -0,0 +1,3 @@
+Model Name,Language,AIShell Dev-Android v2,AIShell Dev-Ios v1,AIShell Dev-Ios v2,AIShell Dev-Mic v2,AIShell Test-Android v2,AIShell Test-Ios v1,AIShell Test-Ios v2,AIShell Test-Mic v2
+stt_zh_citrinet_512,zh,,6.25%,,,,6.44%,,
+stt_zh_citrinet_1024_gamma_0_25,zh,5.2 %,,4.8 %,5.2 %,5.5 %,,5.1 %,5.5 %
diff --git a/docs/source/asr/data/scores/zh/conformer_zh.csv b/docs/source/asr/data/scores/zh/conformer_zh.csv
new file mode 100644
index 0000000000000000000000000000000000000000..8d0ef96dc8d9d7766eb13fc7c6d08717c129132a
--- /dev/null
+++ b/docs/source/asr/data/scores/zh/conformer_zh.csv
@@ -0,0 +1,2 @@
+Model Name,Language,AIShell Dev-Android v2,AIShell Dev-Ios v1,AIShell Dev-Ios v2,AIShell Dev-Mic v2,AIShell Test-Android v2,AIShell Test-Ios v1,AIShell Test-Ios v2,AIShell Test-Mic v2
+stt_zh_conformer_transducer_large,zh,3.4,,3.2,3.4,3.4,,3.2,3.4
diff --git a/docs/source/asr/datasets.rst b/docs/source/asr/datasets.rst
new file mode 100644
index 0000000000000000000000000000000000000000..b55e49ad1c8ff9b3bef31f6a5a97004d8aacee0b
--- /dev/null
+++ b/docs/source/asr/datasets.rst
@@ -0,0 +1,484 @@
+Datasets
+========
+
+NeMo has scripts to convert several common ASR datasets into the format expected by the ``nemo_asr`` collection. You can get started
+with those datasets by following the instructions to run those scripts in the section appropriate to each dataset below.
+
+If the user has their own data and want to preprocess it to use with NeMo ASR models, refer to the `Preparing Custom ASR Data`_ section.
+
+If the user already has a dataset that you want to convert to a tarred format, refer to the `Tarred Datasets`_ section.
+
+.. _LibriSpeech_dataset:
+
+LibriSpeech
+-----------
+
+Run the following scripts to download the LibriSpeech data and convert it into the format expected by `nemo_asr`. At least 250GB free
+space is required.
+
+.. code-block:: bash
+
+ # install sox
+ sudo apt-get install sox
+ mkdir data
+ python get_librispeech_data.py --data_root=data --data_set=ALL
+
+After this, the ``data`` folder should contain wav files and ``.json`` manifests for NeMo ASR datalayer.
+
+Each line is a training example. ``audio_filepath`` contains the path to the wav file, ``duration`` is the duration in seconds, and ``text`` is the transcript:
+
+.. code-block:: json
+
+ {"audio_filepath": "/1355-39947-0000.wav", "duration": 11.3, "text": "psychotherapy and the community both the physician and the patient find their place in the community the life interests of which are superior to the interests of the individual"}
+ {"audio_filepath": "/1355-39947-0001.wav", "duration": 15.905, "text": "it is an unavoidable question how far from the higher point of view of the social mind the psychotherapeutic efforts should be encouraged or suppressed are there any conditions which suggest suspicion of or direct opposition to such curative work"}
+
+Fisher English Training Speech
+------------------------------
+
+Run these scripts to convert the Fisher English Training Speech data into a format expected by the ``nemo_asr`` collection.
+
+In brief, the following scripts convert the ``.sph`` files to ``.wav``, slices those files into smaller audio samples, matches the
+smaller slices with their corresponding transcripts, and splits the resulting audio segments into train, validation, and test sets
+(with one manifest each).
+
+.. note::
+ - 106 GB of space is required to run the ``.wav`` conversion
+ - additional 105 GB is required for the slicing and matching
+ - ``sph2pipe`` is required in order to run the ``.wav`` conversion
+
+**Instructions**
+
+The following scripts assume that you already have the Fisher dataset from the Linguistic Data Consortium, with a directory structure
+that looks similar to the following:
+
+.. code-block:: bash
+
+ FisherEnglishTrainingSpeech/
+ ├── LDC2004S13-Part1
+ │ ├── fe_03_p1_transcripts
+ │ ├── fisher_eng_tr_sp_d1
+ │ ├── fisher_eng_tr_sp_d2
+ │ ├── fisher_eng_tr_sp_d3
+ │ └── ...
+ └── LDC2005S13-Part2
+ ├── fe_03_p2_transcripts
+ ├── fe_03_p2_sph1
+ ├── fe_03_p2_sph2
+ ├── fe_03_p2_sph3
+ └── ...
+
+The transcripts that will be used are located in the ``fe_03_p<1,2>_transcripts/data/trans`` directory. The audio files (``.sph``)
+are located in the remaining directories in an ``audio`` subdirectory.
+
+#. Convert the audio files from ``.sph`` to ``.wav`` by running:
+
+ .. code-block:: bash
+
+ cd /scripts/dataset_processing
+ python fisher_audio_to_wav.py \
+ --data_root= --dest_root=
+
+ This will place the unsliced ``.wav`` files in ``/LDC200[4,5]S13-Part[1,2]/audio-wav/``. It will take several
+ minutes to run.
+
+#. Process the transcripts and slice the audio data.
+
+ .. code-block:: bash
+
+ python process_fisher_data.py \
+ --audio_root= --transcript_root= \
+ --dest_root= \
+ --remove_noises
+
+ This script splits the full dataset into train, validation, test sets, and places the audio slices in the corresponding folders
+ in the destination directory. One manifest is written out per set, which includes each slice's transcript, duration, and path.
+
+ This will likely take around 20 minutes to run. Once finished, delete the 10 minute long ``.wav`` files.
+
+2000 HUB5 English Evaluation Speech
+-----------------------------------
+
+Run the following script to convert the HUB5 data into a format expected by the ``nemo_asr`` collection.
+
+Similarly, to the Fisher dataset processing scripts, this script converts the ``.sph`` files to ``.wav``, slices the audio files and
+transcripts into utterances, and combines them into segments of some minimum length (default is 10 seconds). The resulting segments
+are all written out to an audio directory and the corresponding transcripts are written to a manifest JSON file.
+
+.. note::
+ - 5 GB of free space is required to run this script
+ - ``sph2pipe`` is also required to be installed
+
+This script assumes you already have the 2000 HUB5 dataset from the Linguistic Data Consortium.
+
+Run the following command to process the 2000 HUB5 English Evaluation Speech samples:
+
+.. code-block:: bash
+
+ python process_hub5_data.py \
+ --data_root= \
+ --dest_root=
+
+You can optionally include ``--min_slice_duration=`` if you would like to change the minimum audio segment duration.
+
+AN4 Dataset
+-----------
+
+This is a small dataset recorded and distributed by Carnegie Mellon University. It consists of recordings of people spelling out
+addresses, names, etc. Information about this dataset can be found on the `official CMU site `_.
+
+#. `Download and extract the dataset `_ (which is labeled "NIST's Sphere audio (.sph) format (64M)".
+
+#. Convert the ``.sph`` files to ``.wav`` using sox, and build one training and one test manifest.
+
+ .. code-block:: bash
+
+ python process_an4_data.py --data_root=
+
+After the script finishes, the ``train_manifest.json`` and ``test_manifest.json`` can be found in the ``/an4/`` directory.
+
+Aishell-1
+---------
+
+To download the Aishell-1 data and convert it into a format expected by ``nemo_asr``, run:
+
+.. code-block:: bash
+
+ # install sox
+ sudo apt-get install sox
+ mkdir data
+ python get_aishell_data.py --data_root=data
+
+After the script finishes, the ``data`` folder should contain a ``data_aishell`` folder which contains a wav file, a transcript folder, and related ``.json`` and ``vocab.txt`` files.
+
+Aishell-2
+---------
+
+To process the AIShell-2 dataset, in the command below, set the data folder of AIShell-2 using ``--audio_folder`` and where to push
+these files using ``--dest_folder``. In order to generate files in the supported format of ``nemo_asr``, run:
+
+.. code-block:: bash
+
+ python process_aishell2_data.py --audio_folder= --dest_folder=
+
+After the script finishes, the ``train.json``, ``dev.json``, ``test.json``, and ``vocab.txt`` files can be found in the ``dest_folder`` directory.
+
+Preparing Custom ASR Data
+-------------------------
+
+The ``nemo_asr`` collection expects each dataset to consist of a set of utterances in individual audio files plus
+a manifest that describes the dataset, with information about one utterance per line (``.json``).
+The audio files can be of any format supported by `Pydub `_, though we recommend
+WAV files as they are the default and have been most thoroughly tested.
+
+There should be one manifest file per dataset that will be passed in, therefore, if the user wants separate training and validation
+datasets, they should also have separate manifests. Otherwise, they will be loading validation data with their training data and vice
+versa.
+
+Each line of the manifest should be in the following format:
+
+.. code-block:: json
+
+ {"audio_filepath": "/path/to/audio.wav", "text": "the transcription of the utterance", "duration": 23.147}
+
+The :code:`audio_filepath` field should provide an absolute path to the ``.wav`` file corresponding to the utterance.
+The :code:`text` field should contain the full transcript for the utterance, and the :code:`duration` field should
+reflect the duration of the utterance in seconds.
+
+Each entry in the manifest (describing one audio file) should be bordered by '{' and '}' and must
+be contained on one line. The fields that describe the file should be separated by commas, and have the form :code:`"field_name": value`,
+as shown above. There should be no extra lines in the manifest, i.e. there should be exactly as many lines in the manifest as
+there are audio files in the dataset.
+
+Since the manifest specifies the path for each utterance, the audio files do not have to be located
+in the same directory as the manifest, or even in any specific directory structure.
+
+Once there is a manifest that describes each audio file in the dataset, use the dataset by passing
+in the manifest file path in the experiment config file, e.g. as ``training_ds.manifest_filepath=``.
+
+Tarred Datasets
+---------------
+
+If experiments are run on a cluster with datasets stored on a distributed file system, the user will likely
+want to avoid constantly reading multiple small files and would prefer tarring their audio files.
+There are tarred versions of some NeMo ASR dataset classes for this case, such as the ``TarredAudioToCharDataset``
+(corresponding to the ``AudioToCharDataset``) and the ``TarredAudioToBPEDataset`` (corresponding to the
+``AudioToBPEDataset``). The tarred audio dataset classes in NeMo use `WebDataset `_.
+
+To use an existing tarred dataset instead of a non-tarred dataset, set ``is_tarred: true`` in
+the experiment config file. Then, pass in the paths to all of the audio tarballs in ``tarred_audio_filepaths``, either as a list
+of filepaths, e.g. ``['/data/shard1.tar', '/data/shard2.tar']``, or in a single brace-expandable string, e.g.
+``'/data/shard_{1..64}.tar'`` or ``'/data/shard__OP_1..64_CL_'`` (recommended, see note below).
+
+.. note::
+ For brace expansion, there may be cases where ``{x..y}`` syntax cannot be used due to shell interference. This occurs most commonly
+ inside SLURM scripts. Therefore, we provide a few equivalent replacements. Supported opening braces (equivalent to ``{``) are ``(``,
+ ``[``, ``<`` and the special tag ``_OP_``. Supported closing braces (equivalent to ``}``) are ``)``, ``]``, ``>`` and the special
+ tag ``_CL_``. For SLURM based tasks, we suggest the use of the special tags for ease of use.
+
+As with non-tarred datasets, the manifest file should be passed in ``manifest_filepath``. The dataloader assumes that the length
+of the manifest after filtering is the correct size of the dataset for reporting training progress.
+
+The ``tarred_shard_strategy`` field of the config file can be set if you have multiple shards and are running an experiment with
+multiple workers. It defaults to ``scatter``, which preallocates a set of shards per worker which do not change during runtime.
+Note that this strategy, on specific occasions (when the number of shards is not divisible with ``world_size``), will not sample
+the entire dataset. As an alternative the ``replicate`` strategy, will preallocate the entire set of shards to every worker and not
+change it during runtime. The benefit of this strategy is that it allows each worker to sample data points from the entire dataset
+independently of others. Note, though, that more than one worker may sample the same shard, and even sample the same data points!
+As such, there is no assured guarantee that all samples in the dataset will be sampled at least once during 1 epoch. Note that
+for these reasons it is not advisable to use tarred datasets as validation and test datasets.
+
+For more information about the individual tarred datasets and the parameters available, including shuffling options,
+see the corresponding class APIs in the `Datasets <./api.html#Datasets>`__ section.
+
+.. warning::
+ If using multiple workers, the number of shards should be divisible by the world size to ensure an even
+ split among workers. If it is not divisible, logging will give a warning but training will proceed, but likely hang at the last epoch.
+ In addition, if using distributed processing, each shard must have the same number of entries after filtering is
+ applied such that each worker ends up with the same number of files. We currently do not check for this in any dataloader, but the user's
+ program may hang if the shards are uneven.
+
+Conversion to Tarred Datasets
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+You can easily convert your existing NeMo-compatible ASR datasets using the
+`conversion script here `_.
+
+.. code:: bash
+
+ python convert_to_tarred_audio_dataset.py \
+ --manifest_path= \
+ --target_dir= \
+ --num_shards=
+ --max_duration= \
+ --min_duration= \
+ --shuffle --shuffle_seed=0
+
+This script shuffles the entries in the given manifest (if ``--shuffle`` is set, which we recommend), filter
+audio files according to ``min_duration`` and ``max_duration``, and tar the remaining audio files to the directory
+``--target_dir`` in ``n`` shards, along with separate manifest and metadata files.
+
+The files in the target directory should look similar to the following:
+
+.. code::
+
+ target_dir/
+ ├── audio_1.tar
+ ├── audio_2.tar
+ ├── ...
+ ├── metadata.yaml
+ └── tarred_audio_manifest.json
+
+Note that file structures are flattened such that all audio files are at the top level in each tarball. This ensures that
+filenames are unique in the tarred dataset and the filepaths do not contain "-sub" and forward slashes in each ``audio_filepath`` are
+simply converted to underscores. For example, a manifest entry for ``/data/directory1/file.wav`` would be ``_data_directory1_file.wav``
+in the tarred dataset manifest, and ``/data/directory2/file.wav`` would be converted to ``_data_directory2_file.wav``.
+
+Bucketing Datasets
+------------------
+
+For training ASR models, audios with different lengths may be grouped into a batch. It would make it necessary to use paddings to make all the same length.
+These extra paddings is a significant source of computation waste. Splitting the training samples into buckets with different lengths and sampling from the same bucket for each batch would increase the computation efficicncy.
+It may result into training speeedup of more than 2X. To enable and use the bucketing feature, you need to create the bucketing version of the dataset by using `conversion script here `_.
+You may use --buckets_num to specify the number of buckets (Recommened to use 4 to 8 buckets). It creates multiple tarred datasets, one per bucket, based on the audio durations. The range of [min_duration, max_duration) is split into equal sized buckets.
+
+
+To enable the bucketing feature in the dataset section of the config files, you need to pass the multiple tarred datasets as a list of lists.
+If user passes just a list of strings, then the datasets would simply get concatenated which would be different from bucketing.
+Here is an example for 4 buckets and 512 shards:
+
+.. code::
+
+ python speech_to_text_bpe.py
+ ...
+ model.train_ds.manifest_filepath=[[PATH_TO_TARS/bucket1/tarred_audio_manifest.json],
+ [PATH_TO_TARS/bucket2/tarred_audio_manifest.json],
+ [PATH_TO_TARS/bucket3/tarred_audio_manifest.json],
+ [PATH_TO_TARS/bucket4/tarred_audio_manifest.json]]
+ model.train_ds.tarred_audio_filepaths=[[PATH_TO_TARS/bucket1/audio__OP_0..511_CL_.tar],
+ [PATH_TO_TARS/bucket2/audio__OP_0..511_CL_.tar],
+ [PATH_TO_TARS/bucket3/audio__OP_0..511_CL_.tar],
+ [PATH_TO_TARS/bucket4/audio__OP_0..511_CL_.tar]]
+
+When bucketing is enabled, in each epoch, first all GPUs would use the first bucket, then go to the second bucket, and so on. It guarantees that all GPUs are using the same bucket at the same time. It reduces the number of paddings in each batch and speedup the training significantly without hurting the accuracy significantly.
+
+There are two types of batching:
+
+* Fixed-size bucketing: all batches would have the same number of samples specified by train_ds.batch_size
+* Adaptive-size bucketing: uses different batch sizes for each bucket.
+
+Adaptive-size bucketing helps to increase the GPU utilization and speedup the training.
+Batches sampled from buckets with smaller audio lengths can be larger which would increase the GPU utilization and speedup the training.
+You may use train_ds.bucketing_batch_size to enable the adaptive batching and specify the batch sizes for the buckets.
+When bucketing_batch_size is not set, train_ds.batch_size is going to be used for all buckets (fixed-size bucketing).
+
+bucketing_batch_size can be set as an integer or a list of integers to explicitly specify the batch size for each bucket.
+if bucketing_batch_size is set to be an integer, then linear scaling is being used to scale-up the batch sizes for batches with shorted audio size. For example, setting train_ds.bucketing_batch_size=8 for 4 buckets would use these sizes [32,24,16,8] for different buckets.
+When bucketing_batch_size is set, traind_ds.batch_size need to be set to 1.
+
+Training an ASR model on audios sorted based on length may affect the accuracy of the model. We introduced some strategies to mitigate it.
+We support three types of bucketing strategies:
+
+* fixed_order: the same order of buckets are used for all epochs
+* synced_randomized (default): each epoch would have a different order of buckets. Order of the buckets is shuffled every epoch.
+* fully_randomized: similar to synced_randomized but each GPU has its own random order. So GPUs would not be synced.
+
+Tha parameter train_ds.bucketing_strategy can be set to specify one of these strategies. The recommended strategy is synced_randomized which gives the highest training speedup.
+The fully_randomized strategy would have lower speedup than synced_randomized but may give better accuracy.
+
+Bucketing may improve the training speed more than 2x but may affect the final accuracy of the model slightly. Training for more epochs and using 'synced_randomized' strategy help to fill this gap.
+Currently bucketing feature is just supported for tarred datasets.
+
+Upsampling Datasets
+-------------------
+
+Buckets may also be 'weighted' to allow multiple runs through a target dataset during each training epoch. This can be beneficial in cases when a dataset is composed of several component sets of unequal sizes and one desires to mitigate bias towards the larger sets through oversampling.
+
+Weighting is managed with the `bucketing_weights` parameter. After passing your composite tarred datasets in the format described above for bucketing, pass a list of integers (one per bucket) to indicate how many times a manifest should be read during training.
+
+For example, by passing `[2,1,1,3]` to the code below:
+
+.. code::
+
+ python speech_to_text_bpe.py
+ ...
+ model.train_ds.manifest_filepath=[[PATH_TO_TARS/bucket1/tarred_audio_manifest.json],
+ [PATH_TO_TARS/bucket2/tarred_audio_manifest.json],
+ [PATH_TO_TARS/bucket3/tarred_audio_manifest.json],
+ [PATH_TO_TARS/bucket4/tarred_audio_manifest.json]]
+ model.train_ds.tarred_audio_filepaths=[[PATH_TO_TARS/bucket1/audio__OP_0..511_CL_.tar],
+ [PATH_TO_TARS/bucket2/audio__OP_0..511_CL_.tar],
+ [PATH_TO_TARS/bucket3/audio__OP_0..511_CL_.tar],
+ [PATH_TO_TARS/bucket4/audio__OP_0..511_CL_.tar]]
+ ...
+ model.train_ds.bucketing_weights=[2,1,1,3]
+
+NeMo will configure training so that all data in `bucket1` will be present twice in a training epoch, `bucket4` will be present three times, and that of `bucket2` and `bucket3` will occur only once each. Note that this will increase the effective amount of data present during training and thus affect training time per epoch.
+
+If using adaptive bucketing, note that the same batch size will be assigned to each instance of the upsampled data. That is, given the following:
+
+.. code::
+
+ python speech_to_text_bpe.py
+ ...
+ model.train_ds.manifest_filepath=[[PATH_TO_TARS/bucket1/tarred_audio_manifest.json],
+ [PATH_TO_TARS/bucket2/tarred_audio_manifest.json],
+ [PATH_TO_TARS/bucket3/tarred_audio_manifest.json],
+ [PATH_TO_TARS/bucket4/tarred_audio_manifest.json]]
+ ...
+ ...
+ model.train_ds.bucketing_weights=[2,1,1,3]
+ model.train_ds.bucketing_batch_size=[4,4,4,2]
+
+All instances of data from `bucket4` will still be trained with a batch size of 2 while all others would have a batch size of 4. As with standard bucketing, this requires `batch_size`` to be set to 1.
+If `bucketing_batch_size` is not specified, all datasets will be passed with the same fixed batch size as specified by the `batch_size` parameter.
+
+It is recommended to set bucketing strategies to `fully_randomized` during multi-GPU training to prevent possible dataset bias during training.
+
+
+Datasets on AIStore
+-------------------
+
+`AIStore `_ is an open-source lightweight object storage system focused on large-scale deep learning.
+AIStore is aimed to scale linearly with each added storage node, can be deployed on any Linux machine and can provide a unified namespace across multiple remote backends, such as Amazon S3, Google Cloud, and Microsoft Azure.
+More details are provided in the `documentation `_ and the `repository `_ of the AIStore project.
+
+NeMo currently supports datasets from an AIStore bucket provider under ``ais://`` namespace.
+
+AIStore Setup
+~~~~~~~~~~~~~
+
+NeMo is currently relying on the AIStore (AIS) command-line interface (CLI) to handle the supported datasets.
+The CLI is available in current NeMo Docker containers.
+If necessary, the CLI can be configured using the instructions provided in `AIStore CLI `_ documentation.
+
+To start using the AIS CLI to access data on an AIS cluster, an endpoint needs to be configured.
+The endpoint is configured by setting ``AIS_ENDPOINT`` environment variable before using the CLI
+
+.. code::
+
+ export AIS_ENDPOINT=http://hostname:port
+ ais --help
+
+In the above, ``hostname:port`` denotes the address of an AIS gateway.
+For example, the address could be ``localhost:51080`` if testing using a local `minimal production-ready standalone Docker container `_.
+
+Dataset Setup
+~~~~~~~~~~~~~
+
+Currently, both tarred and non-tarred datasets are supported.
+For any dataset, the corresponding manifest file is cached locally and processed as a regular manifest file.
+For non-tarred datasets, the audio data is also cached locally.
+For tarred datasets, shards from the AIS cluster are used by piping ``ais get`` to WebDataset.
+
+Tarred Dataset from AIS
+^^^^^^^^^^^^^^^^^^^^^^^
+
+A tarred dataset can be easily used as described in the :ref:`Tarred Datasets` section by providing paths to manifests on an AIS cluster.
+For example, a tarred dataset from an AIS cluster can be configured as
+
+.. code::
+
+ manifest_filepath='ais://bucket/tarred_audio_manifest.json'
+ tarred_audio_filepaths='ais://bucket/shard_{1..64}.tar'
+
+:ref:`Bucketing Datasets` are configured in a similar way by providing paths on an AIS cluster.
+
+Non-tarred Dataset from AIS
+^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+A non-tarred dataset can be easly used by providing a manifest file path on an AIS cluster
+
+.. code::
+
+ manifest_filepath='ais://bucket/dataset_manifest.json'
+
+Note that it is assumed that the manifest file path contains audio file paths relative to the manifest locations.
+For example the manifest file may have lines in the following format
+
+.. code-block:: json
+
+ {"audio_filepath": "path/to/audio.wav", "text": "transcription of the uterance", "duration": 23.147}
+
+The corresponding audio file would be downloaded from ``ais://bucket/path/to/audio.wav``.
+
+Cache configuration
+^^^^^^^^^^^^^^^^^^^
+
+Manifests and audio files from non-tarred datasets will be cached locally.
+Location of the cache can be configured by setting two environment variables
+
+- ``NEMO_DATA_STORE_CACHE_DIR``: path to a location which can be used to cache the data
+- ``NEMO_DATA_STORE_CACHE_SHARED``: flag to denote whether the cache location is shared between the compute nodes
+
+In a multi-node environment, the cache location may or may be not shared between the nodes.
+This can be configured by setting ``NEMO_DATA_STORE_CACHE_SHARED`` to ``1`` when the location is shared between the nodes or to ``0`` when each node has a separate cache.
+
+When a globally shared cache is available, the data should be cached only once from the global rank zero node.
+When a node-specific cache is used, the data should be cached only once by each local rank zero node.
+To control this behavior using `torch.distributed.barrier`, instantiation of the corresponding dataloader needs to be deferred ``ModelPT::setup``, to ensure a distributed environment has been initialized.
+This can be achieved by setting ``defer_setup`` as
+
+.. code:: shell
+
+ ++model.train_ds.defer_setup=true
+ ++model.validation_ds.defer_setup=true
+ ++model.test_ds.defer_setup=true
+
+
+Complete Example
+^^^^^^^^^^^^^^^^
+
+An example using an AIS cluster at ``hostname:port`` with a tarred dataset for training, a non-tarred dataset for validation and node-specific caching is given below
+
+.. code:: shell
+
+ export AIS_ENDPOINT=http://hostname:port \
+ && export NEMO_DATA_STORE_CACHE_DIR=/tmp \
+ && export NEMO_DATA_STORE_CACHE_SHARED=0 \
+ python speech_to_text_bpe.py \
+ ...
+ model.train_ds.manifest_filepath=ais://train_bucket/tarred_audio_manifest.json \
+ model.train_ds.tarred_audio_filepaths=ais://train_bucket/audio__OP_0..511_CL_.tar \
+ ++model.train_ds.defer_setup=true \
+ mode.validation_ds.manifest_filepath=ais://validation_bucket/validation_manifest.json \
+ ++model.validation_ds.defer_setup=true
\ No newline at end of file
diff --git a/docs/source/asr/examples/kinyarwanda_asr.rst b/docs/source/asr/examples/kinyarwanda_asr.rst
new file mode 100644
index 0000000000000000000000000000000000000000..bd1eac94e31f0a690cb2d6b9b65bc86921ecabce
--- /dev/null
+++ b/docs/source/asr/examples/kinyarwanda_asr.rst
@@ -0,0 +1,631 @@
+########################################################################
+Example: Kinyarwanda ASR using Mozilla Common Voice Dataset
+########################################################################
+
+In this example, we describe essential steps of training an ASR model for a new language (Kinyarwanda). Namely,
+
+* Data preprocessing
+* Building tokenizers
+* Tarred datasets and bucketing
+* Training from scratch and finetuning
+* Inference and evaluation
+
+
+**************************
+Kinyarwanda Speech Dataset
+**************************
+We use `Mozilla Common Voice `_ dataset for Kinyarwanda which is a large dataset with 2000+ hours of audio data.
+
+**Note**: You should download this dataset by yourself.
+
+Mozilla distributes the dataset in tsv+mp3 format.
+After downloading and unpacking, the dataset has the following structure
+
+.. code-block:: bash
+
+ ├── cv-corpus-9.0-2022-04-27
+ │ └── rw
+ │ ├── clips [here are all audio files, e.g. common_voice_rw_26260276.mp3]
+ │ ├── dev.tsv
+ │ ├── invalidated.tsv
+ │ ├── other.tsv
+ │ ├── reported.tsv
+ │ ├── test.tsv
+ │ ├── train.tsv
+ │ └── validated.tsv
+
+Mozilla provides **train/dev/test** split of the data, so we can just use it.
+Let's look at the format of a .tsv file
+
+.. code-block:: bash
+
+ head train.tsv
+
+.. code-block:: bash
+
+ client_id path sentence up_votes down_votes age gender accents locale segment
+ e2a04c0ecacf81302f4270a3dddaa7a131420f6b7319208473af17d4adf3724ad9a3b6cdee107e2f321495db86f114a50c396e0928464a58dfad472130e7514a common_voice_rw_26273273.mp3 kandi tuguwe neza kugira ngo twakire amagambo y’ukuri, 2 0 twenties male rw
+ e2a04c0ecacf81302f4270a3dddaa7a131420f6b7319208473af17d4adf3724ad9a3b6cdee107e2f321495db86f114a50c396e0928464a58dfad472130e7514a common_voice_rw_26273478.mp3 Simbi na we akajya kwiga nubwo byari bigoye 2 0 twenties male rw
+ e2a04c0ecacf81302f4270a3dddaa7a131420f6b7319208473af17d4adf3724ad9a3b6cdee107e2f321495db86f114a50c396e0928464a58dfad472130e7514a common_voice_rw_26273483.mp3 Inshuti yanjye yaje kunsura ku biro byanjye. 2 0 twenties male rw
+ e2a04c0ecacf81302f4270a3dddaa7a131420f6b7319208473af17d4adf3724ad9a3b6cdee107e2f321495db86f114a50c396e0928464a58dfad472130e7514a common_voice_rw_26273488.mp3 Grand Canyon ni ahantu hazwi cyane ba mukerarugendo. 2 0 twenties male rw
+
+Each line corresponds to one record (usually one sentence) and contains:
+
+* name of the audio file
+* corresponding transcription
+* meta information: client_id, age, gender, etc.
+
+
+Resampling and creating manifests
+#################################
+
+To be able to use a dataset with NeMo Toolkit, we first need to
+
+* Convert *.tsv* files to *.json* manifests
+* Convert *.mp3* files to *.wav* with sample rate of 16000
+
+To convert a .tsv file to .json manifest, we used the following script
+
+.. code-block:: bash
+
+ python tsv_to_json.py \
+ --tsv=cv-corpus-9.0-2022-04-27/rw/train.tsv \
+ --folder=cv-corpus-9.0-2022-04-27/rw/clips \
+ --sampling_count=-1
+
+**tsv_to_json.py**:
+
+.. code-block:: python
+
+ import pandas as pd
+ import json
+ import tqdm
+ import argparse
+
+ parser = argparse.ArgumentParser("MCV TSV-to-JSON converter")
+ parser.add_argument("--tsv", required=True, type=str, help="Input TSV file")
+ parser.add_argument("--sampling_count", required=True, type=int, help="Number of examples, you want, use -1 for all examples")
+ parser.add_argument("--folder", required=True, type=str, help="Relative path to folder with audio files")
+ args = parser.parse_args()
+
+ df = pd.read_csv(args.tsv, sep='\t')
+ with open(args.tsv.replace('.tsv', '.json'), 'w') as fo:
+ mod = 1
+ if args.sampling_count > 0:
+ mod = len(df) // args.sampling_count
+ for idx in tqdm.tqdm(range(len(df))):
+ if idx % mod != 0:
+ continue
+ item = {
+ 'audio_filepath': args.folder + "/" + df['path'][idx],
+ 'text': df['sentence'][idx],
+ 'up_votes': int(df['up_votes'][idx]), 'down_votes': int(df['down_votes'][idx]),
+ 'age': df['age'][idx], 'gender': df['gender'][idx], 'accents': df['accents'][idx],
+ 'client_id': df['client_id'][idx]
+ }
+ fo.write(json.dumps(item) + "\n")
+
+This script will create a corresponding **train.json** manifest near the initial **train.tsv**. It will look like this:
+
+.. code-block:: bash
+
+ {"audio_filepath": "cv-corpus-9.0-2022-04-27/rw/clips/common_voice_rw_26273273.mp3", "text": "kandi tuguwe neza kugira ngo twakire amagambo y\u2019ukuri,", "up_votes": 2, "down_votes": 0, "age": "twenties", "gender": "male", "accents": NaN, "client_id": "e2a04c0ecacf81302f4270a3dddaa7a131420f6b7319208473af17d4adf3724ad9a3b6cdee107e2f321495db86f114a50c396e0928464a58dfad472130e7514a"}
+ {"audio_filepath": "cv-corpus-9.0-2022-04-27/rw/clips/common_voice_rw_26273478.mp3", "text": "Simbi na we akajya kwiga nubwo byari bigoye", "up_votes": 2, "down_votes": 0, "age": "twenties", "gender": "male", "accents": NaN, "client_id": "e2a04c0ecacf81302f4270a3dddaa7a131420f6b7319208473af17d4adf3724ad9a3b6cdee107e2f321495db86f114a50c396e0928464a58dfad472130e7514a"}
+ {"audio_filepath": "cv-corpus-9.0-2022-04-27/rw/clips/common_voice_rw_26273483.mp3", "text": "Inshuti yanjye yaje kunsura ku biro byanjye.", "up_votes": 2, "down_votes": 0, "age": "twenties", "gender": "male", "accents": NaN, "client_id": "e2a04c0ecacf81302f4270a3dddaa7a131420f6b7319208473af17d4adf3724ad9a3b6cdee107e2f321495db86f114a50c396e0928464a58dfad472130e7514a"}
+ {"audio_filepath": "cv-corpus-9.0-2022-04-27/rw/clips/common_voice_rw_26273488.mp3", "text": "Grand Canyon ni ahantu hazwi cyane ba mukerarugendo.", "up_votes": 2, "down_votes": 0, "age": "twenties", "gender": "male", "accents": NaN, "client_id": "e2a04c0ecacf81302f4270a3dddaa7a131420f6b7319208473af17d4adf3724ad9a3b6cdee107e2f321495db86f114a50c396e0928464a58dfad472130e7514a"}
+
+For resampling we used the following script:
+
+.. code-block:: bash
+
+ mkdir train
+ python ../decode_resample.py \
+ --manifest=cv-corpus-9.0-2022-04-27/rw/train.json \
+ --destination_folder=./train
+
+**decode_resample.py**:
+
+.. code-block:: python
+
+ import argparse
+ import os
+ import json
+
+ import sox
+ from sox import Transformer
+ import tqdm
+ import multiprocessing
+ from tqdm.contrib.concurrent import process_map
+
+
+ parser = argparse.ArgumentParser()
+ parser.add_argument('--manifest', required=True, type=str, help='path to the original manifest')
+ parser.add_argument("--num_workers", default=multiprocessing.cpu_count(), type=int, help="Workers to process dataset.")
+ parser.add_argument("--destination_folder", required=True, type=str, help="Destination folder where audio files will be stored")
+ args = parser.parse_args()
+
+
+ def process(x):
+ if not isinstance(x['text'], str):
+ x['text'] = ''
+ else:
+ x['text'] = x['text'].lower().strip()
+ _, file_with_ext = os.path.split(x['audio_filepath'])
+ name, ext = os.path.splitext(file_with_ext)
+ output_wav_path = args.destination_folder + "/" + name + '.wav'
+ if not os.path.exists(output_wav_path):
+ tfm = Transformer()
+ tfm.rate(samplerate=16000)
+ tfm.channels(n_channels=1)
+ tfm.build(input_filepath=x['audio_filepath'],
+ output_filepath=output_wav_path)
+ x['duration'] = sox.file_info.duration(output_wav_path)
+ x['audio_filepath'] = output_wav_path
+ return x
+
+
+ def load_data(manifest):
+ data = []
+ with open(manifest, 'r') as f:
+ for line in tqdm.tqdm(f):
+ item = json.loads(line)
+ data.append(item)
+ return data
+
+
+ data = load_data(args.manifest)
+
+ data_new = process_map(process, data, max_workers=args.num_workers, chunksize=100)
+
+ with open(args.manifest.replace('.json', '_decoded.json'), 'w') as f:
+ for item in tqdm.tqdm(data_new):
+ f.write(json.dumps(item) + '\n')
+
+It will write the resampled .wav-files to the specified directory and save a new json manifest with corrected audiopaths.
+
+**Note:** You need to repeat these steps for **test.tsv** and **dev.tsv** as well.
+
+******************
+Data Preprocessing
+******************
+
+Before we start training the model on the above manifest files, we need to preprocess the text data. Data pre-processing is done to reduce ambiguity in transcripts. This is an essential step, and often requires moderate expertise in the language.
+
+We used the following script
+**prepare_dataset_kinyarwanda.py**:
+
+.. code-block:: python
+
+ import json
+ import os
+ import re
+ from collections import defaultdict
+ from nemo.collections.asr.parts.utils.manifest_utils import read_manifest, write_manifest
+ from tqdm.auto import tqdm
+
+ def write_processed_manifest(data, original_path):
+ original_manifest_name = os.path.basename(original_path)
+ new_manifest_name = original_manifest_name.replace(".json", "_processed.json")
+
+ manifest_dir = os.path.split(original_path)[0]
+ filepath = os.path.join(manifest_dir, new_manifest_name)
+ write_manifest(filepath, data)
+ print(f"Finished writing manifest: {filepath}")
+ return filepath
+
+
+ # calculate the character set
+ def get_charset(manifest_data):
+ charset = defaultdict(int)
+ for row in tqdm(manifest_data, desc="Computing character set"):
+ text = row['text']
+ for character in text:
+ charset[character] += 1
+ return charset
+
+
+ # Preprocessing steps
+ def remove_special_characters(data):
+ chars_to_ignore_regex = "[\.\,\?\:\-!;()«»…\]\[/\*–‽+&_\\½√>€™$•¼}{~—=“\"”″‟„]"
+ apostrophes_regex = "[’'‘`ʽ']"
+ data["text"] = re.sub(chars_to_ignore_regex, " ", data["text"]) # replace punctuation by space
+ data["text"] = re.sub(apostrophes_regex, "'", data["text"]) # replace different apostrophes by one
+ data["text"] = re.sub(r"'+", "'", data["text"]) # merge multiple apostrophes
+
+ # remove spaces where apostrophe marks a deleted vowel
+ # this rule is taken from https://huggingface.co/lucio/wav2vec2-large-xlsr-kinyarwanda-apostrophied
+ data["text"] = re.sub(r"([b-df-hj-np-tv-z])' ([aeiou])", r"\1'\2", data["text"])
+
+ data["text"] = re.sub(r" '", " ", data["text"]) # delete apostrophes at the beginning of word
+ data["text"] = re.sub(r"' ", " ", data["text"]) # delete apostrophes at the end of word
+ data["text"] = re.sub(r" +", " ", data["text"]) # merge multiple spaces
+ return data
+
+
+ def replace_diacritics(data):
+ data["text"] = re.sub(r"[éèëēê]", "e", data["text"])
+ data["text"] = re.sub(r"[ãâāá]", "a", data["text"])
+ data["text"] = re.sub(r"[úūü]", "u", data["text"])
+ data["text"] = re.sub(r"[ôōó]", "o", data["text"])
+ data["text"] = re.sub(r"[ćç]", "c", data["text"])
+ data["text"] = re.sub(r"[ïī]", "i", data["text"])
+ data["text"] = re.sub(r"[ñ]", "n", data["text"])
+ return data
+
+
+ def remove_oov_characters(data):
+ oov_regex = "[^ 'aiuenrbomkygwthszdcjfvplxq]"
+ data["text"] = re.sub(oov_regex, "", data["text"]) # delete oov characters
+ data["text"] = data["text"].strip()
+ return data
+
+
+ # Processing pipeline
+ def apply_preprocessors(manifest, preprocessors):
+ for processor in preprocessors:
+ for idx in tqdm(range(len(manifest)), desc=f"Applying {processor.__name__}"):
+ manifest[idx] = processor(manifest[idx])
+
+ print("Finished processing manifest !")
+ return manifest
+
+
+ # List of pre-processing functions
+ PREPROCESSORS = [
+ remove_special_characters,
+ replace_diacritics,
+ remove_oov_characters,
+ ]
+
+ train_manifest = "train_decoded.json"
+ dev_manifest = "dev_decoded.json"
+ test_manifest = "test_decoded.json"
+
+ train_data = read_manifest(train_manifest)
+ dev_data = read_manifest(dev_manifest)
+ test_data = read_manifest(test_manifest)
+
+ # Apply preprocessing
+ train_data_processed = apply_preprocessors(train_data, PREPROCESSORS)
+ dev_data_processed = apply_preprocessors(dev_data, PREPROCESSORS)
+ test_data_processed = apply_preprocessors(test_data, PREPROCESSORS)
+
+ # Write new manifests
+ train_manifest_cleaned = write_processed_manifest(train_data_processed, train_manifest)
+ dev_manifest_cleaned = write_processed_manifest(dev_data_processed, dev_manifest)
+ test_manifest_cleaned = write_processed_manifest(test_data_processed, test_manifest)
+
+It performs the following operations:
+
+* Remove all punctuation except for apostrophes
+* Replace different kinds of apostrophes by one
+* Lowercase
+* Replace rare characters with diacritics (e.g. [éèëēê] => e)
+* Delete all remaining out-of-vocabulary (OOV) characters
+
+The final Kinyarwanda alphabet in all trancripts consists of Latin letters, space and apostrophe.
+
+*******************
+Building Tokenizers
+*******************
+
+Though it is possible to train character-based ASR model, usually we get some improvement in quality and speed if we predict longer units. The commonly used tokenization algorithm is called `Byte-pair encoding `_. This is a deterministic tokenization algorithm based on corpus statistics. It splits the words to subtokens and the beginning of word is marked by special symbol so it's easy to restore the original words.
+NeMo toolkit supports on-the-fly subword tokenization, so you need not modify the transcripts, but need to pass your tokenizer via the model config. NeMo supports both Word Piece Tokenizer (via HuggingFace) and Sentence Piece Tokenizer (via Google SentencePiece library)
+For Kinyarwanda experiments we used 128 subtokens for the CTC model and 1024 subtokens for the Transducer model. The tokenizers for these models were built using the text transcripts of the train set with this script. For vocabulary of size 1024 we restrict maximum subtoken length to 4 symbols (2 symbols for size 128) to avoid populating vocabulary with specific frequent words from the dataset. This does not affect the model performance and potentially helps to adapt to other domain without retraining tokenizer.
+We used the following script from NeMo toolkit to create `Sentencepiece `_ tokenizers with different vocabulary sizes (128 and 1024 subtokens)
+
+.. code-block:: bash
+
+ python ${NEMO_ROOT}/scripts/tokenizers/process_asr_text_tokenizer.py \
+ --manifest=dev_decoded_processed.json,train_decoded_processed.json \
+ --vocab_size=1024 \
+ --data_root=tokenizer_bpe_maxlen_4 \
+ --tokenizer="spe" \
+ --spe_type=bpe \
+ --spe_character_coverage=1.0 \
+ --spe_max_sentencepiece_length=4 \
+ --log
+
+ python ${NEMO_ROOT}/scripts/tokenizers/process_asr_text_tokenizer.py \
+ --manifest=dev_decoded_processed.json,train_decoded_processed.json \
+ --vocab_size=128 \
+ --data_root=tokenizer_bpe_maxlen_2 \
+ --tokenizer="spe" \
+ --spe_type=bpe \
+ --spe_character_coverage=1.0 \
+ --spe_max_sentencepiece_length=2 \
+ --log
+
+Most of the arguments are similar to those explained in the `ASR with Subword Tokenization tutorial `_.
+
+The resulting tokenizer is a folder like that:
+
+.. code-block:: bash
+
+ ├── tokenizer_spe_bpe_v1024_max_4
+ │ ├── tokenizer.model
+ │ ├── tokenizer.vocab
+ │ └── vocab.txt
+
+Remember that you will need to pass the path to tokenizer in the model config.
+You can see all the subtokens in the **vocab.txt** file.
+
+*****************************
+Tarred datasets and bucketing
+*****************************
+
+There are two useful techniques for training on large datasets.
+
+* Tarred dataset allows to store the dataset as large .tar files instead of small separate audio files. It speeds up the training and minimizes the load on the network in the cluster.
+* Bucketing groups utterances with similar duration. It reduces padding and speeds up the training.
+
+The NeMo toolkit provides a script to implement both of these techniques.
+
+.. code-block:: bash
+
+ ## create tarred dataset with 1 bucket
+ python ${NEMO_ROOT}/scripts/speech_recognition/convert_to_tarred_audio_dataset.py \
+ --manifest_path=train_decoded_processed.json \
+ --target_dir=train_tarred_1bk \
+ --num_shards=1024 \
+ --max_duration=11.0 \
+ --min_duration=1.0 \
+ --shuffle \
+ --shuffle_seed=1 \
+ --sort_in_shards \
+ --workers=-1
+
+
+ ## create tarred dataset with 4 buckets
+ python ${NEMO_ROOT}/scripts/speech_recognition/convert_to_tarred_audio_dataset.py \
+ --manifest_path=train_decoded_processed.json \
+ --target_dir=train_tarred_4bk \
+ --num_shards=1024 \
+ --max_duration=11.0 \
+ --min_duration=1.0 \
+ --shuffle \
+ --shuffle_seed=1 \
+ --sort_in_shards \
+ --workers=-1 \
+ --buckets_num=4
+
+**Note**: we only need to process train data, dev and test are usually much smaller and can be used as is.
+
+Our final dataset folder looks like this:
+
+.. code-block:: bash
+
+ ├── dev [15988 .wav files]
+ ├── dev_decoded_processed.json (dev manifest)
+ ├── test [16213 .wav files]
+ ├── test_decoded_processed.json (test manifest)
+ └── train_tarred_1bk
+ ├── metadata.yaml
+ ├── tarred_audio_manifest.json
+ └── [1024 .tar files]
+
+In case of 4 buckets it will look like:
+
+.. code-block:: bash
+
+ └── train_tarred_4bk
+ ├── bucket1
+ ├── metadata.yaml
+ ├── tarred_audio_manifest.json
+ └── [1024 .tar files]
+ ├── bucket2
+ ...
+ ├── bucket3
+ └── bucket4
+
+************************************
+Training from scratch and finetuning
+************************************
+
+ASR models
+##########
+
+Our goal was to train two ASR models with different architectures: `Conformer-CTC `_ and `Conformer-Transducer `_, with around 120 million parameters.
+The CTC model predicts output tokens for each timestep. The outputs are assumed to be independent of each other. As a result the CTC models work faster but they can produce outputs that are inconsistent with each other. CTC models are often combined with external language models in production. In contrast, the Transducer models contain the decoding part which generates the output tokens one by one and the next token prediction depends on this history. Due to autoregressive nature of decoding the inference speed is several times slower than that of CTC models, but the quality is usually better because it can incorporate language model information within the same model.
+
+Training scripts and configs
+############################
+
+To train a Conformer-CTC model, we use `speech_to_text_ctc_bpe.py `_ with the default config `conformer_ctc_bpe.yaml `_.
+To train a Conformer-Transducer model, we use `speech_to_text_rnnt_bpe.py `_ with the default config `conformer_transducer_bpe.yaml `_.
+Any options of default config can be overwritten from command line.
+Usually we should provide the options related to the dataset and tokenizer.
+
+This is an example of how we can run the training script:
+
+.. code-block:: bash
+
+ TOKENIZER=tokenizers/tokenizer_spe_bpe_v1024_max_4/
+ TRAIN_MANIFEST=data/train_tarred_1bk/tarred_audio_manifest.json
+ TRAIN_FILEPATHS=data/train_tarred_1bk/audio__OP_0..1023_CL_.tar
+ VAL_MANIFEST=data/dev_decoded_processed.json
+ TEST_MANIFEST=data/test_decoded_processed.json
+
+ python ${NEMO_ROOT}/examples/asr/asr_ctc/speech_to_text_ctc_bpe.py \
+ --config-path=../conf/conformer/ \
+ --config-name=conformer_ctc_bpe \
+ exp_manager.name="Some name of our experiment" \
+ exp_manager.resume_if_exists=true \
+ exp_manager.resume_ignore_no_checkpoint=true \
+ exp_manager.exp_dir=results/ \
+ model.tokenizer.dir=$TOKENIZER \
+ model.train_ds.is_tarred=true \
+ model.train_ds.tarred_audio_filepaths=$TRAIN_FILEPATHS \
+ model.train_ds.manifest_filepath=$TRAIN_MANIFEST \
+ model.validation_ds.manifest_filepath=$VAL_MANIFEST \
+ model.test_ds.manifest_filepath=$TEST_MANIFEST
+
+The option *exp_manager.resume_if_exists=true* allows to resume training. Actually you can stop training at any moment and then continue from the last checkpoint.
+When the training is finished, the final model will be saved as *.nemo* file inside the folder that we specified in *exp_manager.exp_dir*.
+
+Training dynamics
+#################
+
+The figure below shows the training dynamics when we train Kinyarwanda models **from scratch**. In these experiments we used the hyperparameters from the default configs, the training was run on 2 nodes with 16 gpus per node, training batch size was 32. We see that Transducer model achieves better quality than CTC.
+
+ .. image:: ../images/kinyarwanda_from_scratch.png
+ :align: center
+ :alt: Training dynamics of Kinyarwanda models trained from scratch
+ :width: 800px
+
+Finetuning from another model
+#############################
+
+Often it's a good idea to initialize our ASR model with the weights of some other pretrained model, for example, a model for another language. It usually makes our model to converge faster and achieve better quality, especially if the dataset for our target language is small.
+
+Though Kinyarwanda dataset is rather large, we also tried finetuning Kinyarwanda Conformer-Transducer model from different pretrained checkpoints, namely:
+
+* English Conformer-Transducer checkpoint
+* Self-supervised Learning (SSL) checkpoint trained on English data
+* SSL checkpoint trained on multilingual data
+
+To initialize from **non-SSL checkpoint** we should simply add the option `+init_from_pretrained_model`:
+
+.. code-block:: bash
+
+ INIT_MODEL='stt_en_conformer_ctc_large'
+
+ python ${NEMO_ROOT}/examples/asr/asr_ctc/speech_to_text_ctc_bpe.py
+ ...[same options as in the previous example]...
+ +init_from_pretrained_model=${INIT_MODEL}
+
+In that case the pretrained model `stt_en_conformer_ctc_large `_ will be automatically downloaded from NVIDIA GPU Cloud(NGC) and used to initialize weights before training.
+
+To initialize from **SSL checkpoint** we should edit our training script like the following code:
+
+.. code-block:: python
+
+ import nemo.collections.asr as nemo_asr
+ ssl_model = nemo_asr.models.ssl_models.SpeechEncDecSelfSupervisedModel.from_pretrained(model_name='ssl_en_conformer_large')
+
+ # define fine-tune model
+ asr_model = nemo_asr.models.EncDecCTCModelBPE(cfg=cfg.model, trainer=trainer)
+
+ # load ssl checkpoint
+ asr_model.load_state_dict(ssl_model.state_dict(), strict=False)
+
+ del ssl_model
+
+When using finetuning you probably will need to change the some hyperparameters from the default config, especially the learning rate and learning rate policy. In the experiments below we used *model.optim.sched.name=CosineAnnealing* and *model.optim.lr=1e-3*.
+
+The figure below compares the training dynamics for three Conformer-Transducer models. They differ only by how they are initialized. We see that finetuning leads to faster convergence and better quality. Initializing from SSL gives lowest WER at earlier stages, but in a longer period it performs worse.
+
+ .. image:: ../images/kinyarwanda_finetuning.png
+ :align: center
+ :alt: Training dynamics of Kinyarwanda models trained from scratch and finetuned from different pretrained checkpoints
+ :width: 800px
+
+************************
+Inference and evaluation
+************************
+
+Running the inference
+#####################
+
+To run the inference we need a pretrained model. This can be either a `.nemo` file that we get after the training is finished, or any published model from `NGC `_.
+We run the inference using the following script:
+
+.. code-block:: bash
+
+ python ${NEMO_ROOT}/examples/asr/transcribe_speech.py \
+ model_path=.nemo \
+ dataset_manifest=./test_decoded_processed.json \
+ output_filename=./test_with_predictions.json \
+ batch_size=8 \
+ cuda=1 \
+ amp=True
+
+To run inference with NVIDIA's Kinyarwanda checkpoints `STT Rw Conformer-CTC Large `_ or `STT Rw Conformer-Transducer Large `_ use:
+
+.. code-block:: bash
+
+ python ${NEMO_ROOT}/examples/asr/transcribe_speech.py \
+ pretrained_name="stt_rw_conformer_ctc_large" \
+ dataset_manifest=test_decoded_processed.json \
+ output_filename=./pred_ctc.json \
+ batch_size=8 \
+ cuda=1 \
+ amp=True
+
+**Note:** If you want to transcribe new audios, you can pass a folder with audio files using `audio_dir` parameter instead of `dataset_manifest`.
+
+After the inference is finished the `output_filename` is a `.json` manifest augmented with a new field `pred_text` containing the resulting transcript. Example:
+
+.. code-block::
+
+ {"audio_filepath": "test/common_voice_rw_19835615.wav", "text": "kw'ibumoso", "up_votes": 2, "down_votes": 0, "age": NaN, "gender": NaN, "accents": NaN, "client_id": "66675a7003e6baa3e7d4af01bff8324ac3c5f15e7f8918180799dd2928227c791f19e2811f9ec5779a2b06dac1b7a97fa7740dcfe98646ea1b5e106250c260be", "duration": 3.672, "pred_text": "n'ibumoso"}
+ {"audio_filepath": "test/common_voice_rw_24795878.wav", "text": "ni ryari uheruka kurya urusenda", "up_votes": 2, "down_votes": 0, "age": NaN, "gender": NaN, "accents": NaN, "client_id": "90e0438947a75b6c0cf59a0444aee3b81a76c5f9459c4b22df2e14b4ce257aeacaed8ac6092bfcd75b8e831633d58a84287fd62190c21d70d75efe8d93ed74ed", "duration": 3.312, "pred_text": "ni ryari uheruka kurya urusenda"}
+ {"audio_filepath": "test/common_voice_rw_24256935.wav", "text": "umunani", "up_votes": 2, "down_votes": 0, "age": NaN, "gender": NaN, "accents": NaN, "client_id": "974d4876e99e7437183c20f9107053acc9e514379d448bcf00aaaabc0927f5380128af86d39650867fa80a82525110dfc40784a5371c989de1a5bdf531f6d943", "duration": 3.24, "pred_text": "umunani"}
+
+Word Error Rate (WER) and Character Error Rate (CER)
+####################################################
+
+As soon as we have a manifest file with `text` and `pred_text` we can measure the quality of predictions of our model.
+
+.. code-block:: bash
+
+ # Calculate WER
+ python ${NEMO_ROOT}/examples/asr/speech_to_text_eval.py \
+ dataset_manifest=test_with_predictions.json \
+ use_cer=False \
+ only_score_manifest=True
+
+ # Calculate CER
+ python ${NEMO_ROOT}/examples/asr/speech_to_text_eval.py \
+ dataset_manifest=test_with_predictions.json \
+ use_cer=True \
+ only_score_manifest=True
+
+
+Evaluation of NVIDIA's Kinyarwanda checkpoints
+##############################################
+
+If you run inference and evaluation of NVIDIA's published Kinyarwanda models, you should get metrics like these:
+
++----------------------------------+-------+-------+
+| Model | WER % | CER % |
++==================================+=======+=======+
+| stt_rw_conformer_ctc_large | 18.22 | 5.45 |
++----------------------------------+-------+-------+
+| stt_rw_conformer_trasducer_large | 16.19 | 5.7 |
++----------------------------------+-------+-------+
+
+Error analysis
+##############
+
+Still, even WER of 16% is not as good as we usually get for other languages trained with NeMo toolkit, so we may want to look at the errors that the model makes to better understand what's the problem.
+
+We can use `Speech Data Explorer `_ to analyze the errors.
+
+If we run
+
+.. code-block:: bash
+
+ python ${NEMO_ROOT}/tools/speech_data_explorer/data_explorer.py
+
+it will start a local server, and provide a http address to open from the browser.
+In the UI we can see the model predictions and their diff with the reference, and also we can listen to the corresponding audio. We also can sort the sentences by descending WER and look through the top of them.
+
+The error analysis showed several problems concerning the Kinyarwanda dataset:
+
+* Noisy multi-speaker records (e.g. common_voice_rw_19830859.wav)
+* Bad quality of record (e.g. common_voice_rw_24452415.wav)
+* Orthographic variability related to space/no space/apostrophe
+ * *kugira ngo / kugirango*
+ * *nkuko / nk'uko*
+ * *n iyo / n'iyo*
+* Multiple orthographic variants for foreign words
+ * *telefoni / telephone*
+ * *film / filime*
+ * *isiraheli / israel*
+ * *radio / radiyo*
+ * *kongo / congo*
+* l/r variability
+ * *abamalayika / abamarayika*
+
+
diff --git a/docs/source/asr/images/citrinet_vertical.png b/docs/source/asr/images/citrinet_vertical.png
new file mode 100644
index 0000000000000000000000000000000000000000..a9a7f8c2e8530dd866aa46aa95f5c59fa56b442f
Binary files /dev/null and b/docs/source/asr/images/citrinet_vertical.png differ
diff --git a/docs/source/asr/images/conformer_ctc.png b/docs/source/asr/images/conformer_ctc.png
new file mode 100644
index 0000000000000000000000000000000000000000..e491856502ed39793d631633cfc3d4da5b7d5e53
Binary files /dev/null and b/docs/source/asr/images/conformer_ctc.png differ
diff --git a/docs/source/asr/images/ctc_asr.png b/docs/source/asr/images/ctc_asr.png
new file mode 100644
index 0000000000000000000000000000000000000000..56ef705602da10b6dca5e5f01afd66bc1f5230d7
Binary files /dev/null and b/docs/source/asr/images/ctc_asr.png differ
diff --git a/docs/source/asr/images/jasper_layers.png b/docs/source/asr/images/jasper_layers.png
new file mode 100644
index 0000000000000000000000000000000000000000..af88379af98f95cd02141b9dfcb669ead346700c
Binary files /dev/null and b/docs/source/asr/images/jasper_layers.png differ
diff --git a/docs/source/asr/images/jasper_vertical.png b/docs/source/asr/images/jasper_vertical.png
new file mode 100644
index 0000000000000000000000000000000000000000..13ba93c2c73b0b186a26076e1581698ede4f6da5
Binary files /dev/null and b/docs/source/asr/images/jasper_vertical.png differ
diff --git a/docs/source/asr/images/kinyarwanda_finetuning.png b/docs/source/asr/images/kinyarwanda_finetuning.png
new file mode 100644
index 0000000000000000000000000000000000000000..1cbce4a6293f78dbcc7201fba03dd7f5d0480753
Binary files /dev/null and b/docs/source/asr/images/kinyarwanda_finetuning.png differ
diff --git a/docs/source/asr/images/kinyarwanda_from_scratch.png b/docs/source/asr/images/kinyarwanda_from_scratch.png
new file mode 100644
index 0000000000000000000000000000000000000000..2aa58ab61c16f12a4d5ee9e24b34e55391f41feb
Binary files /dev/null and b/docs/source/asr/images/kinyarwanda_from_scratch.png differ
diff --git a/docs/source/asr/images/quartz_vertical.png b/docs/source/asr/images/quartz_vertical.png
new file mode 100644
index 0000000000000000000000000000000000000000..4cbede907736f631cb9774b207289a35dd07c757
Binary files /dev/null and b/docs/source/asr/images/quartz_vertical.png differ
diff --git a/docs/source/asr/images/squeezeformer.png b/docs/source/asr/images/squeezeformer.png
new file mode 100644
index 0000000000000000000000000000000000000000..b6e1b218499cf461bab48e832c66c59c741cc1cb
Binary files /dev/null and b/docs/source/asr/images/squeezeformer.png differ
diff --git a/docs/source/asr/intro.rst b/docs/source/asr/intro.rst
new file mode 100644
index 0000000000000000000000000000000000000000..e655da836a760d70a8957221e59aa889c9134877
--- /dev/null
+++ b/docs/source/asr/intro.rst
@@ -0,0 +1,58 @@
+Automatic Speech Recognition (ASR)
+==================================
+
+ASR, or Automatic Speech Recognition, refers to the problem of getting a program to automatically transcribe spoken language
+(speech-to-text). Our goal is usually to have a model that minimizes the Word Error Rate (WER) metric when transcribing speech input.
+In other words, given some audio file (e.g. a WAV file) containing speech, how do we transform this into the corresponding text with
+as few errors as possible?
+
+Traditional speech recognition takes a generative approach, modeling the full pipeline of how speech sounds are produced in order to
+evaluate a speech sample. We would start from a language model that encapsulates the most likely orderings of words that are generated
+(e.g. an n-gram model), to a pronunciation model for each word in that ordering (e.g. a pronunciation table), to an acoustic model that
+translates those pronunciations to audio waveforms (e.g. a Gaussian Mixture Model).
+
+Then, if we receive some spoken input, our goal would be to find the most likely sequence of text that would result in the given audio
+according to our generative pipeline of models. Overall, with traditional speech recognition, we try to model ``Pr(audio|transcript)*Pr(transcript)``,
+and take the argmax of this over possible transcripts.
+
+Over time, neural nets advanced to the point where each component of the traditional speech recognition model could be replaced by a
+neural model that had better performance and that had a greater potential for generalization. For example, we could replace an n-gram
+model with a neural language model, and replace a pronunciation table with a neural pronunciation model, and so on. However, each of
+these neural models need to be trained individually on different tasks, and errors in any model in the pipeline could throw off the
+whole prediction.
+
+Thus, we can see the appeal of end-to-end ASR architectures: discriminative models that simply take an audio input and give a textual
+output, and in which all components of the architecture are trained together towards the same goal. The model's encoder would be
+akin to an acoustic model for extracting speech features, which can then be directly piped to a decoder which outputs text. If desired,
+we could integrate a language model that would improve our predictions, as well.
+
+And the entire end-to-end ASR model can be trained at once--a much easier pipeline to handle!
+
+A demo below allows evaluation of NeMo ASR models in multiple langauges from the browser:
+
+.. raw:: html
+
+
+
+
+
+
+The full documentation tree is as follows:
+
+.. toctree::
+ :maxdepth: 8
+
+ models
+ datasets
+ asr_language_modeling
+ results
+ scores
+ configs
+ api
+ resources
+ examples/kinyarwanda_asr.rst
+
+.. include:: resources.rst
diff --git a/docs/source/asr/models.rst b/docs/source/asr/models.rst
new file mode 100644
index 0000000000000000000000000000000000000000..ed9fb63e745381de6b841b9d0c4c09020e0ab84c
--- /dev/null
+++ b/docs/source/asr/models.rst
@@ -0,0 +1,287 @@
+Models
+======
+
+This section gives a brief overview of the models that NeMo's ASR collection currently supports.
+
+Each of these models can be used with the example ASR scripts (in the ``/examples/asr`` directory) by
+specifying the model architecture in the config file used. Examples of config files for each model can be found in
+the ``/examples/asr/conf`` directory.
+
+For more information about the config files and how they should be structured, refer to the :doc:`./configs` section.
+
+Pretrained checkpoints for all of these models, as well as instructions on how to load them, can be found in the :doc:`./results`
+section. You can use the available checkpoints for immediate inference, or fine-tune them on your own datasets. The checkpoints section
+also contains benchmark results for the available ASR models.
+
+.. _Jasper_model:
+
+Jasper
+------
+
+Jasper ("Just Another Speech Recognizer") :cite:`asr-models-li2019jasper` is a deep time delay neural network (TDNN) comprising of
+blocks of 1D-convolutional layers. The Jasper family of models are denoted as ``Jasper_[BxR]`` where ``B`` is the number of blocks
+and ``R`` is the number of convolutional sub-blocks within a block. Each sub-block contains a 1-D convolution, batch normalization,
+ReLU, and dropout:
+
+ .. image:: images/jasper_vertical.png
+ :align: center
+ :alt: jasper model
+ :scale: 50%
+
+Jasper models can be instantiated using the :class:`~nemo.collections.asr.models.EncDecCTCModel` class.
+
+QuartzNet
+---------
+
+QuartzNet :cite:`asr-models-kriman2019quartznet` is a version of Jasper :cite:`asr-models-li2019jasper` model with separable
+convolutions and larger filters. It can achieve performance similar to Jasper but with an order of magnitude fewer parameters.
+Similarly to Jasper, the QuartzNet family of models are denoted as ``QuartzNet_[BxR]`` where ``B`` is the number of blocks and ``R``
+is the number of convolutional sub-blocks within a block. Each sub-block contains a 1-D *separable* convolution, batch normalization,
+ReLU, and dropout:
+
+ .. image:: images/quartz_vertical.png
+ :align: center
+ :alt: quartznet model
+ :scale: 40%
+
+QuartzNet models can be instantiated using the :class:`~nemo.collections.asr.models.EncDecCTCModel` class.
+
+.. _Citrinet_model:
+
+Citrinet
+--------
+
+Citrinet is a version of QuartzNet :cite:`asr-models-kriman2019quartznet` that extends ContextNet :cite:`asr-models-han2020contextnet`,
+utilizing subword encoding (via Word Piece tokenization) and Squeeze-and-Excitation mechanism :cite:`asr-models-hu2018squeeze` to
+obtain highly accurate audio transcripts while utilizing a non-autoregressive CTC based decoding scheme for efficient inference.
+
+ .. image:: images/citrinet_vertical.png
+ :align: center
+ :alt: citrinet model
+ :scale: 50%
+
+Citrinet models can be instantiated using the :class:`~nemo.collections.asr.models.EncDecCTCModelBPE` class.
+
+.. _ContextNet_model:
+
+ContextNet
+----------
+
+ContextNet is a model uses Transducer/RNNT loss/decoder and is introduced in :cite:`asr-models-han2020contextnet`.
+It uses Squeeze-and-Excitation mechanism :cite:`asr-models-hu2018squeeze` to model larger context.
+Unlike Citrinet, it has an autoregressive decoding scheme.
+
+ContextNet models can be instantiated using the :class:`~nemo.collections.asr.models.EncDecRNNTBPEModel` class for a
+model with sub-word encoding and :class:`~nemo.collections.asr.models.EncDecRNNTModel` for char-based encoding.
+
+You may find the example config files of ContextNet model with character-based encoding at
+``/examples/asr/conf/contextnet_rnnt/contextnet_rnnt_char.yaml`` and
+with sub-word encoding at ``/examples/asr/conf/contextnet_rnnt/contextnet_rnnt.yaml``.
+
+.. _Conformer-CTC_model:
+
+Conformer-CTC
+-------------
+
+Conformer-CTC is a CTC-based variant of the Conformer model introduced in :cite:`asr-models-gulati2020conformer`. Conformer-CTC has a
+similar encoder as the original Conformer but uses CTC loss and decoding instead of RNNT/Transducer loss, which makes it a non-autoregressive model.
+We also drop the LSTM decoder and instead use a linear decoder on the top of the encoder. This model uses the combination of
+self-attention and convolution modules to achieve the best of the two approaches, the self-attention layers can learn the global
+interaction while the convolutions efficiently capture the local correlations. The self-attention modules support both regular
+self-attention with absolute positional encoding, and also Transformer-XL's self-attention with relative positional encodings.
+
+Here is the overall architecture of the encoder of Conformer-CTC:
+
+ .. image:: images/conformer_ctc.png
+ :align: center
+ :alt: Conformer-CTC Model
+ :scale: 50%
+
+This model supports both the sub-word level and character level encodings. You can find more details on the config files for the
+Conformer-CTC models at `Conformer-CTC <./configs.html#conformer-ctc>`_. The variant with sub-word encoding is a BPE-based model
+which can be instantiated using the :class:`~nemo.collections.asr.models.EncDecCTCModelBPE` class, while the
+character-based variant is based on :class:`~nemo.collections.asr.models.EncDecCTCModel`.
+
+You may find the example config files of Conformer-CTC model with character-based encoding at
+``/examples/asr/conf/conformer/conformer_ctc_char.yaml`` and
+with sub-word encoding at ``/examples/asr/conf/conformer/conformer_ctc_bpe.yaml``.
+
+.. _Conformer-Transducer_model:
+
+Conformer-Transducer
+--------------------
+
+Conformer-Transducer is the Conformer model introduced in :cite:`asr-models-gulati2020conformer` and uses RNNT/Transducer loss/decoder.
+It has the same encoder as Conformer-CTC but utilizes RNNT/Transducer loss/decoder which makes it an autoregressive model.
+
+Most of the config file for Conformer-Transducer models are similar to Conformer-CTC except the sections related to the decoder and loss: decoder, loss, joint, decoding.
+You may take a look at our `tutorials page <../starthere/tutorials.html>`_ on Transducer models to become familiar with their configs:
+`Introduction to Transducers `_ and
+`ASR with Transducers `_
+You can find more details on the config files for the Conformer-Transducer models at `Conformer-CTC <./configs.html#conformer-ctc>`_.
+
+This model supports both the sub-word level and character level encodings. The variant with sub-word encoding is a BPE-based model
+which can be instantiated using the :class:`~nemo.collections.asr.models.EncDecRNNTBPEModel` class, while the
+character-based variant is based on :class:`~nemo.collections.asr.models.EncDecRNNTModel`.
+
+You may find the example config files of Conformer-Transducer model with character-based encoding at
+``/examples/asr/conf/conformer/conformer_transducer_char.yaml`` and
+with sub-word encoding at ``/examples/asr/conf/conformer/conformer_transducer_bpe.yaml``.
+
+Fast-Conformer
+--------------
+
+The Fast Conformer (CTC and RNNT) models have a faster version of the Conformer encoder and differ from it as follows:
+
+* 8x depthwise convolutional subsampling with 256 channels
+* Reduced convolutional kernel size of 9 in the conformer blocks
+
+The Fast Conformer encoder is about 2.4x faster than the regular Conformer encoder without a significant model quality degradation.
+128 subsampling channels yield a 2.7x speedup vs baseline but model quality starts to degrade.
+With local attention, inference is possible on audios >1 hrs (256 subsampling channels) / >2 hrs (128 channels).
+
+Fast Conformer models were trained using CosineAnnealing (instead of Noam) as the scheduler.
+
+You may find the example CTC config at
+``/examples/asr/conf/fastconformer/fast-conformer_ctc_bpe.yaml`` and
+the transducer config at ``/examples/asr/conf/fastconformer/fast-conformer_transducer_bpe.yaml``
+
+Note that both configs are subword-based (BPE).
+
+Cache-aware Streaming Conformer
+-------------------------------
+
+Buffered streaming uses overlapping chunks to make an offline ASR model to be used for streaming with reasonable accuracy. However, it uses significant amount of duplication in computations due to the overlapping chunks.
+Also there is a accuracy gep between the offline model and the streaming one as there is inconsistency between how we train the model and how we perform inference for streaming.
+The Cache-aware Streaming Conformer models would tackle and address these disadvantages. These streaming Conformers are trained with limited right context that it would make it possible to match how the model is being used in both the training and inference.
+They also uses caching to store intermediate activations to avoid any duplication in compute.
+The cache-aware approach is supported for both the Conformer-CTC and Conformer-Transducer and enables the model to be used very efficiently for streaming.
+
+Three categories of layers in Conformer have access to right tokens: 1-depthwise convolutions 2-self-attention, and 3-convolutions in the downsampling layers.
+Streaming Conformer models uses causal convolutions or convolutions with lower right context and also self-attention with limited right context to limit the effective right context for the input.
+The model trained with such limitations can be used in streaming mode and give the exact same outputs and accuracy as when the whole audio is given to the model in offline mode.
+These model can use caching mechanism to store and reuse the activations during streaming inference to avoid any duplications in the computations as much as possible.
+
+We support the following three right context modeling:
+
+* fully causal model with zero look-ahead: tokens would not see any future tokens. convolution layers are all causal and right tokens are masked for self-attention.
+
+It gives zero latency but with limited accuracy.
+To train such a model, you need to set `encoder.att_context_size=[left_context, 0]` and `encoder.conv_context_size=causal` in the config.
+
+* regular look-ahead: convolutions would be able to see few future frames, and self-attention would also see the same number of future tokens.
+
+In this approach the activations for the look-ahead part is not cached and recalculated in the next chunks. The right context in each layer should be a small number as multiple layers would increase the effective context size and then increase the look-ahead size and latency.
+For example for a model of 17 layers with 4x downsampling and 10ms window shift, then even 2 right context in each layer means 17*2*10*4=1360ms look-ahead. Each step after the downsampling corresponds to 4*10=40ms.
+
+* chunk-aware look-ahead: input is split into equal chunks. Convolutions are fully causal while self-attention layers would be able to see all the tokens in their corresponding chunk.
+
+For example, in a model which chunk size of 20 tokens, tokens at the first position of each chunk would see all the next 19 tokens while the last token would see zero future tokens.
+This approach is more efficient than regular look-ahead in terms of computations as the activations for most of the look-ahead part would be cached and there is close to zero duplications in the calculations.
+In terms of accuracy, this approach gives similar or even better results in term of accuracy than regular look-ahead as each token in each layer have access to more tokens on average. That is why we recommend to use this approach for streaming.
+
+
+** Note: Latencies are based on the assumption that the forward time of the network is zero and it just estimates the time needed after a frame would be available until it is passed through the model.
+
+Approaches with non-zero look-ahead can give significantly better accuracy by sacrificing latency. The latency can get controlled by the left context size. Increasing the right context would help the accuracy to a limit but would increase the compuation time.
+
+
+In all modes, left context can be controlled by the number of tokens to be visible in the self-attention and the kernel size of the convolutions.
+For example, if left context of self-attention in each layer is set to 20 tokens and there are 10 layers of Conformer, then effective left context is 20*10=200 tokens.
+Left context of self-attention for regular look-ahead can be set as any number while it should be set as a multiplication of the right context in chunk-aware look-ahead.
+For convolutions, if we use a left context of 30 in such model, then there would be 30*10=300 effective left context.
+Left context of convolutions is dependent to the their kernel size while it can be any number for self-attention layers. Higher left context for self-attention means larger cache and more computations for the self-attention.
+Self-attention left context of around 6 secs would give close result to have unlimited left context. For a model with 4x downsampling and shift window of 10ms in the preprocessor, each token corresponds to 4*10=40ms.
+
+If striding approach is used for downsampling, all the convolutions in downsampling would be fully causal and don't see future tokens.
+You may use stacking for downsampling in the streaming models which is significantly faster and uses less memory.
+It also does not some of the the limitations with striding and vggnet and you may use any downsampling rate.
+
+You may find the example config files of cache-aware streaming Conformer models at
+``/examples/asr/conf/conformer/streaming/conformer_transducer_bpe_streaming.yaml`` for Transducer variant and
+at ``/examples/asr/conf/conformer/streaming/conformer_ctc_bpe.yaml`` for CTC variant.
+
+To simulate cache-aware streaming, you may use the script at ``/examples/asr/asr_cache_aware_streaming/speech_to_text_cache_aware_streaming_infer.py``. It can simulate streaming in single stream or multi-stream mode (in batches) for an ASR model.
+This script can be used for models trained offline with full-context but the accuracy would not be great unless the chunk size is large enough which would result in high latency.
+It is recommended to train a model in streaming model with limited context for this script. More info can be found in the script.
+
+.. _LSTM-Transducer_model:
+
+LSTM-Transducer
+---------------
+
+LSTM-Transducer is a model which uses RNNs (eg. LSTM) in the encoder. The architecture of this model is followed from suggestions in :cite:`asr-models-he2019streaming`.
+It uses RNNT/Transducer loss/decoder. The encoder consists of RNN layers (LSTM as default) with lower projection size to increase the efficiency.
+Layer norm is added between the layers to stabilize the training.
+It can be trained/used in unidirectional or bidirectional mode. The unidirectional mode is fully causal and can be used easily for simple and efficient streaming. However the accuracy of this model is generally lower than other models like Conformer and Citrinet.
+
+This model supports both the sub-word level and character level encodings. You may find the example config file of RNNT model with wordpiece encoding at ``/examples/asr/conf/lstm/lstm_transducer_bpe.yaml``.
+You can find more details on the config files for the RNNT models at `LSTM-Transducer <./configs.html#lstm-transducer>`_.
+
+.. _LSTM-CTC_model:
+
+LSTM-CTC
+--------
+
+LSTM-CTC model is a CTC-variant of the LSTM-Transducer model which uses CTC loss/decoding instead of Transducer.
+You may find the example config file of LSTM-CTC model with wordpiece encoding at ``/examples/asr/conf/lstm/lstm_ctc_bpe.yaml``.
+
+.. _Squeezeformer-CTC_model:
+
+Squeezeformer-CTC
+-----------------
+
+Squeezeformer-CTC is a CTC-based variant of the Squeezeformer model introduced in :cite:`asr-models-kim2022squeezeformer`. Squeezeformer-CTC has a
+similar encoder as the original Squeezeformer but uses CTC loss and decoding instead of RNNT/Transducer loss, which makes it a non-autoregressive model. The vast majority of the architecture is similar to Conformer model, so please refer to `Conformer-CTC <./models.html#conformer-ctc>`_.
+
+The model primarily differs from Conformer in the following ways :
+
+* Temporal U-Net style time reduction, effectively reducing memory consumption and FLOPs for execution.
+* Unified activations throughout the model.
+* Simplification of module structure, removal of redundant layers.
+
+Here is the overall architecture of the encoder of Squeezeformer-CTC:
+
+ .. image:: images/squeezeformer.png
+ :align: center
+ :alt: Squeezeformer-CTC Model
+ :scale: 50%
+
+This model supports both the sub-word level and character level encodings. You can find more details on the config files for the
+Squeezeformer-CTC models at `Squeezeformer-CTC <./configs.html#squeezeformer-ctc>`_. The variant with sub-word encoding is a BPE-based model
+which can be instantiated using the :class:`~nemo.collections.asr.models.EncDecCTCModelBPE` class, while the
+character-based variant is based on :class:`~nemo.collections.asr.models.EncDecCTCModel`.
+
+You may find the example config files of Squeezeformer-CTC model with character-based encoding at
+``/examples/asr/conf/squeezeformer/squeezeformer_ctc_char.yaml`` and
+with sub-word encoding at ``/examples/asr/conf/squeezeformer/squeezeformer_ctc_bpe.yaml``.
+
+.. _Hybrid-Transducer_CTC_model:
+
+Hybrid-Transducer-CTC
+---------------------
+
+Hybrid RNNT-CTC models is a group of models with both the RNNT and CTC decoders. Training a unified model would speedup the convergence for the CTC models and would enable
+the user to use a single model which works as both a CTC and RNNT model. This category can be used with any of the ASR models.
+Hybrid models uses two decoders of CTC and RNNT on the top of the encoder. The default decoding strategy after the training is done is RNNT.
+User may use the ``asr_model.change_decoding_strategy(decoder_type='ctc' or 'rnnt')`` to change the default decoding.
+
+The variant with sub-word encoding is a BPE-based model
+which can be instantiated using the :class:`~nemo.collections.asr.models.EncDecHybridRNNTCTCBPEModel` class, while the
+character-based variant is based on :class:`~nemo.collections.asr.models.EncDecHybridRNNTCTCModel`.
+
+You may use the example scripts under ``/examples/asr/asr_hybrid_transducer_ctc`` for both the char-based encoding and sub-word encoding.
+These examples can be used to train any Hybrid ASR model like Conformer, Citrinet, QuartzNet, etc.
+
+You may find the example config files of Conformer variant of such hybrid models with character-based encoding at
+``/examples/asr/conf/conformer/hybrid_transducer_ctc/conformer_hybrid_transducer_ctc_char.yaml`` and
+with sub-word encoding at ``/examples/asr/conf/conformer/hybrid_transducer_ctc/conformer_hybrid_transducer_ctc_bpe.yaml``.
+
+
+References
+----------
+
+.. bibliography:: asr_all.bib
+ :style: plain
+ :labelprefix: ASR-MODELS
+ :keyprefix: asr-models-
diff --git a/docs/source/asr/resources.rst b/docs/source/asr/resources.rst
new file mode 100644
index 0000000000000000000000000000000000000000..e192f5fbe83d72f812aafdec557fd8ab739e86c4
--- /dev/null
+++ b/docs/source/asr/resources.rst
@@ -0,0 +1,17 @@
+Resources and Documentation
+---------------------------
+
+Hands-on speech recognition tutorial notebooks can be found under `the ASR tutorials folder `_.
+If you are a beginner to NeMo, consider trying out the `ASR with NeMo `_ tutorial.
+This and most other tutorials can be run on Google Colab by specifying the link to the notebooks' GitHub pages on Colab.
+
+If you are looking for information about a particular ASR model, or would like to find out more about the model
+architectures available in the `nemo_asr` collection, refer to the :doc:`Models <./models>` section.
+
+NeMo includes preprocessing scripts for several common ASR datasets. The :doc:`Datasets <./datasets>` section contains instructions on
+running those scripts. It also includes guidance for creating your own NeMo-compatible dataset, if you have your own data.
+
+Information about how to load model checkpoints (either local files or pretrained ones from NGC), as well as a list of the checkpoints
+available on NGC are located on the :doc:`Checkpoints <./results>` section.
+
+Documentation regarding the configuration files specific to the ``nemo_asr`` models can be found on the :doc:`Configuration Files <./configs>` section.
diff --git a/docs/source/asr/results.rst b/docs/source/asr/results.rst
new file mode 100644
index 0000000000000000000000000000000000000000..97b2aeb9550ec067cdf1cc5a2e20f01e0b7c62d6
--- /dev/null
+++ b/docs/source/asr/results.rst
@@ -0,0 +1,253 @@
+Checkpoints
+===========
+
+There are two main ways to load pretrained checkpoints in NeMo:
+
+* Using the :code:`restore_from()` method to load a local checkpoint file (``.nemo``), or
+* Using the :code:`from_pretrained()` method to download and set up a checkpoint from NGC.
+
+Refer to the following sections for instructions and examples for each.
+
+Note that these instructions are for loading fully trained checkpoints for evaluation or fine-tuning. For resuming an unfinished
+training experiment, use the Experiment Manager to do so by setting the ``resume_if_exists`` flag to ``True``.
+
+Loading Local Checkpoints
+-------------------------
+
+NeMo automatically saves checkpoints of a model that is trained in a ``.nemo`` format. Alternatively, to manually save the model at any
+point, issue :code:`model.save_to(.nemo)`.
+
+If there is a local ``.nemo`` checkpoint that you'd like to load, use the :code:`restore_from()` method:
+
+.. code-block:: python
+
+ import nemo.collections.asr as nemo_asr
+ model = nemo_asr.models..restore_from(restore_path="")
+
+Where the model base class is the ASR model class of the original checkpoint, or the general ``ASRModel`` class.
+
+NGC Pretrained Checkpoints
+--------------------------
+
+The ASR collection has checkpoints of several models trained on various datasets for a variety of tasks. These checkpoints are
+obtainable via NGC `NeMo Automatic Speech Recognition collection `_.
+The model cards on NGC contain more information about each of the checkpoints available.
+
+The tables below list the ASR models available from NGC. The models can be accessed via the :code:`from_pretrained()` method inside
+the ASR Model class. In general, you can load any of these models with code in the following format:
+
+.. code-block:: python
+
+ import nemo.collections.asr as nemo_asr
+ model = nemo_asr.models.ASRModel.from_pretrained(model_name="")
+
+Where the model name is the value under "Model Name" entry in the tables below.
+
+For example, to load the base English QuartzNet model for speech recognition, run:
+
+.. code-block:: python
+
+ model = nemo_asr.models.ASRModel.from_pretrained(model_name="QuartzNet15x5Base-En")
+
+You can also call :code:`from_pretrained()` from the specific model class (such as :code:`EncDecCTCModel`
+for QuartzNet) if you need to access a specific model functionality.
+
+If you would like to programmatically list the models available for a particular base class, you can use the
+:code:`list_available_models()` method.
+
+.. code-block:: python
+
+ nemo_asr.models..list_available_models()
+
+Transcribing/Inference
+^^^^^^^^^^^^^^^^^^^^^^
+
+To perform inference and transcribe a sample of speech after loading the model, use the ``transcribe()`` method:
+
+.. code-block:: python
+
+ model.transcribe(paths2audio_files=[list of audio files], batch_size=BATCH_SIZE, logprobs=False)
+
+Setting the argument ``logprobs`` to ``True`` returns the log probabilities instead of transcriptions. For more information, see `nemo.collections.asr.modules <./api.html#modules>`__.
+The audio files should be 16KHz mono-channel wav files.
+
+Inference on long audio
+^^^^^^^^^^^^^^^^^^^^^^
+
+In some cases the audio is too long for standard inference, especially if you're using a model such as Conformer, where the time and memory costs of the attention layers scale quadratically with the duration.
+
+There are two main ways of performing inference on long audio files in NeMo:
+
+The first way is to use buffered inference, where the audio is divided into chunks to run on, and the output is merged afterwards.
+The relevant scripts for this are contained in `this folder `_.
+
+The second way, specifically for models with the Conformer encoder, is to convert to local attention, which changes the costs to be linear.
+This can be done even for models trained with full attention, though may result in lower WER in some cases. You can switch to local attention when running the
+`transcribe `_ or `evaluation `_
+scripts in the following way:
+
+.. code-block:: python
+
+ python speech_to_text_eval.py \
+ (...other parameters...) \
+ ++model_change.conformer.self_attention_model="rel_pos_local_attn" \
+ ++model_change.conformer.att_context_size=[64, 64]
+
+Alternatively, you can change the attention model after loading a checkpoint:
+
+.. code-block:: python
+
+ asr_model = ASRModel.from_pretrained('stt_en_conformer_ctc_large')
+ asr_model.change_attention_model(
+ self_attention_model="rel_pos_local_attn",
+ att_context_size=[64, 64]
+ )
+
+Fine-tuning on Different Datasets
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+There are multiple ASR tutorials provided in the :ref:`Tutorials ` section. Most of these tutorials explain how to instantiate a pre-trained model, prepare the model for fine-tuning on some dataset (in the same language) as a demonstration.
+
+Inference Execution Flow Diagram
+--------------------------------
+
+When preparing your own inference scripts, please follow the execution flow diagram order for correct inference, found at the `examples directory for ASR collection `_.
+
+Automatic Speech Recognition Models
+-----------------------------------
+
+Below is a list of all the ASR models that are available in NeMo for specific languages, as well as auxiliary language models for certain languages.
+
+Language Models for ASR
+^^^^^^^^^^^^^^^^^^^^^^^
+
+.. csv-table::
+ :file: data/asrlm_results.csv
+ :align: left
+ :widths: 30, 30, 40
+ :header-rows: 1
+
+|
+
+Speech Recognition (Languages)
+------------------------------
+
+English
+^^^^^^^
+.. csv-table::
+ :file: data/benchmark_en.csv
+ :align: left
+ :widths: 40, 10, 50
+ :header-rows: 1
+
+-----------------------------
+
+Mandarin
+^^^^^^^^
+.. csv-table::
+ :file: data/benchmark_zh.csv
+ :align: left
+ :widths: 40, 10, 50
+ :header-rows: 1
+
+-----------------------------
+
+German
+^^^^^^
+.. csv-table::
+ :file: data/benchmark_de.csv
+ :align: left
+ :widths: 40, 10, 50
+ :header-rows: 1
+
+-----------------------------
+
+French
+^^^^^^
+.. csv-table::
+ :file: data/benchmark_fr.csv
+ :align: left
+ :widths: 40, 10, 50
+ :header-rows: 1
+
+-----------------------------
+
+Polish
+^^^^^^
+.. csv-table::
+ :file: data/benchmark_pl.csv
+ :align: left
+ :widths: 40, 10, 50
+ :header-rows: 1
+
+-----------------------------
+
+Italian
+^^^^^^^
+.. csv-table::
+ :file: data/benchmark_it.csv
+ :align: left
+ :widths: 40, 10, 50
+ :header-rows: 1
+
+-----------------------------
+
+Russian
+^^^^^^^
+.. csv-table::
+ :file: data/benchmark_ru.csv
+ :align: left
+ :widths: 40, 10, 50
+ :header-rows: 1
+
+-----------------------------
+
+Spanish
+^^^^^^^
+.. csv-table::
+ :file: data/benchmark_es.csv
+ :align: left
+ :widths: 40, 10, 50
+ :header-rows: 1
+
+
+-----------------------------
+
+Catalan
+^^^^^^^
+.. csv-table::
+ :file: data/benchmark_ca.csv
+ :align: left
+ :widths: 40, 10, 50
+ :header-rows: 1
+
+-----------------------------
+
+Hindi
+^^^^^^^
+.. csv-table::
+ :file: data/benchmark_hi.csv
+ :align: left
+ :widths: 40, 10, 50
+ :header-rows: 1
+
+-----------------------------
+
+Marathi
+^^^^^^^
+.. csv-table::
+ :file: data/benchmark_mr.csv
+ :align: left
+ :widths: 40, 10, 50
+ :header-rows: 1
+
+-----------------------------
+
+Kinyarwanda
+^^^^^^^^^^^
+.. csv-table::
+ :file: data/benchmark_rw.csv
+ :align: left
+ :widths: 40, 10, 50
+ :header-rows: 1
+
diff --git a/docs/source/asr/scores.rst b/docs/source/asr/scores.rst
new file mode 100644
index 0000000000000000000000000000000000000000..bcb083bd917e4c5d765be42fcb0872fac8262ed4
--- /dev/null
+++ b/docs/source/asr/scores.rst
@@ -0,0 +1,289 @@
+..
+ AUTOGENERATED DOC: DO NOT EDIT MANUALLY !
+
+Scores
+------
+
+EN
+^^
+
+.. csv-table::
+ :header-rows: 1
+ :align: left
+ :file: data/scores/en/citrinet_en.csv
+
+--------------------
+
+.. csv-table::
+ :header-rows: 1
+ :align: left
+ :file: data/scores/en/conformer_en.csv
+
+--------------------
+
+.. csv-table::
+ :header-rows: 1
+ :align: left
+ :file: data/scores/en/contextnet_en.csv
+
+--------------------
+
+.. csv-table::
+ :header-rows: 1
+ :align: left
+ :file: data/scores/en/jasper10x5dr_en.csv
+
+--------------------
+
+.. csv-table::
+ :header-rows: 1
+ :align: left
+ :file: data/scores/en/quartznet15x5_en.csv
+
+--------------------
+
+.. csv-table::
+ :header-rows: 1
+ :align: left
+ :file: data/scores/en/squeezeformer_en.csv
+
+--------------------
+
+BE
+^^
+
+.. csv-table::
+ :header-rows: 1
+ :align: left
+ :file: data/scores/be/conformer_be.csv
+
+--------------------
+
+CA
+^^
+
+.. csv-table::
+ :header-rows: 1
+ :align: left
+ :file: data/scores/ca/conformer_ca.csv
+
+--------------------
+
+.. csv-table::
+ :header-rows: 1
+ :align: left
+ :file: data/scores/ca/quartznet15x5_ca.csv
+
+--------------------
+
+DE
+^^
+
+.. csv-table::
+ :header-rows: 1
+ :align: left
+ :file: data/scores/de/citrinet_de.csv
+
+--------------------
+
+.. csv-table::
+ :header-rows: 1
+ :align: left
+ :file: data/scores/de/conformer_de.csv
+
+--------------------
+
+.. csv-table::
+ :header-rows: 1
+ :align: left
+ :file: data/scores/de/contextnet_de.csv
+
+--------------------
+
+.. csv-table::
+ :header-rows: 1
+ :align: left
+ :file: data/scores/de/quartznet15x5_de.csv
+
+--------------------
+
+ENES
+^^^^
+
+.. csv-table::
+ :header-rows: 1
+ :align: left
+ :file: data/scores/enes/conformer_enes.csv
+
+--------------------
+
+.. csv-table::
+ :header-rows: 1
+ :align: left
+ :file: data/scores/enes/contextnet_enes.csv
+
+--------------------
+
+EO
+^^
+
+.. csv-table::
+ :header-rows: 1
+ :align: left
+ :file: data/scores/eo/conformer_eo.csv
+
+--------------------
+
+ES
+^^
+
+.. csv-table::
+ :header-rows: 1
+ :align: left
+ :file: data/scores/es/citrinet_es.csv
+
+--------------------
+
+.. csv-table::
+ :header-rows: 1
+ :align: left
+ :file: data/scores/es/conformer_es.csv
+
+--------------------
+
+.. csv-table::
+ :header-rows: 1
+ :align: left
+ :file: data/scores/es/contextnet_es.csv
+
+--------------------
+
+.. csv-table::
+ :header-rows: 1
+ :align: left
+ :file: data/scores/es/quartznet15x5_es.csv
+
+--------------------
+
+FR
+^^
+
+.. csv-table::
+ :header-rows: 1
+ :align: left
+ :file: data/scores/fr/citrinet_fr.csv
+
+--------------------
+
+.. csv-table::
+ :header-rows: 1
+ :align: left
+ :file: data/scores/fr/conformer_fr.csv
+
+--------------------
+
+.. csv-table::
+ :header-rows: 1
+ :align: left
+ :file: data/scores/fr/contextnet_fr.csv
+
+--------------------
+
+.. csv-table::
+ :header-rows: 1
+ :align: left
+ :file: data/scores/fr/quartznet15x5_fr.csv
+
+--------------------
+
+HR
+^^
+
+.. csv-table::
+ :header-rows: 1
+ :align: left
+ :file: data/scores/hr/conformer_hr.csv
+
+--------------------
+
+IT
+^^
+
+.. csv-table::
+ :header-rows: 1
+ :align: left
+ :file: data/scores/it/conformer_it.csv
+
+--------------------
+
+.. csv-table::
+ :header-rows: 1
+ :align: left
+ :file: data/scores/it/quartznet15x5_it.csv
+
+--------------------
+
+KAB
+^^^
+
+.. csv-table::
+ :header-rows: 1
+ :align: left
+ :file: data/scores/kab/conformer_kab.csv
+
+--------------------
+
+PL
+^^
+
+.. csv-table::
+ :header-rows: 1
+ :align: left
+ :file: data/scores/pl/quartznet15x5_pl.csv
+
+--------------------
+
+RU
+^^
+
+.. csv-table::
+ :header-rows: 1
+ :align: left
+ :file: data/scores/ru/conformer_ru.csv
+
+--------------------
+
+.. csv-table::
+ :header-rows: 1
+ :align: left
+ :file: data/scores/ru/quartznet15x5_ru.csv
+
+--------------------
+
+RW
+^^
+
+.. csv-table::
+ :header-rows: 1
+ :align: left
+ :file: data/scores/rw/conformer_rw.csv
+
+--------------------
+
+ZH
+^^
+
+.. csv-table::
+ :header-rows: 1
+ :align: left
+ :file: data/scores/zh/citrinet_zh.csv
+
+--------------------
+
+.. csv-table::
+ :header-rows: 1
+ :align: left
+ :file: data/scores/zh/conformer_zh.csv
+
+--------------------
+
diff --git a/docs/source/asr/speaker_diarization/api.rst b/docs/source/asr/speaker_diarization/api.rst
new file mode 100644
index 0000000000000000000000000000000000000000..37feabaed9f8dc1c082d6b5e6be4f06011c1e75e
--- /dev/null
+++ b/docs/source/asr/speaker_diarization/api.rst
@@ -0,0 +1,20 @@
+NeMo Speaker Diarization API
+=============================
+
+
+Model Classes
+-------------
+.. autoclass:: nemo.collections.asr.models.ClusteringDiarizer
+ :show-inheritance:
+ :members:
+
+.. autoclass:: nemo.collections.asr.models.EncDecDiarLabelModel
+ :show-inheritance:
+ :members: add_speaker_model_config, _init_segmentation_info, _init_speaker_model, setup_training_data, setup_validation_data, setup_test_data, get_ms_emb_seq, get_cluster_avg_embs_model, get_ms_mel_feat, forward, forward_infer, training_step, validation_step, compute_accuracies
+
+Mixins
+------
+.. autoclass:: nemo.collections.asr.parts.mixins.mixins.DiarizationMixin
+ :show-inheritance:
+ :members:
+
diff --git a/docs/source/asr/speaker_diarization/configs.rst b/docs/source/asr/speaker_diarization/configs.rst
new file mode 100644
index 0000000000000000000000000000000000000000..ebf6e86b4be77075eff915f0831542f91ed35bbd
--- /dev/null
+++ b/docs/source/asr/speaker_diarization/configs.rst
@@ -0,0 +1,253 @@
+NeMo Speaker Diarization Configuration Files
+============================================
+
+Both training and inference of speaker diarization is configured by ``.yaml`` files. The diarizer section will generally require information about the dataset(s) being used, models used in this pipeline, as well as inference related parameters such as post processing of each models. The sections on this page cover each of these in more detail.
+
+.. note::
+ For model details and deep understanding about configs, training, fine-tuning and evaluations,
+ please refer to ``/tutorials/speaker_tasks/Speaker_Diarization_Inference.ipynb`` and ``/tutorials/speaker_tasks/Speaker_Diarization_Training.ipynb``;
+ for other applications such as possible integration with ASR, have a look at ``/tutorials/speaker_tasks/ASR_with_SpeakerDiarization.ipynb``.
+
+
+Hydra Configurations for Diarization Training
+=============================================
+
+Currently, NeMo supports Multi-scale diarization decoder (MSDD) as a neural diarizer model. MSDD is a speaker diarization model based on initializing clustering and multi-scale segmentation input. Example configuration files for MSDD model training can be found in ``/examples/speaker_tasks/diarization/conf/neural_diarizer/``.
+
+* Model name convention for MSDD: msdd_scl___Povl_xxx
+* Example: ``msdd_5scl_15_05_50Povl_256x3x32x2.yaml`` has 5 scales, the longest scale is 1.5 sec, the shortest scale is 0.5 sec, with 50 percent overlap, hidden layer size is 256, 3 LSTM layers, 32 CNN channels, 2 repeated Conv layers
+
+MSDD model checkpoint (.ckpt) and NeMo file (.nemo) contain speaker embedding model (TitaNet) and the speaker model is loaded along with standalone MSDD module. Note that MSDD models require more than one scale. Thus, the parameters in ``diarizer.speaker_embeddings.parameters`` should have more than one scale to function as a MSDD model.
+
+
+General Diarizer Configuration
+------------------------------
+
+The items (OmegaConfig keys) directly under ``model`` determines segmentation and clustering related parameters. Multi-scale parameters (``window_length_in_sec``, ``shift_length_in_sec`` and ``multiscale_weights``) are specified. ``max_num_of_spks``, ``scale_n``, ``soft_label_thres`` and ``emb_batch_size`` are set here and then assigned to dataset configurations.
+
+.. code-block:: yaml
+
+ diarizer:
+ out_dir: null
+ oracle_vad: True # If True, uses RTTM files provided in manifest file to get speech activity (VAD) timestamps
+ speaker_embeddings:
+ model_path: ??? # .nemo local model path or pretrained model name (titanet_large is recommended)
+ parameters:
+ window_length_in_sec: [1.5,1.25,1.0,0.75,0.5] # Window length(s) in sec (floating-point number). either a number or a list. ex) 1.5 or [1.5,1.0,0.5]
+ shift_length_in_sec: [0.75,0.625,0.5,0.375,0.25] # Shift length(s) in sec (floating-point number). either a number or a list. ex) 0.75 or [0.75,0.5,0.25]
+ multiscale_weights: [1,1,1,1,1] # Weight for each scale. should be null (for single scale) or a list matched with window/shift scale count. ex) [0.33,0.33,0.33]
+ save_embeddings: True # Save embeddings as pickle file for each audio input.
+
+
+ num_workers: ${num_workers} # Number of workers used for data-loading.
+ max_num_of_spks: 2 # Number of speakers per model. This is currently fixed at 2.
+ scale_n: 5 # Number of scales for MSDD model and initializing clustering.
+ soft_label_thres: 0.5 # Threshold for creating discretized speaker label from continuous speaker label in RTTM files.
+ emb_batch_size: 0 # If this value is bigger than 0, corresponding number of embedding vectors are attached to torch graph and trained.
+
+Dataset Configuration
+---------------------
+
+Training, validation, and test parameters are specified using the ``train_ds``, ``validation_ds``, and
+``test_ds`` sections in the configuration YAML file, respectively. The items such as ``num_spks``, ``soft_label_thres`` and ``emb_batch_size`` follow the settings in ``model`` key. You may also leave fields such as the ``manifest_filepath`` or ``emb_dir`` blank, and then specify it via command-line interface. Note that ``test_ds`` is not used during training and only used for speaker diarization inference.
+
+.. code-block:: yaml
+
+ train_ds:
+ manifest_filepath: ???
+ emb_dir: ???
+ sample_rate: ${sample_rate}
+ num_spks: ${model.max_num_of_spks}
+ soft_label_thres: ${model.soft_label_thres}
+ labels: null
+ batch_size: ${batch_size}
+ emb_batch_size: ${model.emb_batch_size}
+ shuffle: True
+
+ validation_ds:
+ manifest_filepath: ???
+ emb_dir: ???
+ sample_rate: ${sample_rate}
+ num_spks: ${model.max_num_of_spks}
+ soft_label_thres: ${model.soft_label_thres}
+ labels: null
+ batch_size: 2
+ emb_batch_size: ${model.emb_batch_size}
+ shuffle: False
+
+ test_ds:
+ manifest_filepath: null
+ emb_dir: null
+ sample_rate: 16000
+ num_spks: ${model.max_num_of_spks}
+ soft_label_thres: ${model.soft_label_thres}
+ labels: null
+ batch_size: 2
+ shuffle: False
+ seq_eval_mode: False
+
+
+Pre-processor Configuration
+---------------------------
+
+In the MSDD configuration, pre-processor configuration follows the pre-processor of the embedding extractor model.
+
+.. code-block:: yaml
+
+ preprocessor:
+ _target_: nemo.collections.asr.modules.AudioToMelSpectrogramPreprocessor
+ normalize: "per_feature"
+ window_size: 0.025
+ sample_rate: ${sample_rate}
+ window_stride: 0.01
+ window: "hann"
+ features: 80
+ n_fft: 512
+ frame_splicing: 1
+ dither: 0.00001
+
+
+Model Architecture Configurations
+---------------------------------
+
+The hyper-parameters for MSDD models are under the ``msdd_module`` key. The model architecture can be changed by setting up the ``weighting_scheme`` and ``context_vector_type``. The detailed explanation for architecture can be found in the :doc:`Models <./models>` page.
+
+.. code-block:: yaml
+
+ msdd_module:
+ _target_: nemo.collections.asr.modules.msdd_diarizer.MSDD_module
+ num_spks: ${model.max_num_of_spks} # Number of speakers per model. This is currently fixed at 2.
+ hidden_size: 256 # Hidden layer size for linear layers in MSDD module
+ num_lstm_layers: 3 # Number of stacked LSTM layers
+ dropout_rate: 0.5 # Dropout rate
+ cnn_output_ch: 32 # Number of filters in a conv-net layer.
+ conv_repeat: 2 # Determins the number of conv-net layers. Should be greater or equal to 1.
+ emb_dim: 192 # Dimension of the speaker embedding vectors
+ scale_n: ${model.scale_n} # Number of scales for multiscale segmentation input
+ weighting_scheme: 'conv_scale_weight' # Type of weighting algorithm. Options: ('conv_scale_weight', 'attn_scale_weight')
+ context_vector_type: 'cos_sim' # Type of context vector: options. Options: ('cos_sim', 'elem_prod')
+
+Loss Configurations
+-------------------
+
+Neural diarizer uses a binary cross entropy (BCE) loss. A set of weights for negative (absence of the speaker's speech) and positive (presence of the speaker's speech) can be provided to the loss function.
+
+.. code-block:: yaml
+
+ loss:
+ _target_: nemo.collections.asr.losses.bce_loss.BCELoss
+ weight: null # Weight for binary cross-entropy loss. Either `null` or list type input. (e.g. [0.5,0.5])
+
+
+Hydra Configurations for Diarization Inference
+==============================================
+
+Example configuration files for speaker diarization inference can be found in ``/examples/speaker_tasks/diarization/conf/inference/``. Choose a yaml file that fits your targeted domain. For example, if you want to diarize audio recordings of telephonic speech, choose ``diar_infer_telephonic.yaml``.
+
+The configurations for all the components of diarization inference are included in a single file named ``diar_infer_.yaml``. Each ``.yaml`` file has a few different sections for the following modules: VAD, Speaker Embedding, Clustering and ASR.
+
+In speaker diarization inference, the datasets provided in manifest format denote the data that you would like to perform speaker diarization on.
+
+Diarizer Configurations
+-----------------------
+
+An example ``diarizer`` Hydra configuration could look like:
+
+.. code-block:: yaml
+
+ diarizer:
+ manifest_filepath: ???
+ out_dir: ???
+ oracle_vad: False # If True, uses RTTM files provided in manifest file to get speech activity (VAD) timestamps
+ collar: 0.25 # Collar value for scoring
+ ignore_overlap: True # Consider or ignore overlap segments while scoring
+
+Under ``diarizer`` key, there are ``vad``, ``speaker_embeddings``, ``clustering`` and ``asr`` keys containing configurations for the inference of the corresponding modules.
+
+Configurations for Voice Activity Detector
+------------------------------------------
+
+Parameters for VAD model are provided as in the following Hydra config example.
+
+.. code-block:: yaml
+
+ vad:
+ model_path: null # .nemo local model path or pretrained model name or none
+ external_vad_manifest: null # This option is provided to use external vad and provide its speech activity labels for speaker embeddings extraction. Only one of model_path or external_vad_manifest should be set
+
+ parameters: # Tuned parameters for CH109 (using the 11 multi-speaker sessions as dev set)
+ window_length_in_sec: 0.15 # Window length in sec for VAD context input
+ shift_length_in_sec: 0.01 # Shift length in sec for generate frame level VAD prediction
+ smoothing: "median" # False or type of smoothing method (eg: median)
+ overlap: 0.875 # Overlap ratio for overlapped mean/median smoothing filter
+ onset: 0.4 # Onset threshold for detecting the beginning and end of a speech
+ offset: 0.7 # Offset threshold for detecting the end of a speech
+ pad_onset: 0.05 # Adding durations before each speech segment
+ pad_offset: -0.1 # Adding durations after each speech segment
+ min_duration_on: 0.2 # Threshold for small non_speech deletion
+ min_duration_off: 0.2 # Threshold for short speech segment deletion
+ filter_speech_first: True
+
+Configurations for Speaker Embedding in Diarization
+---------------------------------------------------
+
+Parameters for speaker embedding model are provided in the following Hydra config example. Note that multiscale parameters either accept list or single floating point number.
+
+.. code-block:: yaml
+
+ speaker_embeddings:
+ model_path: ??? # .nemo local model path or pretrained model name (titanet_large, ecapa_tdnn or speakerverification_speakernet)
+ parameters:
+ window_length_in_sec: 1.5 # Window length(s) in sec (floating-point number). Either a number or a list. Ex) 1.5 or [1.5,1.25,1.0,0.75,0.5]
+ shift_length_in_sec: 0.75 # Shift length(s) in sec (floating-point number). Either a number or a list. Ex) 0.75 or [0.75,0.625,0.5,0.375,0.25]
+ multiscale_weights: null # Weight for each scale. should be null (for single scale) or a list matched with window/shift scale count. Ex) [1,1,1,1,1]
+ save_embeddings: False # Save embeddings as pickle file for each audio input.
+
+Configurations for Clustering in Diarization
+--------------------------------------------
+
+Parameters for clustering algorithm are provided in the following Hydra config example.
+
+.. code-block:: yaml
+
+ clustering:
+ parameters:
+ oracle_num_speakers: False # If True, use num of speakers value provided in the manifest file.
+ max_num_speakers: 20 # Max number of speakers for each recording. If oracle_num_speakers is passed, this value is ignored.
+ enhanced_count_thres: 80 # If the number of segments is lower than this number, enhanced speaker counting is activated.
+ max_rp_threshold: 0.25 # Determines the range of p-value search: 0 < p <= max_rp_threshold.
+ sparse_search_volume: 30 # The higher the number, the more values will be examined with more time.
+
+Configurations for Diarization with ASR
+---------------------------------------
+
+The following configuration needs to be appended under ``diarizer`` to run ASR with diarization to get a transcription with speaker labels.
+
+.. code-block:: yaml
+
+ asr:
+ model_path: ??? # Provide NGC cloud ASR model name. stt_en_conformer_ctc_* models are recommended for diarization purposes.
+ parameters:
+ asr_based_vad: False # if True, speech segmentation for diarization is based on word-timestamps from ASR inference.
+ asr_based_vad_threshold: 50 # threshold (multiple of 10ms) for ignoring the gap between two words when generating VAD timestamps using ASR based VAD.
+ asr_batch_size: null # Batch size can be dependent on each ASR model. Default batch sizes are applied if set to null.
+ lenient_overlap_WDER: True # If true, when a word falls into speaker-overlapped regions, consider the word as a correctly diarized word.
+ decoder_delay_in_sec: null # Native decoder delay. null is recommended to use the default values for each ASR model.
+ word_ts_anchor_offset: null # Offset to set a reference point from the start of the word. Recommended range of values is [-0.05 0.2].
+ word_ts_anchor_pos: "start" # Select which part of the word timestamp we want to use. The options are: 'start', 'end', 'mid'.
+ fix_word_ts_with_VAD: False # Fix the word timestamp using VAD output. You must provide a VAD model to use this feature.
+ colored_text: False # If True, use colored text to distinguish speakers in the output transcript.
+ print_time: True # If True, the start of the end time of each speaker turn is printed in the output transcript.
+ break_lines: False # If True, the output transcript breaks the line to fix the line width (default is 90 chars)
+
+ ctc_decoder_parameters: # Optional beam search decoder (pyctcdecode)
+ pretrained_language_model: null # KenLM model file: .arpa model file or .bin binary file.
+ beam_width: 32
+ alpha: 0.5
+ beta: 2.5
+
+ realigning_lm_parameters: # Experimental feature
+ arpa_language_model: null # Provide a KenLM language model in .arpa format.
+ min_number_of_words: 3 # Min number of words for the left context.
+ max_number_of_words: 10 # Max number of words for the right context.
+ logprob_diff_threshold: 1.2 # The threshold for the difference between two log probability values from two hypotheses.
diff --git a/docs/source/asr/speaker_diarization/data/diarization_results.csv b/docs/source/asr/speaker_diarization/data/diarization_results.csv
new file mode 100644
index 0000000000000000000000000000000000000000..fc3594520ea4e1b1ebfbeeab8f8cd534c4954682
--- /dev/null
+++ b/docs/source/asr/speaker_diarization/data/diarization_results.csv
@@ -0,0 +1,7 @@
+Model Name,Model Base Class,Model Card
+vad_multilingual_marblenet,EncDecClassificationModel,"https://catalog.ngc.nvidia.com/orgs/nvidia/teams/nemo/models/vad_multilingual_marblenet"
+vad_marblenet,EncDecClassificationModel,"https://ngc.nvidia.com/catalog/models/nvidia:nemo:vad_marblenet"
+vad_telephony_marblenet,EncDecClassificationModel,"https://ngc.nvidia.com/catalog/models/nvidia:nemo:vad_telephony_marblenet"
+titanet_large,EncDecSpeakerLabelModel,"https://ngc.nvidia.com/catalog/models/nvidia:nemo:titanet_large"
+ecapa_tdnn,EncDecSpeakerLabelModel,"https://ngc.nvidia.com/catalog/models/nvidia:nemo:ecapa_tdnn"
+diar_msdd_telephonic,EncDecDiarLabelModel,"https://ngc.nvidia.com/catalog/models/nvidia:diar_msdd_telephonic"
diff --git a/docs/source/asr/speaker_diarization/datasets.rst b/docs/source/asr/speaker_diarization/datasets.rst
new file mode 100644
index 0000000000000000000000000000000000000000..ff73dad8601a6cf96f2440ae31629f817da74a6e
--- /dev/null
+++ b/docs/source/asr/speaker_diarization/datasets.rst
@@ -0,0 +1,264 @@
+Datasets
+========
+
+This page is about formatting a dataset for diarization training and inference. To train or fine-tune the speaker diarization system, you could either train/fine-tune speaker embedding extractor model separately or you can train/fine-tune speaker embedding extractor and neural diarizer at the same time.
+
+* To train or fine-tune a speaker embedding extractor model separately, please go check out these pages: :doc:`Speech Classification Datasets <../speech_classification/datasets>` and :doc:`Speaker Recognition Datasets <../speaker_recognition/datasets>` for preparing datasets for training and validating VAD and speaker embedding models respectively.
+
+
+* To train or fine-tune speaker embedding extractor and neural diarizer together, please follow the dataset preparation process in this page.
+
+Data Preparation for Training
+-----------------------------
+
+.. image:: images/msdd_train_and_infer.png
+ :align: center
+ :width: 800px
+ :alt: MSDD training and inference
+
+As shown in the above figure, a full-fledged speaker diarization process through speaker embedding extractor, clustering algorithm and neural diarizer. Note that only speaker embedding extractor and neural diarizer are trainable models and they can be train/fine-tune together on diarization datasets. We recommend to use a speaker embedding extractor model that is trained on large amount of single-speaker dataset and use it for training a neural diarizer model.
+
+Speaker diarization training is also managed by Hydra configurations based on ``.yaml`` files, just as in other NeMo neural models. See :doc:`NeMo Speaker Diarization Configuration Files <./configs>` for setting up the input Hydra configuration file for speaker diarization. Input data should be provided in line delimited JSON format as below:
+
+* Create a manifest file for speaker diarization
+
+Speaker diarization training and inference both require the same type of manifest files. This manifest file can be created by using the script in ``/scripts/speaker_tasks/pathfiles_to_diarize_manifest.py``. The following example shows how to run ``pathfiles_to_diarize_manifest.py`` by providing path list files.
+
+.. code-block:: shell-session
+
+ python NeMo/scripts/speaker_tasks/pathfiles_to_diarize_manifest.py \
+ --paths2audio_files='/path/to/audio_file_path_list.txt' \
+ --paths2rttm_files='/path/to/rttm_file_list.txt' \
+ --manifest_filepath='/path/to/manifest_filepath/train_manifest.json
+
+
+All three arguments are required. Note that we need to maintain consistency on unique filenames for every field (key) by only changing the filename extensions. For example, if there is an audio file named ``abcd01.wav``, the rttm file should be named as ``abcd01.rttm`` and the transcription file should be named as ``abcd01.txt``.
+
+- Example audio file path list ``audio_file_path_list.txt``
+
+.. code-block:: bash
+
+ /path/to/abcd01.wav
+ /path/to/abcd02.wav
+
+
+To train a diarization model, one needs to provide Rich Transcription Time Marked (RTTM) files as ground truth label files. Here is one line from a RTTM file as an example:
+
+.. code-block:: bash
+
+ SPEAKER TS3012d.Mix-Headset 1 331.573 0.671 MTD046ID
+
+
+Make a list of RTTM files for the audio files you have in ``audio_file_path_list.txt``.
+
+- Example RTTM file path list ``rttm_file_path_list.txt``
+
+.. code-block:: bash
+
+ /path/to/abcd01.rttm
+ /path/to/abcd02.rttm
+
+.. note::
+ We expect all the provided files (e.g. audio, rttm, text) to have the same base name and the name should be unique (uniq-id).
+
+As an output file, ``train_manifest.json`` will have the following line for each audio file:
+
+.. code-block:: bash
+
+ {"audio_filepath": "/path/to/abcd01.wav", "offset": 0, "duration": null, "label": "infer", "text": "-", "num_speakers": 2, "rttm_filepath": "/path/to/rttm/abcd01.rttm"}
+
+
+* Manifest files for MSDD training
+
+After generating a session-wise manifest file, we need to break down each session-wise manifest file into a split manifest file containing start time and duration of the split samples due to memory capacity. More importantly, since MSDD only uses pairwise (two-speaker) model and data samples, we need to split RTTM files if there are more than two speakers.
+
+Note that you should specify window length and shift length of the base scale of your MSDD model when you generate the manifest file for training samples. More importantly, ``step_count`` determines how many steps (i.e., base-scale segments) are in a split data sample. If ``step_count`` is too long, you might not be able to load a single sample in a batch.
+
+.. code-block:: bash
+
+ python NeMo/scripts/speaker_tasks/create_msdd_train_dataset.py \
+ --input_manifest_path='path/to/train_manifest.json' \
+ --output_manifest_path='path/to/train_manifest.50step.json' \
+ --pairwise_rttm_output_folder='path/to/rttm_output_folder' \
+ --window=0.5 \
+ --shift=0.25 \
+ --step_count=50
+
+All arguments are required to generate a new manifest file. Specify a session-wise diarization manifest file to ``--input_manifest_path`` and specify an output file name in ``--output_manifest_path``. In the folder that is specified for ``--pairwise_rttm_output_folder``, the script will create multiple two-speaker RTTM files from the given RTTM file and create manifest file that only contains two speakers in the specified RTTM range.
+
+
+For example, if ``abcd01.wav`` has three speakers (``1911,1988,192``), the three RTTM files will be created: ``abcd01.1911_1988.rttm``, ``abcd01.1911_192.rttm`` and ``abcd01.1988_192.rttm``. Subsequently, the segments will be only generated from the newly generated two-speaker RTTM files.
+
+
+Specify ``window`` and ``shift`` of the base-scale in your MSDD model. In this example, we use default setting of ``window=0.5`` and ``shift=0.25`` and ``step_count=50``. Here are example lines in the output file ``/path/to/train_manifest.50step.json``.
+
+- Example manifest file ``train_manifest.50step.json``.
+
+.. code-block:: bash
+
+ {"audio_filepath": "/path/to/abcd01.wav", "offset": 0.007, "duration": 14.046, "label": "infer", "text": "-", "num_speakers": 2, "rttm_filepath": "simulated_train/abcd01.1919_1988.rttm"}
+ {"audio_filepath": "/path/to/abcd01.wav", "offset": 13.553, "duration": 16.429, "label": "infer", "text": "-", "num_speakers": 2, "rttm_filepath": "simulated_train/abcd01.1919_1988.rttm"}
+ {"audio_filepath": "/path/to/abcd02.wav", "offset": 0.246, "duration": 15.732, "label": "infer", "text": "-", "num_speakers": 2, "rttm_filepath": "path/to/rttm_output_folder/abcd02.777_5694.rttm"}
+ {"audio_filepath": "/path/to/abcd02.wav", "offset": 15.478, "duration": 14.47, "label": "infer", "text": "-", "num_speakers": 2, "rttm_filepath": "path/to/rttm_output_folder/abcd02.777_5694.rttm"}
+
+
+Prepare the msdd training dataset for both train and validation. After the training dataset is prepared, you can train an MSDD model with the following script:
+
+.. code-block:: bash
+
+ python ./multiscale_diar_decoder.py --config-path='../conf/neural_diarizer' --config-name='msdd_5scl_15_05_50Povl_256x3x32x2.yaml' \
+ trainer.gpus=1 \
+ trainer.max_epochs=20 \
+ model.base.diarizer.speaker_embeddings.model_path="titanet_large" \
+ model.train_ds.manifest_filepath="" \
+ model.validation_ds.manifest_filepath="" \
+ model.train_ds.emb_dir="" \
+ model.validation_ds.emb_dir="" \
+ exp_manager.name='sample_train' \
+ exp_manager.exp_dir='./msdd_exp' \
+
+In the above example training session, we use ``titanet_large`` model as a pretrained speaker embedding model.
+
+Data Preparation for Inference
+------------------------------
+
+As in dataset preparation for diarization trainiing, diarization inference is based on Hydra configurations which are fulfilled by ``.yaml`` files. See :doc:`NeMo Speaker Diarization Configuration Files <./configs>` for setting up the input Hydra configuration file for speaker diarization inference. Input data should be provided in line delimited JSON format as below:
+
+.. code-block:: bash
+
+ {"audio_filepath": "/path/to/abcd.wav", "offset": 0, "duration": null, "label": "infer", "text": "-", "num_speakers": null, "rttm_filepath": "/path/to/rttm/abcd.rttm", "uem_filepath": "/path/to/uem/abcd.uem"}
+
+In each line of the input manifest file, ``audio_filepath`` item is mandatory while the rest of the items are optional and can be passed for desired diarization setting. We refer to this file as a manifest file. This manifest file can be created by using the script in ``/scripts/speaker_tasks/pathfiles_to_diarize_manifest.py``. The following example shows how to run ``pathfiles_to_diarize_manifest.py`` by providing path list files.
+
+.. code-block:: bash
+
+ python pathfiles_to_diarize_manifest.py --paths2audio_files /path/to/audio_file_path_list.txt \
+ --paths2txt_files /path/to/transcript_file_path_list.txt \
+ --paths2rttm_files /path/to/rttm_file_path_list.txt \
+ --paths2uem_files /path/to/uem_file_path_list.txt \
+ --paths2ctm_files /path/to/ctm_file_path_list.txt \
+ --manifest_filepath /path/to/manifest_output/input_manifest.json
+
+The ``--paths2audio_files`` and ``--manifest_filepath`` are required arguments. Note that we need to maintain consistency on unique filenames for every field (key) by only changing the filename extensions. For example, if there is an audio file named ``abcd.wav``, the rttm file should be named as ``abcd.rttm`` and the transcription file should be named as ``abcd.txt``.
+
+- Example audio file path list ``audio_file_path_list.txt``
+
+.. code-block:: bash
+
+ /path/to/abcd01.wav
+ /path/to/abcd02.wav
+
+- Example RTTM file path list ``rttm_file_path_list.txt``
+
+.. code-block:: bash
+
+ /path/to/abcd01.rttm
+ /path/to/abcd02.rttm
+
+
+The path list files containing the absolute paths to these WAV, RTTM, TXT, CTM and UEM files should be provided as in the above example. ``pathsfiles_to_diarize_manifest.py`` script will match each file using the unique filename (e.g. ``abcd``). Finally, the absolute path of the created manifest file should be provided through Hydra configuration as shown below:
+
+.. code-block:: yaml
+
+ diarizer.manifest_filepath="path/to/manifest/input_manifest.json"
+
+The following are descriptions about each field in an input manifest JSON file.
+
+.. note::
+ We expect all the provided files (e.g. audio, rttm, text) to have the same base name and the name should be unique (uniq-id).
+
+``audio_filepath`` (Required):
+
+ a string containing absolute path to the audio file.
+
+``num_speakers`` (Optional):
+
+ If the number of speakers is known, provide the integer number or assign null if not known.
+
+``rttm_filepath`` (Optional):
+
+ To evaluate a diarization system with known rttm files, one needs to provide Rich Transcription Time Marked (RTTM) files as ground truth label files. If RTTM files are provided, the diarization evaluation will be initiated. Here is one line from a RTTM file as an example:
+
+.. code-block:: bash
+
+ SPEAKER TS3012d.Mix-Headset 1 331.573 0.671 MTD046ID
+
+``text`` (Optional):
+
+ Ground truth transcription for diarization with ASR inference. Provide the ground truth transcription of the given audio file in string format
+
+.. code-block:: bash
+
+ {"text": "this is an example transcript"}
+
+``uem_filepath`` (Optional):
+
+ The UEM file is used for specifying the scoring regions to be evaluated in the given audio file.
+ UEMfile follows the following convention: `` ``. ```` is set to 1.
+
+ Example lines of UEM file:
+
+.. code-block:: bash
+
+ TS3012d.Mix-Headset 1 12.31 108.98
+ TS3012d.Mix-Headset 1 214.00 857.09
+
+``ctm_filepath`` (Optional):
+
+ CTM file is used for the evaluation of word-level diarization results and word-timestamp alignment. CTM file follows the following convention: `` `` Since confidence is not required for evaluating diarization results, it can have any value. Note that the ```` should be exactly matched with speaker IDs in RTTM.
+
+ Example lines of CTM file:
+
+.. code-block:: bash
+
+ TS3012d.Mix-Headset MTD046ID 12.879 0.32 okay 0
+ TS3012d.Mix-Headset MTD046ID 13.203 0.24 yeah 0
+
+
+Evaluation on Benchmark Datasets
+--------------------------------
+
+The following instructions can help one to reproduce the expected diarization performance on two benchmark English dialogue datasets. The following results are evaluations based on 0.25 second collar without evaluating overlapped speech. The evaluation is based on oracle VAD results from RTTM files. Therefore, diarization error rate (DER) is equal to confusion error rate since oracle VAD has no miss detection or false alarm.
+
+AMI Meeting Corpus
+~~~~~~~~~~~~~~~~~~
+
+The following are the suggested parameters for reproducing the diarization performance for `AMI