Skip to content

Commit ce67d41

Browse files
authored
Make TTS L2 Tests More Resilient (#15584)
* Make all TTS tests HUBOFFLINE and deterministic Signed-off-by: Jason <jasoli@nvidia.com> * add pre-saved checkpoint paths for ASR and EOU Signed-off-by: Jason <jasoli@nvidia.com> * tighten bounds Signed-off-by: Jason <jasoli@nvidia.com> --------- Signed-off-by: Jason <jasoli@nvidia.com>
1 parent 8e2905c commit ce67d41

13 files changed

Lines changed: 26 additions & 17 deletions

nemo/collections/tts/models/easy_magpietts_inference.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,13 @@ def __init__(self, cfg: DictConfig, trainer: 'Trainer' = None):
214214
self.world_size = trainer.num_nodes * trainer.num_devices
215215

216216
# load codec
217-
codec_model = AudioCodecModel.restore_from(cfg.get('codecmodel_path'), strict=False)
217+
codec_model_path = cfg.get('codecmodel_path')
218+
codec_model_cfg = AudioCodecModel.restore_from(codec_model_path, return_config=True)
219+
if "use_scl_loss" in codec_model_cfg:
220+
codec_model_cfg.use_scl_loss = False
221+
codec_model = AudioCodecModel.restore_from(
222+
codec_model_path, strict=False, override_config_path=codec_model_cfg
223+
)
218224
self.sample_rate = codec_model.sample_rate
219225
self.output_sample_rate = codec_model.output_sample_rate
220226

tests/functional_tests/L2_TTS_Fast_dev_runs_EasyMagpietts_Nemotron.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
14-
TORCH_FORCE_NO_WEIGHTS_ONLY_LOAD=1 coverage run -a --data-file=/workspace/.coverage --source=/workspace/nemo examples/tts/easy_magpietts.py \
14+
HF_HUB_OFFLINE=1 TORCH_FORCE_NO_WEIGHTS_ONLY_LOAD=1 coverage run -a --data-file=/workspace/.coverage --source=/workspace/nemo examples/tts/easy_magpietts.py \
1515
--config-name easy_magpietts \
1616
name="EasyMagpieTTS-Nemotron-FastDev" \
1717
~model.phoneme_tokenizer \
@@ -35,4 +35,4 @@ TORCH_FORCE_NO_WEIGHTS_ONLY_LOAD=1 coverage run -a --data-file=/workspace/.cover
3535
trainer.strategy=auto \
3636
model.train_ds.dataloader_params.num_workers=0 \
3737
model.validation_ds.dataloader_params.num_workers=0 \
38-
~trainer.check_val_every_n_epoch
38+
~trainer.check_val_every_n_epoch

tests/functional_tests/L2_TTS_Fast_dev_runs_EasyMagpietts_Qwen.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
14-
TORCH_FORCE_NO_WEIGHTS_ONLY_LOAD=1 coverage run -a --data-file=/workspace/.coverage --source=/workspace/nemo examples/tts/easy_magpietts.py \
14+
HF_HUB_OFFLINE=1 TORCH_FORCE_NO_WEIGHTS_ONLY_LOAD=1 coverage run -a --data-file=/workspace/.coverage --source=/workspace/nemo examples/tts/easy_magpietts.py \
1515
--config-name easy_magpietts \
1616
name="EasyMagpieTTS-Qwen-FastDev" \
1717
~model.phoneme_tokenizer \

tests/functional_tests/L2_TTS_Fast_dev_runs_Magpietts_DecoderContext.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
14-
TORCH_FORCE_NO_WEIGHTS_ONLY_LOAD=1 coverage run -a --data-file=/workspace/.coverage --source=/workspace/nemo examples/tts/magpietts.py \
14+
HF_HUB_OFFLINE=1 TORCH_FORCE_NO_WEIGHTS_ONLY_LOAD=1 coverage run -a --data-file=/workspace/.coverage --source=/workspace/nemo examples/tts/magpietts.py \
1515
--config-name magpietts \
1616
+train_ds_meta.an4.manifest_path="/home/TestData/an4_dataset/an4_train_context_v1.json" \
1717
+train_ds_meta.an4.audio_dir="/" \
@@ -30,4 +30,4 @@ TORCH_FORCE_NO_WEIGHTS_ONLY_LOAD=1 coverage run -a --data-file=/workspace/.cover
3030
trainer.strategy=auto \
3131
model.train_ds.dataloader_params.num_workers=0 \
3232
model.validation_ds.dataloader_params.num_workers=0 \
33-
~trainer.check_val_every_n_epoch
33+
~trainer.check_val_every_n_epoch

tests/functional_tests/L2_TTS_Fast_dev_runs_Magpietts_MoE.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
14-
TORCH_FORCE_NO_WEIGHTS_ONLY_LOAD=1 coverage run -a --data-file=/workspace/.coverage --source=/workspace/nemo examples/tts/magpietts.py \
14+
HF_HUB_OFFLINE=1 TORCH_FORCE_NO_WEIGHTS_ONLY_LOAD=1 coverage run -a --data-file=/workspace/.coverage --source=/workspace/nemo examples/tts/magpietts.py \
1515
--config-name magpietts \
1616
name="MagpieTTS-MoE" \
1717
+model.use_moe=true \

tests/functional_tests/L2_TTS_Fast_dev_runs_Magpietts_MultiEncoder.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
14-
TORCH_FORCE_NO_WEIGHTS_ONLY_LOAD=1 coverage run -a --data-file=/workspace/.coverage --source=/workspace/nemo examples/tts/magpietts.py \
14+
HF_HUB_OFFLINE=1 TORCH_FORCE_NO_WEIGHTS_ONLY_LOAD=1 coverage run -a --data-file=/workspace/.coverage --source=/workspace/nemo examples/tts/magpietts.py \
1515
--config-name magpietts \
1616
model.model_type=multi_encoder_context_tts \
1717
+model.transcript_decoder_layers=[3,4,5,6,7] \

tests/functional_tests/L2_TTS_InferEvaluate_EasyMagpietts.sh

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616
# that is incompatible with torch.use_deterministic_algorithms(True) on CUDA >= 10.2.
1717
# Setting CUBLAS_WORKSPACE_CONFIG is not sufficient since the error originates inside the
1818
# transformers library (modeling_qwen2.py Qwen2RotaryEmbedding.forward).
19-
TORCH_FORCE_NO_WEIGHTS_ONLY_LOAD=1 coverage run -a --data-file=/workspace/.coverage --source=/workspace/nemo examples/tts/magpietts_inference.py \
19+
CUBLAS_WORKSPACE_CONFIG=:4096:8 HF_HUB_OFFLINE=1 TORCH_FORCE_NO_WEIGHTS_ONLY_LOAD=1 coverage run -a --data-file=/workspace/.coverage --source=/workspace/nemo examples/tts/magpietts_inference.py \
20+
--deterministic \
2021
--codecmodel_path /home/TestData/tts/25fps_spectral_codec_with_bandwidth_extension.nemo \
2122
--nemo_files /home/TestData/tts/2603_EasyMagpieTTS/EMTTS_Pretraining_Qwen_WithCrossLingual_3_5_Delay.nemo \
2223
--out_dir ./emp_zs_0 \
@@ -34,5 +35,7 @@ TORCH_FORCE_NO_WEIGHTS_ONLY_LOAD=1 coverage run -a --data-file=/workspace/.cover
3435
--phoneme_tokenizer_path /home/TestData/tts/2603_EasyMagpieTTS/bpe_ipa_tokenizer_2048_en_de_es_fr_hi_it_vi_zh.json \
3536
--temperature 0.6 \
3637
--clean_up_disk \
37-
--cer_target 0.20 \
38-
--ssim_target 0.65
38+
--cer_target 0.10 \
39+
--ssim_target 0.70 \
40+
--asr_model_name /home/TestData/tts/pretrained_models/parakeet-tdt-1.1b/parakeet-tdt-1.1b.nemo \
41+
--eou_model_name /home/TestData/tts/pretrained_models/wav2vec2-base-960h

tests/functional_tests/L2_TTS_InferEvaluate_Magpietts_FrameStacking.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
# Tests a 4x-stacked model with local transformer inference.
1616

17-
HF_HUB_OFFLINE=1 TORCH_FORCE_NO_WEIGHTS_ONLY_LOAD=1 coverage run -a --data-file=/workspace/.coverage --source=/workspace/nemo examples/tts/magpietts_inference.py \
17+
CUBLAS_WORKSPACE_CONFIG=:4096:8 HF_HUB_OFFLINE=1 TORCH_FORCE_NO_WEIGHTS_ONLY_LOAD=1 coverage run -a --data-file=/workspace/.coverage --source=/workspace/nemo examples/tts/magpietts_inference.py \
1818
--deterministic \
1919
--codecmodel_path /home/TestData/tts/21fps_causal_codecmodel.nemo \
2020
--datasets_json_path examples/tts/evalset_config.json \

tests/functional_tests/L2_TTS_InferEvaluate_Magpietts_MoE_ZeroShot.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
14-
HF_HUB_OFFLINE=1 TORCH_FORCE_NO_WEIGHTS_ONLY_LOAD=1 coverage run -a --data-file=/workspace/.coverage --source=/workspace/nemo examples/tts/magpietts_inference.py \
14+
CUBLAS_WORKSPACE_CONFIG=:4096:8 HF_HUB_OFFLINE=1 TORCH_FORCE_NO_WEIGHTS_ONLY_LOAD=1 coverage run -a --data-file=/workspace/.coverage --source=/workspace/nemo examples/tts/magpietts_inference.py \
1515
--deterministic \
1616
--nemo_files "/home/TestData/tts/2602_MoE/moe16_sinkhorn_top1_valLoss5.0469_step2625132_epoch524.nemo" \
1717
--codecmodel_path "/home/TestData/tts/21fps_causal_codecmodel.nemo" \

tests/functional_tests/L2_TTS_InferEvaluate_Magpietts_SeenSpeakers.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
14-
HF_HUB_OFFLINE=1 TORCH_FORCE_NO_WEIGHTS_ONLY_LOAD=1 coverage run -a --data-file=/workspace/.coverage --source=/workspace/nemo examples/tts/magpietts_inference.py \
14+
CUBLAS_WORKSPACE_CONFIG=:4096:8 HF_HUB_OFFLINE=1 TORCH_FORCE_NO_WEIGHTS_ONLY_LOAD=1 coverage run -a --data-file=/workspace/.coverage --source=/workspace/nemo examples/tts/magpietts_inference.py \
1515
--deterministic \
1616
--codecmodel_path /home/TestData/tts/21fps_causal_codecmodel.nemo \
1717
--datasets_json_path examples/tts/evalset_config.json \

0 commit comments

Comments
 (0)