verify_GPT3_Svenska.sh 1.5 KB

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