nsys_profiling.sh 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. # Copyright (c) 2022 NVIDIA Corporation. All rights reserved.
  2. #
  3. # Licensed under the Apache License, Version 2.0 (the "License");
  4. # you may not use this file except in compliance with the License.
  5. # You may obtain a copy of the License at
  6. #
  7. # http://www.apache.org/licenses/LICENSE-2.0
  8. #
  9. # Unless required by applicable law or agreed to in writing, software
  10. # distributed under the License is distributed on an "AS IS" BASIS,
  11. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. # See the License for the specific language governing permissions and
  13. # limitations under the License.
  14. # Nsys Profile Flags
  15. export ENABLE_PROFILE=1
  16. export PROFILE_START_STEP=100
  17. export PROFILE_STOP_STEP=120
  18. NSYS_CMD=" \
  19. nsys profile --stats=true \
  20. --output ./log/%p.qdrep \
  21. --force-overwrite true \
  22. -t cuda,nvtx,osrt,cudnn,cublas \
  23. --capture-range=cudaProfilerApi \
  24. --capture-range-end=stop \
  25. --gpu-metrics-device=0 \
  26. --sample=cpu \
  27. -d 60 \
  28. --kill=sigkill \
  29. -x true"
  30. PADDLE_CMD=" \
  31. python -m paddle.distributed.launch \
  32. --gpus=0,1,2,3,4,5,6,7 \
  33. train.py \
  34. --epochs 1"
  35. if [[ ${ENABLE_PROFILE} -ge 1 ]]; then
  36. ${NSYS_CMD} ${PADDLE_CMD}
  37. else
  38. ${PADDLE_CMD}
  39. fi
  40. export ENABLE_PROFILE=0