-
Couldn't load subscription status.
- Fork 6.4k
Closed
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 packageSystem 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