Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
tchaton committed May 13, 2024
1 parent 1b3f4e7 commit 264f7e1
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/utilities/test_env.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
from litdata.utilities.env import _DistributedEnv


def test_distributed_env_from_env(monkeypatch):
monkeypatch.setenv("WORLD_SIZE", 2)
monkeypatch.setenv("GLOBAL_RANK", 1)
monkeypatch.setenv("NNODES", 2)

dist_env = _DistributedEnv.detect()
assert dist_env.world_size == 2
assert dist_env.global_rank == 1
assert dist_env.num_nodes == 2

0 comments on commit 264f7e1

Please sign in to comment.