profile_naive_run.sh 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. # Copyright (c) 2020 NVIDIA Corporation. All rights reserved.
  2. GPUS_PER_NODE=8 # <--- remember to change the number of GPUs you actually have in your system
  3. # Change for multinode config
  4. MASTER_ADDR=localhost
  5. MASTER_PORT=6000
  6. NNODES=1 #<-- currently we are using 1 node multigpus
  7. NODE_RANK=0
  8. WORLD_SIZE=8 # <--- remember to change the number of GPUs you actually have in your system
  9. CHECKPOINT_PATH='./Megatron-LM/sv_ckpt/'
  10. DATA_PATH='../dataset/EN/NVblogs_text_document'
  11. VOCAB_FILE='../dataset/EN/50k/gpt2-vocab.json'
  12. MERGE_FILE='../dataset/EN/50k/gpt2-merges.txt'
  13. PROFILE_OUTPUT_PATH='/home/zcharpy/profiles/DLprof/naive/nsys_naive' # modify this to your own profile path
  14. DISTRIBUTED_ARGS="--nproc_per_node $GPUS_PER_NODE --nnodes $NNODES --node_rank $NODE_RANK --master_addr $MASTER_ADDR --master_port $MASTER_PORT"
  15. ## for nsys run
  16. nsys profile --stats=false --force-overwrite=true --duration=300 --trace=cudnn,cuda,osrt,nvtx -o $PROFILE_OUTPUT_PATH \
  17. python -m torch.distributed.launch $DISTRIBUTED_ARGS \
  18. ./Megatron-LM/Dlprof_pretrain_gpt.py \
  19. --num-layers 16 \
  20. --hidden-size 1024 \
  21. --num-attention-heads 16 \
  22. --micro-batch-size 1 \
  23. --global-batch-size 8 \
  24. --seq-length 512 \
  25. --max-position-embeddings 512 \
  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-2 \
  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