-
Notifications
You must be signed in to change notification settings - Fork 6.4k
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
BriaTransformer2DModel
introduces a hard dependency on torch._C._distributed_c10d
which is NOT present in all torch variants/flavors.
Any torch._C
import should be guarded with if-available, not a hard dependency on the entire library.
Without that, diffusers stop being a cross-platform solution.
Reproduction
Attempt to import diffusers, it will immediately fail
Downstream issue: vladmandic/sdnext#4240
Logs
│E:\Work\LLM\sdnext-amd\venv\Lib\site-packages\diffusers\models\transformers\__init__.py:20 in <module> │
│ │
│ 19 from .transformer_allegro import AllegroTransformer3DModel │
│❱ 20 from .transformer_bria import BriaTransformer2DModel │
│ 21 from .transformer_chroma import ChromaTransformer2DModel │
│ │
│E:\Work\LLM\sdnext-amd\venv\Lib\site-packages\diffusers\models\transformers\transformer_bria.py:14 in <module> │
│ │
│ 13 from ..attention import AttentionModuleMixin, FeedForward │
│❱ 14 from ..attention_dispatch import dispatch_attention_fn │
│ 15 from ..cache_utils import CacheMixin │
│ │
│E:\Work\LLM\sdnext-amd\venv\Lib\site-packages\diffusers\models\attention_dispatch.py:23 in <module> │
│ │
│ 22 import torch │
│❱ 23 import torch.distributed._functional_collectives as funcol │
│ 24 │
│ │
│E:\Work\LLM\sdnext-amd\venv\Lib\site-packages\torch\distributed\_functional_collectives.py:9 in <module> │
│ │
│ 8 import torch.distributed as dist │
│❱ 9 import torch.distributed.distributed_c10d as c10d │
│ 10 from torch.distributed.device_mesh import DeviceMesh │
│ │
│E:\Work\LLM\sdnext-amd\venv\Lib\site-packages\torch\distributed\distributed_c10d.py:23 in <module> │
│ │
│ 22 from torch._C import _DistStoreError as DistStoreError │
│❱ 23 from torch._C._distributed_c10d import ( │
│ 24 _DistributedBackendOptions, │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
ModuleNotFoundError: No module named 'torch._C._distributed_c10d'; 'torch._C' is not a package
System Info
diffusers main branch: 64a5187
torch-rocm for windows preview build, specifically from https://repo.radeon.com/rocm/windows/rocm-rel-6.4.4/torch/
Who can help?
sayakpaul
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working