pretrain_base.sh 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. #!/usr/bin/env bash
  2. # Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
  3. #
  4. # Licensed under the Apache License, Version 2.0 (the "License");
  5. # you may not use this file except in compliance with the License.
  6. # You may obtain a copy of the License at
  7. #
  8. # http://www.apache.org/licenses/LICENSE-2.0
  9. #
  10. # Unless required by applicable law or agreed to in writing, software
  11. # distributed under the License is distributed on an "AS IS" BASIS,
  12. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. # See the License for the specific language governing permissions and
  14. # limitations under the License.
  15. # Pre-trains a BASE model on LibriSpeech
  16. set -a
  17. # IO
  18. : ${OUTPUT_DIR:="results/pretrain_base"}
  19. # Batching
  20. # To best utilize hw, increase batch size by increasing NUM_CONCAT_BATCHES, and lowering UPDATE_FREQ.
  21. # Keep NUM_NODES x $NUM_GPUS x $NUM_CONCAT_BATCHES x $UPDATE_FREQ = 64.
  22. # Note that this script does not control NUM_NODES.
  23. : ${NUM_GPUS:=8}
  24. : ${MAX_TOKENS:=1400000}
  25. : ${NUM_CONCAT_BATCHES:=8}
  26. : ${UPDATE_FREQ:=1}
  27. : ${MAX_SAMPLE_SIZE:=250000}
  28. # Training
  29. : ${MAX_UPDATE:=400000}
  30. : ${LOSS_WEIGHTS:="0.1 10.0"}
  31. : ${LEARNING_RATE:=0.0005}
  32. # Model
  33. : ${NORMALIZE:=false}
  34. : ${MASK_PROB:=0.65}
  35. : ${EXTRACTOR_MODE:="default"}
  36. : ${LAYER_NORM_FIRST:=false}
  37. : ${FINAL_DIM:=256}
  38. : ${LATENT_TEMP:="2.0 0.5 0.999995"}
  39. : ${ENCODER_LAYERDROP:=0.05}
  40. : ${DROPOUT_INPUT:=0.1}
  41. : ${DROPOUT_FEATURES:=0.1}
  42. : ${DROPOUT:=0.1}
  43. : ${ATTENTION_DROPOUT:=0.1}
  44. : ${CONV_BIAS:=false}
  45. : ${ENCODER_LAYERS:=12}
  46. : ${ENCODER_EMBED_DIM:=768}
  47. : ${ENCODER_FFN_EMBED_DIM:=3072}
  48. : ${ENCODER_ATTENTION_HEADS:=12}
  49. : ${FEATURE_GRAD_MULT:=0.1}
  50. : ${HOURGLASS_CONFIG="[2,(8,4),2]"}
  51. bash scripts/pretrain_large.sh "$@"