본문 바로가기
Error Note

ncclInvalidArgument: Invalid value for an argument.

by ga.0_0.ga 2024. 9. 20.
728x90
반응형

pytorch 분산 처리 코드 부분에서 다음과 같은 에러가 발생하는 경우가 있습니다.

  File "/opt/conda/lib/python3.10/site-packages/torch/distributed/c10d_logger.py", line 47, in wrapper
    return func(*args, **kwargs)
  File "/opt/conda/lib/python3.10/site-packages/torch/distributed/distributed_c10d.py", line 2806, in all_gather
    work = default_pg.allgather([tensor_list], [tensor])
torch.distributed.DistBackendError: NCCL error in: ../torch/csrc/distributed/c10d/NCCLUtils.hpp:219, invalid argument, NCCL version 2.14.3
ncclInvalidArgument: Invalid value for an argument.
Last error:
Invalid config blocking attribute value -2147483648

 

nvidia-nccl이 서로 다른 버전으로 중복 설치되어 발생하는 에러였습니다.

 

[해결 방법] 

먼저 아래 명령어로 설치된 nvidia-nccl 목록들을 확인해줍니다.

pip list | grep nccl

 

저의 경우에는 2.14.3 과 2.18.1 두 가지가 설치되었네요

 

저는 cuda 12.1을 사용 중이므로 nvidia-nccl-cu11 는 삭제해주겠습니다. 

pip uninstall nvidia-nccl-cu11

 

 

코드를 다시 실행하면 정상 작동합니다! 

728x90
반응형

댓글