Skip to content

[Issue]: Failed to import torch._C._distributed_c10d #4240

@burretploof

Description

@burretploof

Issue Description

SD.Next refuses to start because a package cannot import diffusers.pipelines.pipeline_utils and diffusers.models.autoencoders.autoencoder_kl

This is on ROCm 6.4.4 ( w/ 9070 XT) on SD.Next dev branch.
I have run a clean installation three times and it always fails like that. Maybe an upstream diffusers issue?

Version Platform Description

08:03:59-713163 INFO Starting SD.Next
08:03:59-716766 INFO Logger: file="E:\Work\LLM\sdnext-amd\sdnext.log" level=DEBUG host="Burret-PC" size=77
mode=create
08:03:59-718313 INFO Python: version=3.12.11 platform=Windows bin="E:\Work\LLM\sdnext-amd\venv\Scripts\python.exe"
venv="E:\Work\LLM\sdnext-amd\venv"
08:03:59-984192 INFO Version: app=sd.next updated=2025-09-30 hash=0c1d34721 branch=dev
url=https://github.com/vladmandic/sdnext.git/tree/dev ui=dev
08:04:00-462704 INFO Version: app=sd.next latest=2025-09-29T23:37:58Z hash=0c1d3472 branch=dev
08:04:00-496274 INFO Platform: arch=AMD64 cpu=AMD64 Family 25 Model 33 Stepping 0, AuthenticAMD system=Windows
release=Windows-11-10.0.26100-SP0 python=3.12.11 locale=('English_Germany', '1252')
docker=False
08:04:00-497841 DEBUG Packages: prefix=venv site=['venv', 'venv\Lib\site-packages']
08:04:00-498867 INFO Args: ['--debug', '--use-rocm', '--use-nightly']
08:04:00-499899 DEBUG Setting environment tuning
08:04:00-500927 DEBUG Torch allocator: "garbage_collection_threshold:0.80,max_split_size_mb:512"
08:04:00-501440 DEBUG Install: package="gradio" install required
08:04:53-649988 INFO Verifying torch installation
08:04:53-663400 DEBUG Torch overrides: cuda=False rocm=True ipex=False directml=False openvino=False zluda=False
08:04:53-717742 INFO ROCm: AMD toolkit detected
08:04:53-718768 INFO ROCm: agents=['gfx1201']
08:04:53-719280 INFO ROCm: version=6.4, using agent gfx1201
08:04:53-720303 INFO Python: version=3.12.11 platform=Windows bin="E:\Work\LLM\sdnext-amd\venv\Scripts\python.exe"
venv="E:\Work\LLM\sdnext-amd\venv"
08:04:53-729042 DEBUG Install: package="torch" install required
08:04:53-729556 INFO Torch: download and install in progress... cmd="--no-cache-dir
https://repo.radeon.com/rocm/windows/rocm-rel-6.4.4/torch-2.8.0a0%2Bgitfc14c65-cp312-cp312-win_
amd64.whl
https://repo.radeon.com/rocm/windows/rocm-rel-6.4.4/torchvision-0.24.0a0%2Bc85f008-cp312-cp312-
win_amd64.whl"
08:07:39-147565 DEBUG Install: package="onnx" install required
08:08:01-501310 DEBUG Install: package="onnxruntime" install required
08:08:10-785659 INFO Transformers install: version=4.56.2
08:08:59-351777 INFO Diffusers install: commit=64a5187d96f9376c7cf5123db810f2d2da79d7d0

Relevant log output

08:08:59-351777 INFO     Diffusers install: commit=64a5187d96f9376c7cf5123db810f2d2da79d7d0
08:09:44-313217 INFO     Install requirements: this may take a while...
08:12:08-942125 INFO     Install: verifying requirements
08:12:20-319066 INFO     Startup: standard
08:12:20-320095 INFO     Verifying submodules
08:12:23-654828 DEBUG    Git submodule: extensions-builtin/sd-extension-chainner / main
08:12:23-789477 DEBUG    Git submodule: extensions-builtin/sd-extension-system-info / main
08:12:23-972026 DEBUG    Git detached head detected: folder="extensions-builtin/sdnext-modernui" reattach=dev
08:12:23-973066 DEBUG    Git submodule: extensions-builtin/sdnext-modernui / dev
08:12:24-123361 DEBUG    Git submodule: extensions-builtin/stable-diffusion-webui-rembg / master
08:12:24-313565 DEBUG    Git detached head detected: folder="wiki" reattach=master
08:12:24-314585 DEBUG    Git submodule: wiki / master
08:12:24-527876 DEBUG    Installed packages: 165
08:12:24-529414 DEBUG    Extensions all: ['sd-extension-chainner', 'sd-extension-system-info', 'sdnext-modernui',
                         'stable-diffusion-webui-rembg']
08:12:24-872736 DEBUG    Extension installer: builtin=True
                         file="E:\Work\LLM\sdnext-amd\extensions-builtin\stable-diffusion-webui-rembg\install.py"
