Skip to content

Commit

Permalink
Update distributed.py
Browse files Browse the repository at this point in the history
  • Loading branch information
matbun committed Jan 9, 2025
1 parent 77f8eca commit 270474d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/itwinai/torch/distributed.py
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,7 @@ def local_world_size(self) -> int:
"""
if torch.cuda.is_available():
return torch.cuda.device_count()
if not "LOCAL_WORLD_SIZE" in os.environ:
if "LOCAL_WORLD_SIZE" not in os.environ:
raise RuntimeError(
"Could not retrieve local world size as CUDA is unavailable and there is "
"no 'LOCAL_WORLD_SIZE' environment variable."
Expand Down Expand Up @@ -674,7 +674,7 @@ def local_world_size(self) -> int:
"""
if torch.cuda.is_available():
return torch.cuda.device_count()
if not "LOCAL_WORLD_SIZE" in os.environ:
if "LOCAL_WORLD_SIZE" not in os.environ:
raise RuntimeError(
"Could not retrieve local world size as CUDA is unavailable and there is "
"no 'LOCAL_WORLD_SIZE' environment variable."
Expand Down

0 comments on commit 270474d

Please sign in to comment.