You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
When installing farm-haystack on Linux, torch is installed with GPU support. This causes the Haystack dependencies to go up from 1.4GB to 4GB which is limiting for deployment. On Mac and Windows this is not the case due to how torch dependencies are defined, for example in my poetry.lock:
Similar to how other extras during installation are defined like all/all-gpu, faiss/faiss-gpu, docstores/docstores-gpu, the default install pip install farm-haystack could only provide CPU-support, and pip install farm-haystack[gpu] would enable GPU-support.
Describe alternatives you've considered
We ran into this issue when developing on Mac, but deploying in a Linux docker container. If only CPU-support is wanted, an option working with poetry is adding the following CPU-only dependencies for torch and torchvision to your pyproject.toml.
This however makes the dependencies platform-specific, which is not ideal.
Additional context
This seems to be a general problem of torch with dependency management, as it does not offer GPU-support as e.g. an extra dependency. This has been discussed for example in this issue in the torch repository:
This is an important point. PyTorch GPU dependencies including NVIDIA cublas, cudnn etc. are very large, take time, and are unnecessary if running without a GPU. Our dependency is farm-haystack[faiss,ocr]==1.13.2 which triggers all kinds of GPU dependency downloads that are never used or taken advantage of given we're deploying on Cloud Run, which is entirely CPU-bound.
Is your feature request related to a problem? Please describe.
When installing
farm-haystack
on Linux,torch
is installed with GPU support. This causes the Haystack dependencies to go up from 1.4GB to 4GB which is limiting for deployment. On Mac and Windows this is not the case due to howtorch
dependencies are defined, for example in mypoetry.lock
:Describe the solution you'd like
Similar to how other extras during installation are defined like
all
/all-gpu
,faiss
/faiss-gpu
,docstores
/docstores-gpu
, the default installpip install farm-haystack
could only provide CPU-support, andpip install farm-haystack[gpu]
would enable GPU-support.Describe alternatives you've considered
We ran into this issue when developing on Mac, but deploying in a Linux docker container. If only CPU-support is wanted, an option working with
poetry
is adding the following CPU-only dependencies fortorch
andtorchvision
to yourpyproject.toml
.This however makes the dependencies platform-specific, which is not ideal.
Additional context
This seems to be a general problem of
torch
with dependency management, as it does not offer GPU-support as e.g. an extra dependency. This has been discussed for example in this issue in thetorch
repository:pytorch/pytorch#26340
The text was updated successfully, but these errors were encountered: