Skip to content

Commit bfeb06a

Browse files
nWEIdiacrcrpar
andauthored
Update apex/transformer/utils.py
Co-authored-by: Masaki Kozuki <[email protected]>
1 parent 64aea56 commit bfeb06a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

apex/transformer/utils.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
# The following 4 lines are for backward comparability with
99
# older PyTorch.
1010
if "all_gather_into_tensor" not in dir(torch.distributed):
11-
assert torch.distributed.is_available(), "PyTorch Distributed is Not available or Disabled."
11+
if not torch.distributed.is_available():
12+
raise RuntimeError("PyTorch Distributed is Not available or Disabled.")
1213
torch.distributed.all_gather_into_tensor = torch.distributed._all_gather_base
1314

1415
def ensure_divisibility(numerator, denominator):

0 commit comments

Comments
 (0)