Skip to content

Commit 345864e

Browse files
authored
fix more torch.distributed imports (#12425)
* up * unguard.
1 parent 35e538d commit 345864e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/diffusers/hooks/context_parallel.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,10 @@
1717
from typing import Dict, List, Type, Union
1818

1919
import torch
20-
import torch.distributed._functional_collectives as funcol
20+
21+
22+
if torch.distributed.is_available():
23+
import torch.distributed._functional_collectives as funcol
2124

2225
from ..models._modeling_parallel import (
2326
ContextParallelConfig,

0 commit comments

Comments
 (0)