Skip to content

Commit c1f522a

Browse files
committed
fixes for pyright
1 parent a080dad commit c1f522a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/torchrunx/launcher.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,10 +121,12 @@ def run(
121121
"""
122122

123123
if self.auto:
124-
if self.workers_per_host is None:
125-
self.workers_per_host = auto_workers()
126124
if self.hostnames is None:
127125
self.hostnames = auto_hosts()
126+
if self.workers_per_host is None:
127+
self.workers_per_host = auto_workers()
128+
129+
assert self.hostnames is not None and self.workers_per_host is not None
128130

129131
if not dist.is_available():
130132
raise RuntimeError("The torch.distributed package is not available.")

0 commit comments

Comments
 (0)