From 493643fff886df88e7174b5b84b62c48461eea5b Mon Sep 17 00:00:00 2001 From: Patrick von Platen Date: Fri, 24 Sep 2021 18:32:35 +0200 Subject: [PATCH] up (#13733) --- examples/pytorch/speech-recognition/README.md | 2 +- .../speech-recognition/run_speech_recognition_ctc.py | 8 +------- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/examples/pytorch/speech-recognition/README.md b/examples/pytorch/speech-recognition/README.md index 43832655ed..17de8d7d26 100644 --- a/examples/pytorch/speech-recognition/README.md +++ b/examples/pytorch/speech-recognition/README.md @@ -81,7 +81,7 @@ of **0.35**. The following command shows how to fine-tune [XLSR-Wav2Vec2](https://huggingface.co/transformers/master/model_doc/xlsr_wav2vec2.html) on [Common Voice](https://huggingface.co/datasets/common_voice) using 8 GPUs in half-precision. ```bash -python -m torch.distributed.launch \ +OMP_NUM_THREADS=1 python -m torch.distributed.launch \ --nproc_per_node 8 run_speech_recognition_ctc.py \ --dataset_name="common_voice" \ --model_name_or_path="facebook/wav2vec2-large-xlsr-53" \ diff --git a/examples/pytorch/speech-recognition/run_speech_recognition_ctc.py b/examples/pytorch/speech-recognition/run_speech_recognition_ctc.py index a62b580748..c762eaa820 100755 --- a/examples/pytorch/speech-recognition/run_speech_recognition_ctc.py +++ b/examples/pytorch/speech-recognition/run_speech_recognition_ctc.py @@ -103,12 +103,6 @@ class ModelArguments: "vectors will be masked along the time axis. This is only relevant if ``apply_spec_augment is True``." }, ) - gradient_checkpointing: Optional[bool] = field( - default=False, - metadata={ - "help": "If True, use gradient checkpointing to save memory at the expense of slower backward pass." - }, - ) layerdrop: Optional[float] = field(default=0.0, metadata={"help": "The LayerDrop probability."}) ctc_loss_reduction: Optional[str] = field( default="mean", metadata={"help": "The way the ctc loss should be reduced. Should be one of 'mean' or 'sum'."} @@ -438,7 +432,7 @@ def main(): "hidden_dropout": model_args.hidden_dropout, "final_dropout": model_args.final_dropout, "mask_time_prob": model_args.mask_time_prob, - "gradient_checkpointing": model_args.gradient_checkpointing, + "gradient_checkpointing": training_args.gradient_checkpointing, "layerdrop": model_args.layerdrop, "ctc_loss_reduction": model_args.ctc_loss_reduction, "pad_token_id": processor.tokenizer.pad_token_id,