From 7789b8d36af050e15865805a209cf7a94043b5d9 Mon Sep 17 00:00:00 2001 From: TianYuan Date: Fri, 15 Oct 2021 05:33:06 +0000 Subject: [PATCH] add FLAGS_allocator_strategy=naive_best_fit when synthesize --- examples/GANVocoder/parallelwave_gan/baker/synthesize.sh | 3 ++- examples/GANVocoder/parallelwave_gan/ljspeech/synthesize.sh | 3 ++- examples/fastspeech2/aishell3/synthesize.sh | 3 ++- examples/fastspeech2/aishell3/synthesize_e2e.sh | 3 ++- examples/fastspeech2/baker/synthesize.sh | 4 ++-- examples/fastspeech2/baker/synthesize_e2e.sh | 3 ++- examples/fastspeech2/ljspeech/synthesize.sh | 3 ++- examples/fastspeech2/ljspeech/synthesize_e2e.sh | 3 ++- examples/speedyspeech/baker/README.md | 2 ++ examples/speedyspeech/baker/synthesize.sh | 3 ++- examples/speedyspeech/baker/synthesize_e2e.sh | 3 ++- examples/transformer_tts/ljspeech/synthesize_e2e.sh | 3 ++- parakeet/models/parallel_wavegan/parallel_wavegan.py | 3 --- 13 files changed, 24 insertions(+), 15 deletions(-) diff --git a/examples/GANVocoder/parallelwave_gan/baker/synthesize.sh b/examples/GANVocoder/parallelwave_gan/baker/synthesize.sh index 938e7869..e95b0da8 100755 --- a/examples/GANVocoder/parallelwave_gan/baker/synthesize.sh +++ b/examples/GANVocoder/parallelwave_gan/baker/synthesize.sh @@ -1,5 +1,6 @@ #!/bin/bash - +FLAGS_allocator_strategy=naive_best_fit \ +FLAGS_fraction_of_gpu_memory_to_use=0.01 \ python3 ../synthesize.py \ --config=conf/default.yaml \ --checkpoint=exp/default/checkpoints/snapshot_iter_400000.pdz\ diff --git a/examples/GANVocoder/parallelwave_gan/ljspeech/synthesize.sh b/examples/GANVocoder/parallelwave_gan/ljspeech/synthesize.sh index 938e7869..e95b0da8 100755 --- a/examples/GANVocoder/parallelwave_gan/ljspeech/synthesize.sh +++ b/examples/GANVocoder/parallelwave_gan/ljspeech/synthesize.sh @@ -1,5 +1,6 @@ #!/bin/bash - +FLAGS_allocator_strategy=naive_best_fit \ +FLAGS_fraction_of_gpu_memory_to_use=0.01 \ python3 ../synthesize.py \ --config=conf/default.yaml \ --checkpoint=exp/default/checkpoints/snapshot_iter_400000.pdz\ diff --git a/examples/fastspeech2/aishell3/synthesize.sh b/examples/fastspeech2/aishell3/synthesize.sh index f14bace9..950b2077 100755 --- a/examples/fastspeech2/aishell3/synthesize.sh +++ b/examples/fastspeech2/aishell3/synthesize.sh @@ -1,5 +1,6 @@ #!/bin/bash - +FLAGS_allocator_strategy=naive_best_fit \ +FLAGS_fraction_of_gpu_memory_to_use=0.01 \ python3 ../synthesize.py \ --fastspeech2-config=conf/default.yaml \ --fastspeech2-checkpoint=exp/default/checkpoints/snapshot_iter_96400.pdz \ diff --git a/examples/fastspeech2/aishell3/synthesize_e2e.sh b/examples/fastspeech2/aishell3/synthesize_e2e.sh index ac831288..31533714 100755 --- a/examples/fastspeech2/aishell3/synthesize_e2e.sh +++ b/examples/fastspeech2/aishell3/synthesize_e2e.sh @@ -1,5 +1,6 @@ #!/bin/bash - +FLAGS_allocator_strategy=naive_best_fit \ +FLAGS_fraction_of_gpu_memory_to_use=0.01 \ python3 synthesize_e2e.py \ --fastspeech2-config=conf/default.yaml \ --fastspeech2-checkpoint=exp/default/checkpoints/snapshot_iter_96400.pdz \ diff --git a/examples/fastspeech2/baker/synthesize.sh b/examples/fastspeech2/baker/synthesize.sh index 6b363d88..535ebdba 100755 --- a/examples/fastspeech2/baker/synthesize.sh +++ b/examples/fastspeech2/baker/synthesize.sh @@ -1,6 +1,6 @@ - #!/bin/bash - +FLAGS_allocator_strategy=naive_best_fit \ +FLAGS_fraction_of_gpu_memory_to_use=0.01 \ python3 ../synthesize.py \ --fastspeech2-config=conf/default.yaml \ --fastspeech2-checkpoint=exp/default/checkpoints/snapshot_iter_76000.pdz \ diff --git a/examples/fastspeech2/baker/synthesize_e2e.sh b/examples/fastspeech2/baker/synthesize_e2e.sh index 4ae1dbb4..a2deec14 100755 --- a/examples/fastspeech2/baker/synthesize_e2e.sh +++ b/examples/fastspeech2/baker/synthesize_e2e.sh @@ -1,5 +1,6 @@ #!/bin/bash - +FLAGS_allocator_strategy=naive_best_fit \ +FLAGS_fraction_of_gpu_memory_to_use=0.01 \ python3 synthesize_e2e.py \ --fastspeech2-config=conf/default.yaml \ --fastspeech2-checkpoint=exp/default/checkpoints/snapshot_iter_153.pdz \ diff --git a/examples/fastspeech2/ljspeech/synthesize.sh b/examples/fastspeech2/ljspeech/synthesize.sh index dd16c867..0f8225e4 100755 --- a/examples/fastspeech2/ljspeech/synthesize.sh +++ b/examples/fastspeech2/ljspeech/synthesize.sh @@ -1,6 +1,7 @@ #!/bin/bash - +FLAGS_allocator_strategy=naive_best_fit \ +FLAGS_fraction_of_gpu_memory_to_use=0.01 \ python3 ../synthesize.py \ --fastspeech2-config=conf/default.yaml \ --fastspeech2-checkpoint=exp/default/checkpoints/snapshot_iter_100000.pdz \ diff --git a/examples/fastspeech2/ljspeech/synthesize_e2e.sh b/examples/fastspeech2/ljspeech/synthesize_e2e.sh index bd643b9e..158d4483 100755 --- a/examples/fastspeech2/ljspeech/synthesize_e2e.sh +++ b/examples/fastspeech2/ljspeech/synthesize_e2e.sh @@ -1,6 +1,7 @@ #!/bin/bash - +FLAGS_allocator_strategy=naive_best_fit \ +FLAGS_fraction_of_gpu_memory_to_use=0.01 \ python3 synthesize_e2e.py \ --fastspeech2-config=conf/default.yaml \ --fastspeech2-checkpoint=exp/default/checkpoints/snapshot_iter_100000.pdz \ diff --git a/examples/speedyspeech/baker/README.md b/examples/speedyspeech/baker/README.md index 5dcf43b7..0484d484 100644 --- a/examples/speedyspeech/baker/README.md +++ b/examples/speedyspeech/baker/README.md @@ -208,6 +208,8 @@ optional arguments: You can use the following scripts to synthesize for `../sentences.txt` using pretrained speedyspeech and parallel wavegan models. ```bash +FLAGS_allocator_strategy=naive_best_fit \ +FLAGS_fraction_of_gpu_memory_to_use=0.01 \ python3 synthesize_e2e.py \ --speedyspeech-config=speedyspeech_nosil_baker_ckpt_0.5/default.yaml \ --speedyspeech-checkpoint=speedyspeech_nosil_baker_ckpt_0.5/snapshot_iter_11400.pdz \ diff --git a/examples/speedyspeech/baker/synthesize.sh b/examples/speedyspeech/baker/synthesize.sh index 1528e615..7c37c5bd 100755 --- a/examples/speedyspeech/baker/synthesize.sh +++ b/examples/speedyspeech/baker/synthesize.sh @@ -1,5 +1,6 @@ #!/bin/bash - +FLAGS_allocator_strategy=naive_best_fit \ +FLAGS_fraction_of_gpu_memory_to_use=0.01 \ python3 ../synthesize.py \ --speedyspeech-config=conf/default.yaml \ --speedyspeech-checkpoint=exp/default/checkpoints/snapshot_iter_11400.pdz \ diff --git a/examples/speedyspeech/baker/synthesize_e2e.sh b/examples/speedyspeech/baker/synthesize_e2e.sh index 734c9b43..4800a0f7 100755 --- a/examples/speedyspeech/baker/synthesize_e2e.sh +++ b/examples/speedyspeech/baker/synthesize_e2e.sh @@ -1,5 +1,6 @@ #!/bin/bash - +FLAGS_allocator_strategy=naive_best_fit \ +FLAGS_fraction_of_gpu_memory_to_use=0.01 \ python synthesize_e2e.py \ --speedyspeech-config=conf/default.yaml \ --speedyspeech-checkpoint=exp/default/checkpoints/snapshot_iter_11400.pdz \ diff --git a/examples/transformer_tts/ljspeech/synthesize_e2e.sh b/examples/transformer_tts/ljspeech/synthesize_e2e.sh index ba272c04..4fb69238 100755 --- a/examples/transformer_tts/ljspeech/synthesize_e2e.sh +++ b/examples/transformer_tts/ljspeech/synthesize_e2e.sh @@ -1,5 +1,6 @@ #!/bin/bash - +FLAGS_allocator_strategy=naive_best_fit \ +FLAGS_fraction_of_gpu_memory_to_use=0.01 \ python3 synthesize_e2e.py \ --transformer-tts-config=conf/default.yaml \ --transformer-tts-checkpoint=exp/default/checkpoints/snapshot_iter_201500.pdz \ diff --git a/parakeet/models/parallel_wavegan/parallel_wavegan.py b/parakeet/models/parallel_wavegan/parallel_wavegan.py index dc1d3b53..bb214653 100644 --- a/parakeet/models/parallel_wavegan/parallel_wavegan.py +++ b/parakeet/models/parallel_wavegan/parallel_wavegan.py @@ -465,9 +465,6 @@ def forward(self, x, c): skips = 0 for f in self.conv_layers: x, s = f(x, c) - # Add depency with x to avoid lanching op too fast that leads - # to GPU memory reach too high value (ugly trick here) - c += paddle.mean(x - x) skips += s skips *= math.sqrt(1.0 / len(self.conv_layers))