Skip to content

Commit

Permalink
Guard thunder/distributed/transforms/ by torch.distributed.is_availab…
Browse files Browse the repository at this point in the history
…le (#212)
  • Loading branch information
IvanYashchuk authored Apr 19, 2024
1 parent bb80c5a commit 91ac188
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions thunder/distributed/transforms/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
from .ddp import optimize_allreduce_in_ddp_backward
from .fsdp import FSDPCommBucketing
import torch

if torch.distributed.is_available():
from .ddp import optimize_allreduce_in_ddp_backward
from .fsdp import FSDPCommBucketing
else:
optimize_allreduce_in_ddp_backward = None
FSDPCommBucketing = None

__all__ = [
"optimize_allreduce_in_ddp_backward",
Expand Down

0 comments on commit 91ac188

Please sign in to comment.