profile_naive_run.sh 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. # Copyright (c) 2020 NVIDIA Corporation. All rights reserved.
  2. GPUS_PER_NODE=2 # <--- 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=2 # <--- remember to change the number of GPUs you actually have in your system
  9. CHECKPOINT_PATH='../sv_ckpt/' ## modify this path if you customize it
  10. DATA_PATH='../dataset/EN/NVblog_text_document' ## modify this path if you customize it
  11. VOCAB_FILE='../dataset/EN/50k/gpt2-vocab.json' ## modify this path if you customize it
  12. MERGE_FILE='../dataset/EN/50k/gpt2-merges.txt' ## modify this path if you customize it
  13. PROFILE_OUTPUT_PATH='../profiles/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,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