Skip to content

Commit 38d1627

Browse files
committed
pyright complained
1 parent 61954a0 commit 38d1627

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

examples/slurm_poc.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
def test_launch():
1212
result = torchrunx.launch(
1313
func=simple_matmul,
14-
func_kwargs={},
1514
hostnames=torchrunx.slurm_hosts(),
1615
workers_per_host=torchrunx.slurm_workers(),
1716
)
@@ -22,7 +21,7 @@ def test_launch():
2221
print("PASS")
2322

2423

25-
def simple_matmul():
24+
def simple_matmul(test):
2625
rank = int(os.environ["RANK"])
2726
local_rank = int(os.environ["LOCAL_RANK"])
2827
device = torch.device(local_rank) if torch.cuda.is_available() else torch.device("cpu")
@@ -36,7 +35,7 @@ def simple_matmul():
3635

3736
i = torch.rand((500, 100), device=device) # batch, dim
3837
o = torch.matmul(i, w)
39-
38+
print(test)
4039
dist.all_reduce(o, op=dist.ReduceOp.SUM)
4140
print(i)
4241
return o.detach().cpu()

src/torchrunx/launcher.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ class Launcher:
101101
def run(
102102
self,
103103
func: Callable,
104-
func_args: tuple[Any] = (),
104+
func_args: tuple[Any] = tuple(),
105105
func_kwargs: dict[str, Any] = {},
106106
) -> dict[int, Any]:
107107
"""
@@ -258,7 +258,7 @@ def run(
258258

259259
def launch(
260260
func: Callable,
261-
func_args: tuple[Any] = (),
261+
func_args: tuple[Any] = tuple(),
262262
func_kwargs: dict[str, Any] = {},
263263
hostnames: list[str] = ["localhost"],
264264
workers_per_host: int | list[int] = 1,

0 commit comments

Comments
 (0)