fix(python): move accelerate and GPU-specific libs to build-type (#3194)

Some of the dependencies in `requirements.txt`, even if generic, pulls
down the line CUDA libraries.

This changes moves mostly all GPU-specific libs to the build-type, and
tries a safer approach. In `requirements.txt` now are listed only
"first-level" dependencies, for instance, grpc, but libs-dependencies
are moved down to the respective build-type `requirements.txt` to avoid
any mixin.

This should fix #2737 and #1592.

Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
This commit is contained in:
Ettore Di Giacinto 2024-08-07 17:02:32 +02:00 committed by GitHub
parent abcf0ff000
commit 61b5602111
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
79 changed files with 212 additions and 61 deletions

View File

@ -0,0 +1,4 @@
transformers
accelerate
torch
torchaudio

View File

@ -1,3 +1,5 @@
--extra-index-url https://download.pytorch.org/whl/cu118 --extra-index-url https://download.pytorch.org/whl/cu118
torch torch
torchaudio torchaudio
transformers
accelerate

View File

@ -1,2 +1,4 @@
torch torch
torchaudio torchaudio
transformers
accelerate

View File

@ -1,3 +1,5 @@
--extra-index-url https://download.pytorch.org/whl/rocm6.0 --extra-index-url https://download.pytorch.org/whl/rocm6.0
torch torch
torchaudio torchaudio
transformers
accelerate

View File

@ -3,4 +3,6 @@ intel-extension-for-pytorch
torch torch
torchaudio torchaudio
optimum[openvino] optimum[openvino]
setuptools==70.3.0 # https://github.com/mudler/LocalAI/issues/2406 setuptools==70.3.0 # https://github.com/mudler/LocalAI/issues/2406
transformers
accelerate

View File

@ -1,6 +1,4 @@
accelerate
bark==0.1.5 bark==0.1.5
grpcio==1.65.4 grpcio==1.65.4
protobuf protobuf
certifi certifi
transformers

View File

@ -0,0 +1,3 @@
transformers
accelerate
torch

View File

@ -1,3 +1,5 @@
--extra-index-url https://download.pytorch.org/whl/cu118 --extra-index-url https://download.pytorch.org/whl/cu118
torch torch
torchaudio torchaudio
transformers
accelerate

View File

@ -1,2 +1,4 @@
torch torch
torchaudio torchaudio
transformers
accelerate

View File

@ -1,3 +1,5 @@
--extra-index-url https://download.pytorch.org/whl/rocm6.0 --extra-index-url https://download.pytorch.org/whl/rocm6.0
torch torch
torchaudio torchaudio
transformers
accelerate

View File

@ -3,4 +3,6 @@ intel-extension-for-pytorch
torch torch
torchaudio torchaudio
optimum[openvino] optimum[openvino]
setuptools==72.1.0 # https://github.com/mudler/LocalAI/issues/2406 setuptools==72.1.0 # https://github.com/mudler/LocalAI/issues/2406
transformers
accelerate

View File

@ -1,6 +1,4 @@
accelerate
TTS==0.22.0 TTS==0.22.0
grpcio==1.65.4 grpcio==1.65.4
protobuf protobuf
certifi certifi
transformers

View File

@ -0,0 +1,8 @@
diffusers
opencv-python
transformers
accelerate
compel
peft
sentencepiece
torch

View File

@ -1,2 +1,9 @@
--extra-index-url https://download.pytorch.org/whl/cu118 --extra-index-url https://download.pytorch.org/whl/cu118
torch torch
diffusers
opencv-python
transformers
accelerate
compel
peft
sentencepiece

View File

@ -1 +1,8 @@
torch torch
diffusers
opencv-python
transformers
accelerate
compel
peft
sentencepiece

View File

@ -1,3 +1,10 @@
--extra-index-url https://download.pytorch.org/whl/rocm6.0 --extra-index-url https://download.pytorch.org/whl/rocm6.0
torch torch
torchvision torchvision
diffusers
opencv-python
transformers
accelerate
compel
peft
sentencepiece

View File

@ -3,4 +3,11 @@ intel-extension-for-pytorch
torch torch
torchvision torchvision
optimum[openvino] optimum[openvino]
setuptools==70.3.0 # https://github.com/mudler/LocalAI/issues/2406 setuptools==70.3.0 # https://github.com/mudler/LocalAI/issues/2406
diffusers
opencv-python
transformers
accelerate
compel
peft
sentencepiece

View File

@ -0,0 +1,3 @@
transformers
accelerate
torch

View File

@ -1,2 +1,4 @@
--extra-index-url https://download.pytorch.org/whl/cu118 --extra-index-url https://download.pytorch.org/whl/cu118
torch torch
transformers
accelerate

View File

@ -1 +1,3 @@
torch torch
transformers
accelerate

View File

@ -1,5 +1,4 @@
grpcio==1.65.0 grpcio==1.65.0
protobuf protobuf
transformers
certifi certifi
setuptools setuptools

View File

@ -0,0 +1,3 @@
transformers
accelerate
torch

View File

@ -1,2 +1,4 @@
--extra-index-url https://download.pytorch.org/whl/cu118 --extra-index-url https://download.pytorch.org/whl/cu118
torch torch
transformers
accelerate

View File

@ -1 +1,3 @@
torch torch
transformers
accelerate

View File

@ -1,4 +1,3 @@
accelerate
grpcio==1.65.4 grpcio==1.65.4
protobuf protobuf
certifi certifi

View File

@ -1 +1,2 @@
torch torch
transformers

View File

@ -1,2 +1,3 @@
--extra-index-url https://download.pytorch.org/whl/cu118 --extra-index-url https://download.pytorch.org/whl/cu118
torch torch
transformers

View File

@ -1 +1,2 @@
torch torch
transformers

View File

@ -1,4 +1,3 @@
grpcio==1.65.1 grpcio==1.65.1
protobuf protobuf
certifi certifi
transformers

View File

@ -0,0 +1 @@
torch

View File

@ -0,0 +1,3 @@
transformers
accelerate
torch

View File

@ -1,3 +1,5 @@
--extra-index-url https://download.pytorch.org/whl/cu118 --extra-index-url https://download.pytorch.org/whl/cu118
torch torch
torchaudio torchaudio
transformers
accelerate

View File

@ -1,2 +1,4 @@
torch torch
torchaudio torchaudio
transformers
accelerate

View File

@ -1,3 +1,5 @@
--extra-index-url https://download.pytorch.org/whl/rocm6.0 --extra-index-url https://download.pytorch.org/whl/rocm6.0
torch torch
torchaudio torchaudio
transformers
accelerate

View File

@ -3,4 +3,6 @@ intel-extension-for-pytorch
torch torch
torchaudio torchaudio
optimum[openvino] optimum[openvino]
setuptools==72.1.0 # https://github.com/mudler/LocalAI/issues/2406 setuptools==72.1.0 # https://github.com/mudler/LocalAI/issues/2406
transformers
accelerate

View File

@ -1,6 +1,4 @@
accelerate
grpcio==1.65.1 grpcio==1.65.1
protobuf protobuf
git+https://github.com/huggingface/parler-tts.git@10016fb0300c0dc31a0fb70e26f3affee7b62f16 git+https://github.com/huggingface/parler-tts.git@10016fb0300c0dc31a0fb70e26f3affee7b62f16
certifi certifi
transformers

View File

@ -0,0 +1,3 @@
transformers
accelerate
torch

View File

@ -1,2 +1,3 @@
--extra-index-url https://download.pytorch.org/whl/cu118 --extra-index-url https://download.pytorch.org/whl/cu118
torch torch
transformers

View File

@ -1 +1,2 @@
torch torch
transformers

View File

@ -1,2 +1,3 @@
--extra-index-url https://download.pytorch.org/whl/rocm6.0 --extra-index-url https://download.pytorch.org/whl/rocm6.0
torch torch
transformers

View File

@ -2,4 +2,5 @@
intel-extension-for-pytorch intel-extension-for-pytorch
torch torch
optimum[openvino] optimum[openvino]
setuptools==72.1.0 # https://github.com/mudler/LocalAI/issues/2406 setuptools==72.1.0 # https://github.com/mudler/LocalAI/issues/2406
transformers

View File

@ -1,3 +1,2 @@
git+https://github.com/bigscience-workshop/petals git+https://github.com/bigscience-workshop/petals
certifi certifi
transformers

View File

@ -0,0 +1,4 @@
transformers
accelerate
torch
rerankers[transformers]

View File

@ -1,2 +1,5 @@
--extra-index-url https://download.pytorch.org/whl/cu118 --extra-index-url https://download.pytorch.org/whl/cu118
transformers
accelerate
torch torch
rerankers[transformers]

View File

@ -1 +1,4 @@
transformers
accelerate
torch torch
rerankers[transformers]

View File

@ -1,2 +1,5 @@
--extra-index-url https://download.pytorch.org/whl/rocm6.0 --extra-index-url https://download.pytorch.org/whl/rocm6.0
torch transformers
accelerate
torch
rerankers[transformers]

View File

@ -1,5 +1,8 @@
--extra-index-url https://pytorch-extension.intel.com/release-whl/stable/xpu/us/ --extra-index-url https://pytorch-extension.intel.com/release-whl/stable/xpu/us/
intel-extension-for-pytorch intel-extension-for-pytorch
transformers
accelerate
torch torch
rerankers[transformers]
optimum[openvino] optimum[openvino]
setuptools==72.1.0 # https://github.com/mudler/LocalAI/issues/2406 setuptools==72.1.0 # https://github.com/mudler/LocalAI/issues/2406

View File

@ -1,6 +1,3 @@
accelerate
rerankers[transformers]
grpcio==1.65.4 grpcio==1.65.4
protobuf protobuf
certifi certifi
transformers

View File

@ -0,0 +1,6 @@
torch
accelerate
transformers
bitsandbytes
sentence-transformers==3.0.1
transformers

View File

@ -1,2 +1,5 @@
--extra-index-url https://download.pytorch.org/whl/cu118 --extra-index-url https://download.pytorch.org/whl/cu118
torch torch
accelerate
sentence-transformers==3.0.1
transformers

View File

@ -1 +1,4 @@
torch torch
accelerate
sentence-transformers==3.0.1
transformers

View File

@ -1,2 +1,5 @@
--extra-index-url https://download.pytorch.org/whl/rocm6.0 --extra-index-url https://download.pytorch.org/whl/rocm6.0
torch torch
accelerate
sentence-transformers==3.0.1
transformers

View File

@ -2,4 +2,7 @@
intel-extension-for-pytorch intel-extension-for-pytorch
torch torch
optimum[openvino] optimum[openvino]
setuptools==69.5.1 # https://github.com/mudler/LocalAI/issues/2406 setuptools==69.5.1 # https://github.com/mudler/LocalAI/issues/2406
accelerate
sentence-transformers==3.0.1
transformers

View File

@ -1,6 +1,3 @@
accelerate
sentence-transformers==3.0.1
transformers
grpcio==1.65.1 grpcio==1.65.1
protobuf protobuf
certifi certifi

View File

@ -0,0 +1,3 @@
transformers
accelerate
torch

View File

@ -1,2 +1,4 @@
--extra-index-url https://download.pytorch.org/whl/cu118 --extra-index-url https://download.pytorch.org/whl/cu118
torch transformers
accelerate
torch

View File

@ -1 +1,3 @@
torch transformers
accelerate
torch

View File

@ -1,2 +1,4 @@
--extra-index-url https://download.pytorch.org/whl/rocm6.0 --extra-index-url https://download.pytorch.org/whl/rocm6.0
transformers
accelerate
torch torch

View File

@ -1,5 +1,7 @@
--extra-index-url https://pytorch-extension.intel.com/release-whl/stable/xpu/us/ --extra-index-url https://pytorch-extension.intel.com/release-whl/stable/xpu/us/
intel-extension-for-pytorch intel-extension-for-pytorch
transformers
accelerate
torch torch
optimum[openvino] optimum[openvino]
setuptools==69.5.1 # https://github.com/mudler/LocalAI/issues/2406 setuptools==69.5.1 # https://github.com/mudler/LocalAI/issues/2406

View File

@ -1,5 +1,3 @@
accelerate
transformers
grpcio==1.65.4 grpcio==1.65.4
protobuf protobuf
scipy==1.14.0 scipy==1.14.0

View File

@ -0,0 +1,4 @@
torch
accelerate
transformers
bitsandbytes

View File

@ -1,2 +1,5 @@
--extra-index-url https://download.pytorch.org/whl/cu118 --extra-index-url https://download.pytorch.org/whl/cu118
torch torch
accelerate
transformers
bitsandbytes

View File

@ -1 +1,4 @@
torch torch
accelerate
transformers
bitsandbytes

View File

@ -1,2 +1,5 @@
--extra-index-url https://download.pytorch.org/whl/rocm6.0 --extra-index-url https://download.pytorch.org/whl/rocm6.0
torch torch
accelerate
transformers
bitsandbytes

View File

@ -2,3 +2,5 @@
intel-extension-for-pytorch intel-extension-for-pytorch
torch torch
optimum[openvino] optimum[openvino]
intel-extension-for-transformers
bitsandbytes

View File

@ -1,8 +1,4 @@
accelerate
transformers
grpcio==1.65.4 grpcio==1.65.4
protobuf protobuf
certifi certifi
intel-extension-for-transformers setuptools==69.5.1 # https://github.com/mudler/LocalAI/issues/2406
bitsandbytes
setuptools==69.5.1 # https://github.com/mudler/LocalAI/issues/2406

View File

@ -0,0 +1,3 @@
accelerate
torch
torchaudio

View File

@ -1,3 +1,4 @@
--extra-index-url https://download.pytorch.org/whl/cu118 --extra-index-url https://download.pytorch.org/whl/cu118
accelerate
torch torch
torchaudio torchaudio

View File

@ -1,2 +1,3 @@
accelerate
torch torch
torchaudio torchaudio

View File

@ -1,3 +1,4 @@
--extra-index-url https://download.pytorch.org/whl/rocm6.0 --extra-index-url https://download.pytorch.org/whl/rocm6.0
accelerate
torch torch
torchaudio torchaudio

View File

@ -1,5 +1,6 @@
--extra-index-url https://pytorch-extension.intel.com/release-whl/stable/xpu/us/ --extra-index-url https://pytorch-extension.intel.com/release-whl/stable/xpu/us/
intel-extension-for-pytorch intel-extension-for-pytorch
accelerate
torch torch
torchaudio torchaudio
optimum[openvino] optimum[openvino]

View File

@ -1,4 +1,3 @@
accelerate
grpcio==1.65.4 grpcio==1.65.4
protobuf protobuf
certifi certifi

View File

@ -0,0 +1 @@
flash-attn

View File

@ -0,0 +1,4 @@
accelerate
torch
transformers
vllm

View File

@ -1,3 +1,5 @@
--extra-index-url https://download.pytorch.org/whl/cu118 --extra-index-url https://download.pytorch.org/whl/cu118
accelerate
torch torch
flash-attn transformers
vllm

View File

@ -1,2 +1,4 @@
accelerate
torch torch
flash-attn transformers
vllm

View File

@ -1,2 +1,5 @@
--extra-index-url https://download.pytorch.org/whl/rocm6.0 --extra-index-url https://download.pytorch.org/whl/rocm6.0
torch accelerate
torch
transformers
vllm

View File

@ -1,5 +1,8 @@
--extra-index-url https://pytorch-extension.intel.com/release-whl/stable/xpu/us/ --extra-index-url https://pytorch-extension.intel.com/release-whl/stable/xpu/us/
intel-extension-for-pytorch intel-extension-for-pytorch
accelerate
torch torch
transformers
optimum[openvino] optimum[openvino]
setuptools==70.3.0 # https://github.com/mudler/LocalAI/issues/2406 setuptools==70.3.0 # https://github.com/mudler/LocalAI/issues/2406
vllm

View File

@ -1,7 +1,4 @@
accelerate
vllm
grpcio==1.65.4 grpcio==1.65.4
protobuf protobuf
certifi certifi
transformers
setuptools setuptools