08:12:31-790680 INFO     Extension installed packages: stable-diffusion-webui-rembg
                         ['opencv-python-headless==4.12.0.88', 'pooch==1.8.2', 'pymatting==1.1.14', 'rembg==2.0.67']
08:12:31-792259 DEBUG    Extensions all: []
08:12:31-793305 INFO     Extensions enabled: ['sd-extension-chainner', 'sd-extension-system-info', 'sdnext-modernui',
                         'stable-diffusion-webui-rembg']
08:12:31-920411 INFO     Install: verifying requirements
08:12:31-924015 DEBUG    Setup complete without errors: 1759212752
08:12:31-930206 DEBUG    Extension preload: {'extensions-builtin': 0.0, 'extensions': 0.0}
08:12:31-931752 INFO     Installer time: total=1272.21 pip=513.37 install=276.87 torch=165.50 requirements=148.11
                         transformers=48.57 diffusers=44.83 onnx=31.64 base=17.42 packages=8.03
                         stable-diffusion-webui-rembg=6.92 git=4.26 submodules=4.08 branch=0.79 latest=0.74 version=0.26
                         installed=0.26 files=0.14 sd-extension-chainner=0.11 sdnext-modernui=0.11
                         sd-extension-system-info=0.11 amd=0.06
08:12:31-933820 INFO     Command line args: ['--debug', '--use-rocm', '--use-nightly'] use_rocm=True use_nightly=True
                         args=[]
08:12:31-934853 DEBUG    Env flags: []
08:12:31-935881 DEBUG    Starting module: <module 'webui' from 'E:\\Work\\LLM\\sdnext-amd\\webui.py'>
╭───────────────────────────────────────── Traceback (most recent call last) ──────────────────────────────────────────╮
│E:\Work\LLM\sdnext-amd\venv\Lib\site-packages\diffusers\utils\import_utils.py:974 in _get_module                      │
│                                                                                                                      │
│  973         try:                                                                                                    │
│❱ 974             return importlib.import_module("." + module_name, self.__name__)                                    │
│  975         except Exception as e:                                                                                  │
│                                                                                                                      │
│C:\Users\Burret\.conda\envs\sdnext312\Lib\importlib\__init__.py:90 in import_module                                   │
│                                                                                                                      │
│   89             level += 1                                                                                          │
│❱  90     return _bootstrap._gcd_import(name[level:], package, level)                                                 │
│   91                                                                                                                 │
│in _gcd_import:1387                                                                                                   │
│in _find_and_load:1360                                                                                                │
│in _find_and_load_unlocked:1310                                                                                       │
│in _call_with_frames_removed:488                                                                                      │
│in _gcd_import:1387                                                                                                   │
│in _find_and_load:1360                                                                                                │
│                                                                                                                      │
│                                               ... 7 frames hidden ...                                                │
│                                                                                                                      │
│E:\Work\LLM\sdnext-amd\venv\Lib\site-packages\diffusers\models\unets\__init__.py:6 in <module>                        │
│                                                                                                                      │
│   5     from .unet_1d import UNet1DModel                                                                             │
│❱  6     from .unet_2d import UNet2DModel                                                                             │
│   7     from .unet_2d_condition import UNet2DConditionModel                                                          │
│                                                                                                                      │
│E:\Work\LLM\sdnext-amd\venv\Lib\site-packages\diffusers\models\unets\unet_2d.py:24 in <module>                        │
│                                                                                                                      │
│   23 from ..modeling_utils import ModelMixin                                                                         │
│❱  24 from .unet_2d_blocks import UNetMidBlock2D, get_down_block, get_up_block                                        │
│   25                                                                                                                 │
│                                                                                                                      │
│E:\Work\LLM\sdnext-amd\venv\Lib\site-packages\diffusers\models\unets\unet_2d_blocks.py:36 in <module>                 │
│                                                                                                                      │
│    35 )                                                                                                              │
│❱   36 from ..transformers.dual_transformer_2d import DualTransformer2DModel                                          │
│    37 from ..transformers.transformer_2d import Transformer2DModel                                                   │
│                                                                                                                      │
│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

The above exception was the direct cause of the following exception:

