verify_GPT3_Svenska.sh 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. # Copyright (c) 2020 NVIDIA Corporation. All rights reserved.
  2. GPUS_PER_NODE=4
  3. # Change for multinode config
  4. MASTER_ADDR=localhost
  5. MASTER_PORT=6000
  6. NNODES=1
  7. NODE_RANK=0
  8. WORLD_SIZE=8
  9. TENSOR_MP_SIZE=1
  10. PIPELINE_MP_SIZE=1
  11. CHECKPOINT_PATH='./Megatron-LM/sv_ckpt/'
  12. DATA_PATH='../dataset/EN/NVblogs_text_document'
  13. VOCAB_FILE='../dataset/EN/50k/gpt2-vocab.json'
  14. MERGE_FILE='../dataset/EN/50k/gpt2-merges.txt'
  15. DISTRIBUTED_ARGS="--nproc_per_node $GPUS_PER_NODE --nnodes $NNODES --node_rank $NODE_RANK --master_addr $MASTER_ADDR --master_port $MASTER_PORT"
  16. python -m torch.distributed.launch $DISTRIBUTED_ARGS \
  17. ./Megatron-LM/pretrain_gpt.py \
  18. --tensor-model-parallel-size $TENSOR_MP_SIZE \
  19. --pipeline-model-parallel-size $PIPELINE_MP_SIZE \
  20. --num-layers 24 \
  21. --hidden-size 1024 \
  22. --num-attention-heads 16 \
  23. --seq-length 512 \
  24. --max-position-embeddings 512 \
  25. --lr 0.00015 \
  26. --micro-batch-size 1 \
  27. --train-samples 100 \
  28. --save $CHECKPOINT_PATH \
  29. --load $CHECKPOINT_PATH \
  30. --data-path $DATA_PATH \
  31. --vocab-file $VOCAB_FILE \
  32. --merge-file $MERGE_FILE \
  33. --data-impl mmap \
  34. --split 949,50,1 \
  35. --distributed-backend nccl \
  36. --lr 0.00015 \
  37. --lr-decay-style cosine \
  38. --min-lr 1.0e-5 \
  39. --weight-decay 1e-5 \
  40. --clip-grad 1.0 \
  41. --lr-warmup-fraction .01 \
  42. --checkpoint-activations \
  43. --log-interval 10 \
  44. --save-interval 100 \
  45. --eval-interval 100 \
  46. --eval-iters 10 \
  47. --fp16