Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Update this branch #786

Merged
merged 103 commits into from
Dec 13, 2020
Merged
Changes from 1 commit
Commits
Show all changes
103 commits
Select commit Hold shift + click to select a range
f0f8f86
Merge pull request #1 from NVIDIA/master
byshiue Jun 30, 2020
1e21e53
[FT] 1. Push the FasterTransformer v2.1
byshiue Jun 30, 2020
d8cc4a9
remove pretrained aligns and update readme accordingly.
andabi Aug 3, 2020
1aa6813
[FT] 1. Fix the bug of TensorRT plugin of FasterTransformer encoder. …
byshiue Aug 6, 2020
36ad5fe
Update .gitmodules
nv-kkudrynski Aug 6, 2020
769843e
Merge pull request #11 from NVIDIA/master
swethmandava Aug 10, 2020
b82c372
triton v2 api, download mrpc fix, update for mpi 4.2
Aug 10, 2020
efd6384
pointing to wikiextractor commit
Aug 10, 2020
e8f87ac
Keep wikiextractor version fixed
sharathts Aug 10, 2020
1069a73
converge to pyt
Aug 10, 2020
c8bbdb5
Merge pull request #644 from swethmandava/master
swethmandava Aug 11, 2020
41a0891
Merge pull request #645 from NVIDIA/sharathts-patch-4
nv-kkudrynski Aug 11, 2020
fb40734
Remove autobench scripts (#647)
pribalta Aug 12, 2020
9d4c9f3
tfrecords with correct name
Aug 13, 2020
7c0afee
Merge pull request #648 from swethmandava/master
swethmandava Aug 13, 2020
88864b9
[BERT/PyT] MRPC and SST-2 support
nv-kkudrynski Aug 14, 2020
ff7e38b
Merge pull request #650 from NVIDIA/bert_pyt_mrpc
nv-kkudrynski Aug 14, 2020
3745b49
[DLRM/PyT] Update
nv-kkudrynski Aug 17, 2020
d875531
Merge pull request #654 from NVIDIA/dlrm_update
nv-kkudrynski Aug 17, 2020
0d15a95
[DLRM/PyT] Readme fixes
nv-kkudrynski Aug 18, 2020
bbbc823
Merge pull request #655 from NVIDIA/gh/release
nv-kkudrynski Aug 18, 2020
446c878
[ELECTRA/TF2] Update inference latency (#657)
sharathts Aug 20, 2020
8bd6dd1
Document synthetic dataset options
hXl3s Aug 20, 2020
0e6cfbd
Merge pull request #659 from hXl3s/RN50/readme-update
nv-kkudrynski Aug 20, 2020
5cc03ca
[BERT/PyT] Update pretrained checkpoint links (#660)
sharathts Aug 21, 2020
8588e98
[BERT/PyT] specify GPU for triton (#666)
sharathts Sep 2, 2020
21fcdd6
[DLRM/PyT] Triton updates
nv-kkudrynski Sep 7, 2020
323005c
Merge pull request #676 from NVIDIA/gh/release
nv-kkudrynski Sep 8, 2020
5d36b4f
Fixing hyperlinks
nv-kkudrynski Sep 8, 2020
7a4c425
[BERT/PyT] Fix dataloader typo
Sep 9, 2020
cf54b78
fixed link
nv-kkudrynski Sep 10, 2020
1402e94
Update CUDA-Optimized/FastSpeech/README.md
nv-kkudrynski Sep 11, 2020
49e387c
Merge pull request #633 from andabi/master
nv-kkudrynski Sep 11, 2020
152d0c0
Merge pull request #684 from gpauloski/bert_pytorch_fix
nv-kkudrynski Sep 11, 2020
6b82d3a
[TXL/PyT] Minor update for PyTorch Transformer-XL (#688)
szmigacz Sep 14, 2020
437b950
Fixed links in readme
nv-kkudrynski Sep 14, 2020
482fe9a
[BERT/PyT] fix onnx export (#689)
sharathts Sep 15, 2020
aacbda6
Update Jasper sample to TensorRT 7.1.3.4 (#687)
rajeevsrao Sep 15, 2020
a74236a
[BERT/PyT] remove redundant section (#690)
sharathts Sep 17, 2020
751bca1
Update README.md
mmarcinkiewicz Sep 18, 2020
72f40b8
Fixed distributed checkpoint loading
hXl3s Sep 18, 2020
94518be
Merge pull request #693 from hXl3s/RN50/ngc-checkpoint-update
nv-kkudrynski Sep 18, 2020
66d1891
Merge branch 'master' into master
byshiue Sep 20, 2020
b2e89e6
[FT] FasterTransformer 3.0 Release (#696)
byshiue Sep 23, 2020
421c839
fix div
KsenijaS Sep 25, 2020
d057bab
[FastPitch/PyT] Updating for 20.08
nv-kkudrynski Sep 30, 2020
0b27e35
Merge pull request #708 from NVIDIA/gh/release
nv-kkudrynski Sep 30, 2020
550123f
updated convai
grzegorz-k-karch Sep 7, 2020
385d81e
a few fixes
grzegorz-k-karch Oct 7, 2020
b1ce24a
Merge pull request #677 from GrzegorzKarchNV/convai-update
nv-kkudrynski Oct 7, 2020
e76b900
Merge pull request #692 from NVIDIA/unetmed_add_nccl_to_known_issues
nv-kkudrynski Oct 7, 2020
70f247f
Merge pull request #700 from KsenijaS/fix_div
Oct 7, 2020
f217ab1
[COnvNets/Pyt] Triton Deployment
nv-kkudrynski Oct 14, 2020
ac05902
Merge pull request #714 from NVIDIA/gh/release
nv-kkudrynski Oct 14, 2020
3cf3a5c
commit on 'master'
alvarognvidia Oct 15, 2020
0a120b2
Merge pull request #715 from alvarognvidia/master
nv-kkudrynski Oct 15, 2020
9061083
[ConvNets/Pyt] Pretrained weights usage guidelines
nv-kkudrynski Oct 21, 2020
d1b1854
Merge pull request #718 from NVIDIA/gh/release
nv-kkudrynski Oct 21, 2020
b2c72b2
[FastPitch/PyT] Adding notebooks
nv-kkudrynski Oct 21, 2020
8cbac00
Merge pull request #719 from NVIDIA/gh/release
nv-kkudrynski Oct 21, 2020
533f744
[TXL/PyT] Fixed issue with AMP training together with gradient accumu…
szmigacz Oct 23, 2020
96e1700
[ELECTRA/TF2] Pretraining and other updates
nv-kkudrynski Oct 26, 2020
e159774
Merge pull request #722 from NVIDIA/gh/release
nv-kkudrynski Oct 26, 2020
36a6985
[BERT/TF] TRT int8 and Triton
nv-kkudrynski Oct 29, 2020
03c5a9f
Merge pull request #728 from NVIDIA/gh/release
nv-kkudrynski Oct 29, 2020
bec8259
[FastPitch/PyT] updated checkpoints, multispeaker and text processing
nv-kkudrynski Oct 30, 2020
475256f
Merge pull request #731 from NVIDIA/gh/release
nv-kkudrynski Oct 30, 2020
2af0f03
Update README.md
alvarognvidia Nov 2, 2020
fd32b99
[CUDA-Optimized/FastSpeech]
Nov 2, 2020
81e8636
Add --gpus flag to docker run
pribalta Nov 2, 2020
6f20c08
Merge pull request #735 from NVIDIA/pribalta-fix-unetind-readme
nv-kkudrynski Nov 2, 2020
b2e7f4a
[ConvNets/TF] Performance fix
nv-kkudrynski Nov 3, 2020
308925e
Merge pull request #737 from NVIDIA/gh/release
nv-kkudrynski Nov 3, 2020
1d4211f
Merge pull request #12 from NVIDIA/master
swethmandava Nov 3, 2020
c72196b
fix copying perf numbers mistake
Nov 3, 2020
b5741a9
Merge pull request #733 from alvarognvidia/master
nv-kkudrynski Nov 4, 2020
799660f
[Kaldi] Adding Jupyter notebook
nv-kkudrynski Nov 4, 2020
64ea93d
Merge pull request #734 from andabi/master
nv-kkudrynski Nov 4, 2020
2749a80
Merge branch 'gh/master' into gh/release
nv-kkudrynski Nov 5, 2020
ff86473
[FastPitch/PyT] Fixed ckpt handling
nv-kkudrynski Nov 5, 2020
0b34777
Merge pull request #740 from NVIDIA/gh/release
nv-kkudrynski Nov 5, 2020
a095658
Fix: Fix the bugs of allocating workspace (#746,#747)
byshiue Nov 9, 2020
c9846ca
Fix merge issues
hXl3s Nov 9, 2020
0b455ff
Merge pull request #748 from hXl3s/RN50/argparse_fix
nv-kkudrynski Nov 9, 2020
002bcd8
update gluon version to with bert in readme
swethmandava Nov 9, 2020
5ec39fc
Merge pull request #739 from swethmandava/master
swethmandava Nov 9, 2020
1113674
remove links to old ngc checkpoints
swethmandava Nov 9, 2020
7e85343
Merge pull request #749 from swethmandava/master
swethmandava Nov 9, 2020
fa1ddc9
[WideAndDeep/TF] library version fix
nv-kkudrynski Nov 10, 2020
3ddcba4
Merge pull request #751 from NVIDIA/gh/release
nv-kkudrynski Nov 10, 2020
4ef867a
Update a link to spark 3.0.0.
mkfilipiuk Nov 10, 2020
ad49eae
Merge pull request #752 from mkfilipiuk/patch-2
nv-kkudrynski Nov 10, 2020
cca4828
Fixed mrcnn weights downloading script
jan-golda Nov 18, 2020
61d9adc
Merge pull request #755 from jan-golda/mrcnn/fix_weights
nv-kkudrynski Nov 18, 2020
4a64c5b
Fix broken link to Spark pre-processing
jconwayNV Nov 19, 2020
9a6c524
fixing rng_state for backward compatibility
grzegorz-k-karch Nov 19, 2020
d17b10e
Merge pull request #759 from GrzegorzKarchNV/fix_rng_state
Nov 19, 2020
94a8f28
[UNet medical/TF2] Fix
nv-kkudrynski Nov 23, 2020
f3c6bdf
Merge pull request #764 from NVIDIA/gh/release
nv-kkudrynski Nov 23, 2020
478d565
[WideAndDeep/TF] Update for 20.10
nv-kkudrynski Nov 26, 2020
66667f1
Merge pull request #769 from NVIDIA/gh/release
nv-kkudrynski Nov 26, 2020
33ea90e
removie trt, fix queuing delay typo in triton readme for bert
Dec 3, 2020
99b1c89
Merge pull request #773 from swethmandava/master
swethmandava Dec 3, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
[FastPitch/PyT] updated checkpoints, multispeaker and text processing
  • Loading branch information
nv-kkudrynski committed Oct 30, 2020
commit bec82593f59a4d60dba602c221d9ce13fac8c1e0
17 changes: 12 additions & 5 deletions PyTorch/SpeechSynthesis/FastPitch/.gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
*.swp
*.swo
*.pyc
__pycache__
scripts_joc/
runs*/
LJSpeech-1.1/
output*
scripts_joc/
tests/

*.pyc
__pycache__

.idea/
.DS_Store

*.swp
*.swo
*.swn
28 changes: 16 additions & 12 deletions PyTorch/SpeechSynthesis/FastPitch/README.md
Original file line number Diff line number Diff line change
@@ -488,11 +488,11 @@ The `scripts/train.sh` script is configured for 8x GPU with at least 16GB of mem
```
In a single accumulated step, there are `batch_size x gradient_accumulation_steps x GPUs = 256` examples being processed in parallel. With a smaller number of GPUs, increase `--gradient_accumulation_steps` to keep this relation satisfied, e.g., through env variables
```bash
NGPU=4 GRAD_ACC=2 bash scripts/train.sh
NUM_GPUS=4 GRAD_ACCUMULATION=2 bash scripts/train.sh
```
With automatic mixed precision (AMP), a larger batch size fits in 16GB of memory:
```bash
NGPU=4 GRAD_ACC=1 BS=64 AMP=true bash scripts/train.sh
NUM_GPUS=4 GRAD_ACCUMULATION=1 BS=64 AMP=true bash scripts/train.sh
```

### Inference process
@@ -545,18 +545,18 @@ To benchmark the training performance on a specific batch size, run:

* NVIDIA DGX A100 (8x A100 40GB)
```bash
AMP=true NGPU=1 BS=128 GRAD_ACC=2 EPOCHS=10 bash scripts/train.sh
AMP=true NGPU=8 BS=32 GRAD_ACC=1 EPOCHS=10 bash scripts/train.sh
NGPU=1 BS=128 GRAD_ACC=2 EPOCHS=10 bash scripts/train.sh
NGPU=8 BS=32 GRAD_ACC=1 EPOCHS=10 bash scripts/train.sh
AMP=true NUM_GPUS=1 BS=128 GRAD_ACCUMULATION=2 EPOCHS=10 bash scripts/train.sh
AMP=true NUM_GPUS=8 BS=32 GRAD_ACCUMULATION=1 EPOCHS=10 bash scripts/train.sh
NUM_GPUS=1 BS=128 GRAD_ACCUMULATION=2 EPOCHS=10 bash scripts/train.sh
NUM_GPUS=8 BS=32 GRAD_ACCUMULATION=1 EPOCHS=10 bash scripts/train.sh
```

* NVIDIA DGX-1 (8x V100 16GB)
```bash
AMP=true NGPU=1 BS=64 GRAD_ACC=4 EPOCHS=10 bash scripts/train.sh
AMP=true NGPU=8 BS=32 GRAD_ACC=1 EPOCHS=10 bash scripts/train.sh
NGPU=1 BS=32 GRAD_ACC=8 EPOCHS=10 bash scripts/train.sh
NGPU=8 BS=32 GRAD_ACC=1 EPOCHS=10 bash scripts/train.sh
AMP=true NUM_GPUS=1 BS=64 GRAD_ACCUMULATION=4 EPOCHS=10 bash scripts/train.sh
AMP=true NUM_GPUS=8 BS=32 GRAD_ACCUMULATION=1 EPOCHS=10 bash scripts/train.sh
NUM_GPUS=1 BS=32 GRAD_ACCUMULATION=8 EPOCHS=10 bash scripts/train.sh
NUM_GPUS=8 BS=32 GRAD_ACCUMULATION=1 EPOCHS=10 bash scripts/train.sh
```

Each of these scripts runs for 10 epochs and for each epoch measures the
@@ -569,12 +569,12 @@ To benchmark the inference performance on a specific batch size, run:

* For FP16
```bash
AMP=true BS_SEQ=”1 4 8” REPEATS=100 bash scripts/inference_benchmark.sh
AMP=true BS_SEQUENCE=”1 4 8” REPEATS=100 bash scripts/inference_benchmark.sh
```

* For FP32 or TF32
```bash
BS_SEQ=”1 4 8” REPEATS=100 bash scripts/inference_benchmark.sh
BS_SEQUENCE=”1 4 8” REPEATS=100 bash scripts/inference_benchmark.sh
```

The output log files will contain performance numbers for the FastPitch model
@@ -726,6 +726,10 @@ The input utterance has 128 characters, synthesized audio has 8.05 s.

### Changelog

October 2020
- Added multispeaker capabilities
- Updated text processing module

June 2020
- Updated performance tables to include A100 results

75 changes: 2 additions & 73 deletions PyTorch/SpeechSynthesis/FastPitch/common/text/__init__.py
Original file line number Diff line number Diff line change
@@ -1,74 +1,3 @@
""" from https://github.com/keithito/tacotron """
import re
from common.text import cleaners
from common.text.symbols import symbols
from .cmudict import CMUDict


# Mappings from symbol to numeric ID and vice versa:
_symbol_to_id = {s: i for i, s in enumerate(symbols)}
_id_to_symbol = {i: s for i, s in enumerate(symbols)}

# Regular expression matching text enclosed in curly braces:
_curly_re = re.compile(r'(.*?)\{(.+?)\}(.*)')


def text_to_sequence(text, cleaner_names):
'''Converts a string of text to a sequence of IDs corresponding to the symbols in the text.

The text can optionally have ARPAbet sequences enclosed in curly braces embedded
in it. For example, "Turn left on {HH AW1 S S T AH0 N} Street."

Args:
text: string to convert to a sequence
cleaner_names: names of the cleaner functions to run the text through

Returns:
List of integers corresponding to the symbols in the text
'''
sequence = []

# Check for curly braces and treat their contents as ARPAbet:
while len(text):
m = _curly_re.match(text)
if not m:
sequence += _symbols_to_sequence(_clean_text(text, cleaner_names))
break
sequence += _symbols_to_sequence(_clean_text(m.group(1), cleaner_names))
sequence += _arpabet_to_sequence(m.group(2))
text = m.group(3)

return sequence


def sequence_to_text(sequence):
'''Converts a sequence of IDs back to a string'''
result = ''
for symbol_id in sequence:
if symbol_id in _id_to_symbol:
s = _id_to_symbol[symbol_id]
# Enclose ARPAbet back in curly braces:
if len(s) > 1 and s[0] == '@':
s = '{%s}' % s[1:]
result += s
return result.replace('}{', ' ')


def _clean_text(text, cleaner_names):
for name in cleaner_names:
cleaner = getattr(cleaners, name)
if not cleaner:
raise Exception('Unknown cleaner: %s' % name)
text = cleaner(text)
return text


def _symbols_to_sequence(symbols):
return [_symbol_to_id[s] for s in symbols if _should_keep_symbol(s)]


def _arpabet_to_sequence(text):
return _symbols_to_sequence(['@' + s for s in text.split()])


def _should_keep_symbol(s):
return s in _symbol_to_id and s is not '_' and s is not '~'
cmudict = CMUDict()
58 changes: 58 additions & 0 deletions PyTorch/SpeechSynthesis/FastPitch/common/text/abbreviations.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
import re

_no_period_re = re.compile(r'(No[.])(?=[ ]?[0-9])')
_percent_re = re.compile(r'([ ]?[%])')
_half_re = re.compile('([0-9]½)|(½)')


# List of (regular expression, replacement) pairs for abbreviations:
_abbreviations = [(re.compile('\\b%s\\.' % x[0], re.IGNORECASE), x[1]) for x in [
('mrs', 'misess'),
('ms', 'miss'),
('mr', 'mister'),
('dr', 'doctor'),
('st', 'saint'),
('co', 'company'),
('jr', 'junior'),
('maj', 'major'),
('gen', 'general'),
('drs', 'doctors'),
('rev', 'reverend'),
('lt', 'lieutenant'),
('hon', 'honorable'),
('sgt', 'sergeant'),
('capt', 'captain'),
('esq', 'esquire'),
('ltd', 'limited'),
('col', 'colonel'),
('ft', 'fort'),
('sen', 'senator'),
]]


def _expand_no_period(m):
word = m.group(0)
if word[0] == 'N':
return 'Number'
return 'number'


def _expand_percent(m):
return ' percent'


def _expand_half(m):
word = m.group(1)
if word is None:
return 'half'
return word[0] + ' and a half'


def normalize_abbreviations(text):
text = re.sub(_no_period_re, _expand_no_period, text)
text = re.sub(_percent_re, _expand_percent, text)
text = re.sub(_half_re, _expand_half, text)

for regex, replacement in _abbreviations:
text = re.sub(regex, replacement, text)
return text
67 changes: 67 additions & 0 deletions PyTorch/SpeechSynthesis/FastPitch/common/text/acronyms.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
import re
from . import cmudict

_letter_to_arpabet = {
'A': 'EY1',
'B': 'B IY1',
'C': 'S IY1',
'D': 'D IY1',
'E': 'IY1',
'F': 'EH1 F',
'G': 'JH IY1',
'H': 'EY1 CH',
'I': 'AY1',
'J': 'JH EY1',
'K': 'K EY1',
'L': 'EH1 L',
'M': 'EH1 M',
'N': 'EH1 N',
'O': 'OW1',
'P': 'P IY1',
'Q': 'K Y UW1',
'R': 'AA1 R',
'S': 'EH1 S',
'T': 'T IY1',
'U': 'Y UW1',
'V': 'V IY1',
'X': 'EH1 K S',
'Y': 'W AY1',
'W': 'D AH1 B AH0 L Y UW0',
'Z': 'Z IY1',
's': 'Z'
}

# must ignore roman numerals
# _acronym_re = re.compile(r'([A-Z][A-Z]+)s?|([A-Z]\.([A-Z]\.)+s?)')
_acronym_re = re.compile(r'([A-Z][A-Z]+)s?')


def _expand_acronyms(m, add_spaces=True):
acronym = m.group(0)

# remove dots if they exist
acronym = re.sub('\.', '', acronym)

acronym = "".join(acronym.split())
arpabet = cmudict.lookup(acronym)

if arpabet is None:
acronym = list(acronym)
arpabet = ["{" + _letter_to_arpabet[letter] + "}" for letter in acronym]
# temporary fix
if arpabet[-1] == '{Z}' and len(arpabet) > 1:
arpabet[-2] = arpabet[-2][:-1] + ' ' + arpabet[-1][1:]
del arpabet[-1]

arpabet = ' '.join(arpabet)
elif len(arpabet) == 1:
arpabet = "{" + arpabet[0] + "}"
else:
arpabet = acronym

return arpabet


def normalize_acronyms(text):
text = re.sub(_acronym_re, _expand_acronyms, text)
return text
Loading