╭───────────────────────────────────────── Traceback (most recent call last) ──────────────────────────────────────────╮
│E:\Work\LLM\sdnext-amd\venv\Lib\site-packages\diffusers\utils\import_utils.py:974 in _get_module                      │
│                                                                                                                      │
│  973         try:                                                                                                    │
│❱ 974             return importlib.import_module("." + module_name, self.__name__)                                    │
│  975         except Exception as e:                                                                                  │
│                                                                                                                      │
│C:\Users\Burret\.conda\envs\sdnext312\Lib\importlib\__init__.py:90 in import_module                                   │
│                                                                                                                      │
│   89             level += 1                                                                                          │
│❱  90     return _bootstrap._gcd_import(name[level:], package, level)                                                 │
│   91                                                                                                                 │
│in _gcd_import:1387                                                                                                   │
│in _find_and_load:1360                                                                                                │
│in _find_and_load_unlocked:1331                                                                                       │
│in _load_unlocked:935                                                                                                 │
│in exec_module:999                                                                                                    │
│in _call_with_frames_removed:488                                                                                      │
│                                                                                                                      │
│E:\Work\LLM\sdnext-amd\venv\Lib\site-packages\diffusers\pipelines\pipeline_utils.py:47 in <module>                    │
│                                                                                                                      │
│    46 from ..configuration_utils import ConfigMixin                                                                  │
│❱   47 from ..models import AutoencoderKL                                                                             │
│    48 from ..models.attention_processor import FusedAttnProcessor2_0                                                 │
│in _handle_fromlist:1412                                                                                              │
│                                                                                                                      │
│E:\Work\LLM\sdnext-amd\venv\Lib\site-packages\diffusers\utils\import_utils.py:964 in __getattr__                      │
│                                                                                                                      │
│  963         elif name in self._class_to_module.keys():                                                              │
│❱ 964             module = self._get_module(self._class_to_module[name])                                              │
│  965             value = getattr(module, name)                                                                       │
│                                                                                                                      │
│E:\Work\LLM\sdnext-amd\venv\Lib\site-packages\diffusers\utils\import_utils.py:976 in _get_module                      │
│                                                                                                                      │
│  975         except Exception as e:                                                                                  │
│❱ 976             raise RuntimeError(                                                                                 │
│  977                 f"Failed to import {self.__name__}.{module_name} because of the following error (look up to see │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
RuntimeError: Failed to import diffusers.models.autoencoders.autoencoder_kl because of the following error (look up to see its traceback):
No module named 'torch._C._distributed_c10d'; 'torch._C' is not a package

The above exception was the direct cause of the following exception:

╭───────────────────────────────────────── Traceback (most recent call last) ──────────────────────────────────────────╮
│E:\Work\LLM\sdnext-amd\launch.py:335 in <module>                                                                      │
│                                                                                                                      │
│  334 if __name__ == "__main__":                                                                                      │
│❱ 335     main()                                                                                                      │
│  336                                                                                                                 │
│                                                                                                                      │
│E:\Work\LLM\sdnext-amd\launch.py:303 in main                                                                          │
│                                                                                                                      │
│  302                                                                                                                 │
│❱ 303     uv, instance = start_server(immediate=True, server=None)                                                    │
│  304     t_server = time.time()                                                                                      │
│                                                                                                                      │
│E:\Work\LLM\sdnext-amd\launch.py:212 in start_server                                                                  │
│                                                                                                                      │
│  211     installer.log.debug(f'Starting module: {server}')                                                           │
│❱ 212     module_spec.loader.exec_module(server)                                                                      │
│  213     uvicorn = None                                                                                              │
│in exec_module:999                                                                                                    │
│in _call_with_frames_removed:488                                                                                      │
│                                                                                                                      │
│E:\Work\LLM\sdnext-amd\webui.py:12 in <module>                                                                        │
│                                                                                                                      │
│   11 from threading import Thread                                                                                    │
│❱  12 import modules.loader                                                                                           │
│   13 import modules.hashes                                                                                           │
│                                                                                                                      │
│E:\Work\LLM\sdnext-amd\modules\loader.py:166 in <module>                                                              │
│                                                                                                                      │
│  165 transformers.utils.logging.tqdm = _tqdm_cls()                                                                   │
│❱ 166 diffusers.pipelines.pipeline_utils.logging.tqdm = _tqdm_cls()                                                   │
│  167 huggingface_hub._snapshot_download.hf_tqdm = _tqdm_old # pylint: disable=protected-access                       │
│                                                                                                                      │
│E:\Work\LLM\sdnext-amd\venv\Lib\site-packages\diffusers\utils\import_utils.py:962 in __getattr__                      │
│                                                                                                                      │
│  961         if name in self._modules:                                                                               │
│❱ 962             value = self._get_module(name)                                                                      │
│  963         elif name in self._class_to_module.keys():                                                              │
│                                                                                                                      │
│E:\Work\LLM\sdnext-amd\venv\Lib\site-packages\diffusers\utils\import_utils.py:976 in _get_module                      │
│                                                                                                                      │
│  975         except Exception as e:                                                                                  │
│❱ 976             raise RuntimeError(                                                                                 │
│  977                 f"Failed to import {self.__name__}.{module_name} because of the following error (look up to see │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
RuntimeError: Failed to import diffusers.pipelines.pipeline_utils because of the following error (look up to see its traceback):
Failed to import diffusers.models.autoencoders.autoencoder_kl because of the following error (look up to see its traceback):
No module named 'torch._C._distributed_c10d'; 'torch._C' is not a package
Press any key to continue . . .

Backend

Diffusers

Compute

AMD ROCm

Interface

Standard

Branch

Dev

Model

Other

Acknowledgements

  • I have read the above and searched for existing issues
  • I confirm that this is classified correctly and its not an extension issue

Metadata

Metadata

Assignees

No one assigned

    Labels

    upstreamFix is required in upstream library

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions