huggingface / accelerate

🚀 A simple way to launch, train, and use PyTorch models on almost any device and distributed configuration, automatic mixed precision (including fp8), and easy-to-configure FSDP and DeepSpeed support
https://huggingface.co/docs/accelerate
Apache License 2.0
7.94k stars 967 forks source link

Uninstalling torch-1.8.2 when install accelerate #2720

Closed 287400117 closed 6 months ago

287400117 commented 6 months ago

System Info

accelerate 0.29.3
OS: Linux e688c49b26f3 5.4.119-19.0009.28 #1 SMP Thu May 18 10:37:10 CST 2023 x86_64 x86_64 x86_64 GNU/Linux
Python 3.8.5

Information

Tasks

Reproduction

Uninstalling torch-1.8.2 when install accelerate image

Expected behavior

root@e688c49b26f3:/workspace/accelerate/examples# pip install accelerate Collecting accelerate Using cached accelerate-0.29.3-py3-none-any.whl.metadata (18 kB) Requirement already satisfied: numpy>=1.17 in /opt/conda/lib/python3.8/site-packages (from accelerate) (1.24.4) Requirement already satisfied: packaging>=20.0 in /opt/conda/lib/python3.8/site-packages (from accelerate) (24.0) Requirement already satisfied: psutil in /opt/conda/lib/python3.8/site-packages (from accelerate) (5.7.2) Requirement already satisfied: pyyaml in /opt/conda/lib/python3.8/site-packages (from accelerate) (5.3.1) Collecting torch>=1.10.0 (from accelerate) Using cached torch-2.3.0-cp38-cp38-manylinux1_x86_64.whl.metadata (26 kB) Requirement already satisfied: huggingface-hub in /opt/conda/lib/python3.8/site-packages (from accelerate) (0.22.2) Requirement already satisfied: safetensors>=0.3.1 in /opt/conda/lib/python3.8/site-packages (from accelerate) (0.4.3) Requirement already satisfied: filelock in /opt/conda/lib/python3.8/site-packages (from torch>=1.10.0->accelerate) (3.0.12) Requirement already satisfied: typing-extensions>=4.8.0 in /opt/conda/lib/python3.8/site-packages (from torch>=1.10.0->accelerate) (4.11.0) Requirement already satisfied: sympy in /opt/conda/lib/python3.8/site-packages (from torch>=1.10.0->accelerate) (1.12) Requirement already satisfied: networkx in /opt/conda/lib/python3.8/site-packages (from torch>=1.10.0->accelerate) (3.1) Requirement already satisfied: jinja2 in /opt/conda/lib/python3.8/site-packages (from torch>=1.10.0->accelerate) (2.11.2) Requirement already satisfied: fsspec in /opt/conda/lib/python3.8/site-packages (from torch>=1.10.0->accelerate) (2024.3.1) Requirement already satisfied: nvidia-cuda-nvrtc-cu12==12.1.105 in /opt/conda/lib/python3.8/site-packages (from torch>=1.10.0->accelerate) (12.1.105) Requirement already satisfied: nvidia-cuda-runtime-cu12==12.1.105 in /opt/conda/lib/python3.8/site-packages (from torch>=1.10.0->accelerate) (12.1.105) Requirement already satisfied: nvidia-cuda-cupti-cu12==12.1.105 in /opt/conda/lib/python3.8/site-packages (from torch>=1.10.0->accelerate) (12.1.105) Requirement already satisfied: nvidia-cudnn-cu12==8.9.2.26 in /opt/conda/lib/python3.8/site-packages (from torch>=1.10.0->accelerate) (8.9.2.26) Requirement already satisfied: nvidia-cublas-cu12==12.1.3.1 in /opt/conda/lib/python3.8/site-packages (from torch>=1.10.0->accelerate) (12.1.3.1) Requirement already satisfied: nvidia-cufft-cu12==11.0.2.54 in /opt/conda/lib/python3.8/site-packages (from torch>=1.10.0->accelerate) (11.0.2.54) Requirement already satisfied: nvidia-curand-cu12==10.3.2.106 in /opt/conda/lib/python3.8/site-packages (from torch>=1.10.0->accelerate) (10.3.2.106) Requirement already satisfied: nvidia-cusolver-cu12==11.4.5.107 in /opt/conda/lib/python3.8/site-packages (from torch>=1.10.0->accelerate) (11.4.5.107) Requirement already satisfied: nvidia-cusparse-cu12==12.1.0.106 in /opt/conda/lib/python3.8/site-packages (from torch>=1.10.0->accelerate) (12.1.0.106) Requirement already satisfied: nvidia-nccl-cu12==2.20.5 in /opt/conda/lib/python3.8/site-packages (from torch>=1.10.0->accelerate) (2.20.5) Requirement already satisfied: nvidia-nvtx-cu12==12.1.105 in /opt/conda/lib/python3.8/site-packages (from torch>=1.10.0->accelerate) (12.1.105) Requirement already satisfied: triton==2.3.0 in /opt/conda/lib/python3.8/site-packages (from torch>=1.10.0->accelerate) (2.3.0) Requirement already satisfied: nvidia-nvjitlink-cu12 in /opt/conda/lib/python3.8/site-packages (from nvidia-cusolver-cu12==11.4.5.107->torch>=1.10.0->accelerate) (12.4.127) Requirement already satisfied: requests in /opt/conda/lib/python3.8/site-packages (from huggingface-hub->accelerate) (2.24.0) Requirement already satisfied: tqdm>=4.42.1 in /opt/conda/lib/python3.8/site-packages (from huggingface-hub->accelerate) (4.66.2) Requirement already satisfied: MarkupSafe>=0.23 in /opt/conda/lib/python3.8/site-packages (from jinja2->torch>=1.10.0->accelerate) (1.1.1) Requirement already satisfied: chardet<4,>=3.0.2 in /opt/conda/lib/python3.8/site-packages (from requests->huggingface-hub->accelerate) (3.0.4) Requirement already satisfied: idna<3,>=2.5 in /opt/conda/lib/python3.8/site-packages (from requests->huggingface-hub->accelerate) (2.10) Requirement already satisfied: urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 in /opt/conda/lib/python3.8/site-packages (from requests->huggingface-hub->accelerate) (1.25.11) Requirement already satisfied: certifi>=2017.4.17 in /opt/conda/lib/python3.8/site-packages (from requests->huggingface-hub->accelerate) (2020.12.5) Requirement already satisfied: mpmath>=0.19 in /opt/conda/lib/python3.8/site-packages (from sympy->torch>=1.10.0->accelerate) (1.3.0) Using cached accelerate-0.29.3-py3-none-any.whl (297 kB) Using cached torch-2.3.0-cp38-cp38-manylinux1_x86_64.whl (779.1 MB) Installing collected packages: torch, accelerate Attempting uninstall: torch Found existing installation: torch 1.8.2+cu111 Uninstalling torch-1.8.2+cu111: Successfully uninstalled torch-1.8.2+cu111 ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts. torchaudio 0.8.2 requires torch==1.8.2, but you have torch 2.3.0 which is incompatible. torchvision 0.9.2+cu111 requires torch==1.8.2, but you have torch 2.3.0 which is incompatible.

BenjaminBossan commented 6 months ago

Accelerate requires torch>=1.10.0. You're using very old versions of torchaudio and torchvision, if you use newer versions, the dependency error should be resolved.

287400117 commented 6 months ago

Accelerate requires torch>=1.10.0. You're using very old versions of torchaudio and torchvision, if you use newer versions, the dependency error should be resolved.

thank you! it worked for me

BenjaminBossan commented 6 months ago

Great.