Skip to content

Commit

Permalink
Print the hostname to be used in conjunction with --tag-output (mpiru…
Browse files Browse the repository at this point in the history
…n) or --label (srun)
  • Loading branch information
Quentin-Anthony committed Mar 28, 2023
1 parent 37f25c1 commit 67e89b7
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions deepspeed/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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()

Expand Down

0 comments on commit 67e89b7

Please sign in to comment.