From 67e89b7dcce083709a4bcdab70ff17f2272af0e4 Mon Sep 17 00:00:00 2001 From: Quentin-Anthony Date: Tue, 28 Mar 2023 21:28:26 +0000 Subject: [PATCH] Print the hostname to be used in conjunction with --tag-output (mpirun) or --label (srun) --- deepspeed/__init__.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/deepspeed/__init__.py b/deepspeed/__init__.py index 9e2e25513a72..bead98a40a51 100755 --- a/deepspeed/__init__.py +++ b/deepspeed/__init__.py @@ -10,6 +10,7 @@ from torch.optim import Optimizer from torch.optim.lr_scheduler import _LRScheduler from packaging import version as pkg_version +import subprocess from . import ops from . import module_inject @@ -116,6 +117,11 @@ def initialize(args=None, __git_branch__), ranks=[0]) + hostname_cmd = ["hostname -I"] + result = subprocess.check_output(hostname_cmd, shell=True) + hostname = result.decode('utf-8').split()[0] + print("Host: {}".format(hostname)) + # Disable zero.Init context if it's currently enabled zero.partition_parameters.shutdown_init_context()