nsys_test.sh 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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/' # 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. nsys profile --stats=true --force-overwrite=true --duration=300 --trace=cudnn,cuda,osrt -o /home/zcharpy/profiles/GPT360M_naive \
  16. python -m torch.distributed.launch $DISTRIBUTED_ARGS \
  17. ./Megatron-LM/pretrain_gpt.py \
  18. --num-layers 16 \
  19. --hidden-size 1024 \
  20. --num-attention-heads 16 \
  21. --micro-batch-size 1 \
  22. --global-batch-size 8 \
  23. --seq-length 512 \
  24. --max-position-embeddings 512 \
  25. --train-samples 100 \
  26. --save $CHECKPOINT_PATH \
  27. --load $CHECKPOINT_PATH \
  28. --data-path $DATA_PATH \
  29. --vocab-file $VOCAB_FILE \
  30. --merge-file $MERGE_FILE \
  31. --data-impl mmap \
  32. --split 949,50,1 \
  33. --distributed-backend nccl \
  34. --lr 0.00015 \
  35. --lr-decay-style cosine \
  36. --min-lr 1.0e-5 \
  37. --weight-decay 1e-2 \
  38. --clip-grad 1.0 \
  39. --lr-warmup-fraction .01 \
  40. --checkpoint-activations \
  41. --log-interval 10 \
  42. --save-interval 100 \
  43. --eval-interval 100 \
  44. --eval-iters 10