profile_SVGPT_BIG.sh 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. # Copyright (c) 2020 NVIDIA Corporation. All rights reserved.
  2. MASTER_ADDR=localhost
  3. MASTER_PORT=6000
  4. NNODES=1 #<-- currently we are using 1 node multigpus
  5. NODE_RANK=0
  6. ### modify this section to point the file to its own path
  7. CHECKPOINT_PATH='./Megatron-LM/sv_ckpt/'
  8. DATA_PATH='../dataset/EN/NVblogs_text_document'
  9. VOCAB_FILE='../dataset/EN/50k/gpt2-vocab.json'
  10. MERGE_FILE='../dataset/EN/50k/gpt2-merges.txt'
  11. PROFILE_OUTPUT_PATH='/home/zcharpy/profiles/DLprof/2ndrun/nsys_improved' # modify this to your own profile path
  12. #### [TODO]--------------- params in the following block are allowed to change -----------####
  13. WORLD_SIZE=8 # <--- remember to change the number of GPUs you actually have in your system
  14. GPUS_PER_NODE=8 # <--- remember to change the number of GPUs you actually have in your system
  15. TENSOR_MP_SIZE=8
  16. PIPELINE_MP_SIZE=1
  17. LAYERS=32
  18. HIDDEN_SZ=2048
  19. NUM_ATTN_HEADS=32
  20. MICRO_BZ=64
  21. GLOBAL_BZ=512
  22. SEQ_LEN=512
  23. MAX_POS_EM=512
  24. #### -------------------- end of blocks ------------------------####
  25. export OMP_NUM_THREADS=1
  26. DISTRIBUTED_ARGS="--nproc_per_node $GPUS_PER_NODE --nnodes $NNODES --node_rank $NODE_RANK --master_addr $MASTER_ADDR --master_port $MASTER_PORT"
  27. ## for nsys run
  28. nsys profile --stats=false --force-overwrite=true --duration=300 --trace=cudnn,cuda,osrt,nvtx -o $PROFILE_OUTPUT_PATH \
  29. python -m torch.distributed.launch $DISTRIBUTED_ARGS \
  30. ./Megatron-LM/Dlprof_pretrain_gpt.py \
  31. --tensor-model-parallel-size $TENSOR_MP_SIZE \
  32. --pipeline-model-parallel-size $PIPELINE_MP_SIZE \
  33. --num-layers $LAYERS \
  34. --hidden-size $HIDDEN_SZ \
  35. --num-attention-heads $NUM_ATTN_HEADS \
  36. --micro-batch-size $MICRO_BZ \
  37. --global-batch-size $GLOBAL_BZ \
  38. --seq-length $SEQ_LEN \
  39. --max-position-embeddings $MAX_POS_EM \
  40. --train-samples 100 \
  41. --save $CHECKPOINT_PATH \
  42. --load $CHECKPOINT_PATH \
  43. --data-path 1. $DATA_PATH \
  44. --vocab-file $VOCAB_FILE \
  45. --merge-file $MERGE_FILE \
  46. --data-impl mmap \
  47. --split 949,50,1 \
  48. --distributed-backend nccl \
  49. --lr 0.00015 \
  50. --lr-decay-style cosine \
  51. --min-lr 1.0e-5 \
  52. --weight-decay 1e-2 \
  53. --clip-grad 1.0 \
  54. --lr-warmup-fraction .01 \
  55. --checkpoint-activations \
  56. --log-interval 10 \
  57. --save-interval 100 \
  58. --eval-interval 200 \
  59. --eval-iters 10 \
  60. --fp16