haste icon indicating copy to clipboard operation
haste copied to clipboard

Install on pip on systems without cuda

Open bratao opened this issue 5 years ago • 7 comments

Hello, In our CI we install the haste_pytorch but it is failing because we do not have cuda. On #2 you said that is possible to run on CPU only scenarios.

Would be possible to install haste_pytorch without requiring cuda?

bratao avatar Sep 16 '20 17:09 bratao

Is the issue that you have machines with no CUDA-capable GPUs in them, or that you're unable to install the CUDA toolkit on those machines? I imagine it's the former since I wouldn't expect CI/CD systems to have GPUs.

sharvil avatar Sep 16 '20 19:09 sharvil

@sharvil I have machines with no CUDA and no GPUs. I would like to install haste on them to predict using the CPU version implemented on https://github.com/lmnt-com/haste/commit/1f47a50f5f453724dc9ff0a023c8b61e6686d739

bratao avatar Sep 16 '20 19:09 bratao

Right, so this seems like a build issue – haste build against CUDA which isn't installed on your target system. Would you be able to install the CUDA toolkit on those machines (https://stackoverflow.com/questions/20186848/can-i-compile-a-cuda-program-without-having-a-cuda-device)?

Alternatively, (I haven't tried this recently) you could export your model to TorchScript after it's trained and use that to run predictions on CPU on a different machine. That way you wouldn't even need haste installed on the target machine.

sharvil avatar Sep 16 '20 20:09 sharvil

I have the same issue. I'm developing on a small notebook and don't want to waste 2GB on a cuda installation. It would be great if there would be something like pip install haste_tf[no-cuda] to dissable the cuda part, when it's not needed.

Zadagu avatar Jan 09 '21 21:01 Zadagu

@Zadagu that sounds like a reasonable request. Out of curiosity, what is your primary reason for using Haste even without CUDA? Is it because regularization is built-in to many of the RNNs, so that you can easily migrate to a fast CUDA implementation once you're done experimenting in your notebook, or some other reason altogether?

sharvil avatar Jan 10 '21 18:01 sharvil

I use haste in combination with pytorch because it provides me the posibility to output the whole sequence of hidden states and cell contents. The notebook is just the debugging platform. The real training will run on a data center using cuda.

Zadagu avatar Jan 10 '21 19:01 Zadagu

Here is a fork that will install in Pypi without cuda https://pypi.org/project/haste-pytorch-cpu/

bratao avatar Jan 11 '21 01:01 bratao