File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22import logging
33import itertools
44import os
5+ from datetime import datetime
56from packaging .version import parse , Version
67import re
78from typing import Optional , Tuple , List
4041weight_coeff = 1024
4142
4243# Guard for https://github.com/pytorch/pytorch/pull/82450
44+ def get_nvidia_pytorch_version ():
45+ ver = os .getenv ("NVIDIA_PYTORCH_VERSION" , "22.08" )
46+ if "master" in ver :
47+ ver = datetime .today ().strftime ("%y.%m" )
48+ elif "update_for_" in ver :
49+ ver = ver .replace ("update_for_" , "" )
50+ return ver
51+
4352CAN_SKIP_SYNC_AFTER_BATCH_ISEND_IRECV = False
4453ngc_container_2209 , pytorch_113 = Version ("22.09" ), Version ("1.13" )
45- if parse (os . getenv ( "NVIDIA_PYTORCH_VERSION" , "22.08" )) >= ngc_container_2209 :
54+ if parse (torch . __version__ ) >= pytorch_113 :
4655 CAN_SKIP_SYNC_AFTER_BATCH_ISEND_IRECV = True
47- elif parse (torch . __version__ ) >= pytorch_113 :
56+ elif parse (get_nvidia_pytorch_version ()) >= ngc_container_2209 :
4857 CAN_SKIP_SYNC_AFTER_BATCH_ISEND_IRECV = True
4958else :
5059 CAN_SKIP_SYNC_AFTER_BATCH_ISEND_IRECV = False
You can’t perform that action at this time.
0 commit comments