nsys_test.sh 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. GPUS_PER_NODE=8 # <--- remember to change the number of GPUs you actually have in your system
  2. # Change for multinode config
  3. MASTER_ADDR=localhost
  4. MASTER_PORT=6000
  5. NNODES=1 #<-- currently we are using 1 node multigpus
  6. NODE_RANK=0
  7. WORLD_SIZE=8 # <--- remember to change the number of GPUs you actually have in your system
  8. CHECKPOINT_PATH='./Megatron-LM/sv_ckpt/'
  9. DATA_PATH='../dataset/EN/NVblogs_text_document'
  10. VOCAB_FILE='../dataset/EN/50k/gpt2-vocab.json'
  11. MERGE_FILE='../dataset/EN/50k/gpt2-merges.txt'
  12. PROFILE_OUTPUT_PATH='/home/zcharpy/profiles/DLprof/naive/' # modify this to your own profile path
  13. DISTRIBUTED_ARGS="--nproc_per_node $GPUS_PER_NODE --nnodes $NNODES --node_rank $NODE_RANK --master_addr $MASTER_ADDR --master_port $MASTER_PORT"
  14. nsys profile --stats=true --force-overwrite=true --duration=300 --trace=cudnn,cuda,osrt -o /home/zcharpy/profiles/GPT360M_naive \
  15. python -m torch.distributed.launch $DISTRIBUTED_ARGS \
  16. ./Megatron-LM/pretrain_gpt.py \
  17. --num-layers 16 \
  18. --hidden-size 1024 \
  19. --num-attention-heads 16 \
  20. --micro-batch-size 1 \
  21. --global-batch-size 8 \
  22. --seq-length 512 \
  23. --max-position-embeddings 512 \
  24. --train-samples 100 \
  25. --save $CHECKPOINT_PATH \
  26. --load $CHECKPOINT_PATH \
  27. --data-path $DATA_PATH \
  28. --vocab-file $VOCAB_FILE \
  29. --merge-file $MERGE_FILE \
  30. --data-impl mmap \
  31. --split 949,50,1 \
  32. --distributed-backend nccl \
  33. --lr 0.00015 \
  34. --lr-decay-style cosine \
  35. --min-lr 1.0e-5 \
  36. --weight-decay 1e-2 \
  37. --clip-grad 1.0 \
  38. --lr-warmup-fraction .01 \
  39. --checkpoint-activations \
  40. --log-interval 10 \
  41. --save-interval 100 \
  42. --eval-interval 100 \
  43. --eval-iters 10