본문 바로가기
Engineering/에러 해결 모음

[에러] AttributeError: module 'torch.distributed' has no attribute '_reduce_scatter_base'

by Hyen4110 2023. 5. 12.
반응형
pip install torch==1.10

AttributeError: module 'torch.distributed' has no attribute '_reduce_scatter_base'

python 파일을 실행하는데, 아래 부분에서 위의 에러가 났다.

from transformers import (
    MODEL_MAPPING,
    AutoConfig,
    AutoTokenizer,
    AutoModel,
)

apex라는 패키지의 mapping.py에서 발생하는데,
apex-0.1-py3.7.egg 파일 내에 있어서 쉽게 수정이 어려웠다.
구글링을 해보니, torch >=1.10 이어야 지원가능하다는 것 확인.

https://github.com/hpcaitech/ColossalAI/issues/2673#issuecomment-1427297794

현재 torch 1.9.0을 1.10으로 upgrade 했다

pip install torch==1.10

이후 에러 발생하지 않는것 확인!

반응형

댓글