profile_SVGPT_BIG.sh 2.3 KB

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