We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f2fc3bf commit fa404eaCopy full SHA for fa404ea
helpers/arguments.py
@@ -3,11 +3,14 @@
3
from helpers.training.state_tracker import StateTracker
4
5
logger = logging.getLogger("ArgsParser")
6
-# Are we the main process?
7
-if __name__ == "__main__":
8
- logger.setLevel(os.environ.get("SIMPLETUNER_LOG_LEVEL", "INFO"))
9
-else:
10
- logger.setLevel("ERROR")
+# Are we the primary process?
+is_primary_process = True
+if os.environ.get("RANK") is not None:
+ if int(os.environ.get("RANK")) != 0:
+ is_primary_process = False
11
+logger.setLevel(
12
+ os.environ.get("SIMPLETUNER_LOG_LEVEL", "INFO" if is_primary_process else "ERROR")
13
+)
14
15
if torch.cuda.is_available():
16
os.environ["NCCL_SOCKET_NTIMEO"] = "2000000"
0 commit comments