Skip to content

Commit

Permalink
fix: Do not change layerdrop and padding in a multi-GPU setup, as it …
Browse files Browse the repository at this point in the history
…is not required
  • Loading branch information
saattrupdan committed Sep 26, 2024
1 parent 5100bf5 commit deff165
Show file tree
Hide file tree
Showing 12 changed files with 10 additions and 25 deletions.
1 change: 0 additions & 1 deletion config/asr_finetuning.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ streaming: true
cache_dir: null

# Can be `longest`, `max_length` or `do_not_pad`
# NOTE: This is automatically set to `max_length` in a multi-gpu setting
padding: longest

# This is a list of the sampling probability of each dataset, where null means that
Expand Down
2 changes: 1 addition & 1 deletion config/model/test-wav2vec2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ mask_time_prob: 0.5
mask_time_length: 10
mask_feature_prob: 0.5
mask_feature_length: 64
layerdrop: 0.1 # NOTE: This will automatically be set to 0 in a multi-gpu setting
layerdrop: 0.1
ctc_loss_reduction: sum

# Decoder hyperparameters
Expand Down
2 changes: 1 addition & 1 deletion config/model/test-whisper.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ mask_time_prob: 0.5
mask_time_length: 10
mask_feature_prob: 0.5
mask_feature_length: 64
layerdrop: 0.1 # NOTE: This will automatically be set to 0 in a multi-gpu setting
layerdrop: 0.1
2 changes: 1 addition & 1 deletion config/model/wav2vec2-large.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ mask_time_prob: 0.5
mask_time_length: 10
mask_feature_prob: 0.5
mask_feature_length: 64
layerdrop: 0.1 # NOTE: This will automatically be set to 0 in a multi-gpu setting
layerdrop: 0.1
ctc_loss_reduction: sum

# Decoder hyperparameters
Expand Down
2 changes: 1 addition & 1 deletion config/model/wav2vec2-medium.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ mask_time_prob: 0.5
mask_time_length: 10
mask_feature_prob: 0.5
mask_feature_length: 64
layerdrop: 0.1 # NOTE: This will automatically be set to 0 in a multi-gpu setting
layerdrop: 0.1
ctc_loss_reduction: sum

# Decoder hyperparameters
Expand Down
2 changes: 1 addition & 1 deletion config/model/wav2vec2-small.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ mask_time_prob: 0.5
mask_time_length: 10
mask_feature_prob: 0.5
mask_feature_length: 64
layerdrop: 0.1 # NOTE: This will automatically be set to 0 in a multi-gpu setting
layerdrop: 0.1
ctc_loss_reduction: sum

# Decoder hyperparameters
Expand Down
2 changes: 1 addition & 1 deletion config/model/whisper-large.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ mask_time_prob: 0.5
mask_time_length: 10
mask_feature_prob: 0.5
mask_feature_length: 64
layerdrop: 0.1 # NOTE: This will automatically be set to 0 in a multi-gpu setting
layerdrop: 0.1
2 changes: 1 addition & 1 deletion config/model/whisper-medium.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ mask_time_prob: 0.5
mask_time_length: 10
mask_feature_prob: 0.5
mask_feature_length: 64
layerdrop: 0.1 # NOTE: This will automatically be set to 0 in a multi-gpu setting
layerdrop: 0.1
2 changes: 1 addition & 1 deletion config/model/whisper-small.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ mask_time_prob: 0.5
mask_time_length: 10
mask_feature_prob: 0.5
mask_feature_length: 64
layerdrop: 0.1 # NOTE: This will automatically be set to 0 in a multi-gpu setting
layerdrop: 0.1
2 changes: 1 addition & 1 deletion config/model/whisper-xsmall.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ mask_time_prob: 0.5
mask_time_length: 10
mask_feature_prob: 0.5
mask_feature_length: 64
layerdrop: 0.1 # NOTE: This will automatically be set to 0 in a multi-gpu setting
layerdrop: 0.1
2 changes: 1 addition & 1 deletion config/model/whisper-xxsmall.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ mask_time_prob: 0.5
mask_time_length: 10
mask_feature_prob: 0.5
mask_feature_length: 64
layerdrop: 0.1 # NOTE: This will automatically be set to 0 in a multi-gpu setting
layerdrop: 0.1
14 changes: 0 additions & 14 deletions src/scripts/finetune_asr_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,20 +44,6 @@ def main(config: DictConfig) -> None:
"GPU training"
)
config.gradient_checkpointing = False
# if "layerdrop" in config.model and config.model.layerdrop != 0.0:
# if is_main_process:
# logger.info(
# "Forcing `layerdrop` to be 0.0 as this is required in a multi-GPU "
# "training"
# )
# config.model.layerdrop = 0.0
# if config.padding != "max_length":
# if is_main_process:
# logger.info(
# "Forcing `padding` to be 'max_length' as this is required in a "
# "multi-GPU training"
# )
# config.padding = "max_length"

finetune(config=config)

Expand Down

0 comments on commit deff165

Please sign in to comment.