Open partizanos opened 4 years ago
I was able to kinda make it work following these steps, but I agree that it might not be the most elegant way:
%%shell
# Clone ThunderSVM repository
git clone https://github.com/Xtra-Computing/thundersvm.git
# Build ThunderSVM
cd thundersvm
mkdir build
cd build
cmake ..
make -j
from importlib.machinery import SourceFileLoader
thundersvm = SourceFileLoader("thundersvm", "/content/thundersvm/python/thundersvm/thundersvm.py").load_module()
svc = svm.SVC(verbose=True)
This is because of the CUDA version in colab is different from which we built pypi packages with, but I have not figured out how to make a package compatible with many CUDA versions.
But you can try this:
in colab
%pip install https://github.com/Xtra-Computing/thundersvm/releases/download/v0.3.4/thundersvm_cuda10.1-0.3.4-cp36-cp36m-linux_x86_64.whl
Collecting thundersvm-cuda10.1==0.3.4
Downloading https://github.com/Xtra-Computing/thundersvm/releases/download/v0.3.4/thundersvm_cuda10.1-0.3.4-cp36-cp36m-linux_x86_64.whl (514kB)
|████████████████████████████████| 522kB 3.8MB/s
Requirement already satisfied: scikit-learn in /usr/local/lib/python3.6/dist-packages (from thundersvm-cuda10.1==0.3.4) (0.22.2.post1)
Requirement already satisfied: scipy in /usr/local/lib/python3.6/dist-packages (from thundersvm-cuda10.1==0.3.4) (1.4.1)
Requirement already satisfied: numpy in /usr/local/lib/python3.6/dist-packages (from thundersvm-cuda10.1==0.3.4) (1.18.3)
Requirement already satisfied: joblib>=0.11 in /usr/local/lib/python3.6/dist-packages (from scikit-learn->thundersvm-cuda10.1==0.3.4) (0.14.1)
Installing collected packages: thundersvm-cuda10.1
Successfully installed thundersvm-cuda10.1-0.3.4
where the links for wheels can be found here
The CUDA version in Google Colab is 10.x. But, to run thundersvm in colab, we need CUDA 9.0. I have listed all the instructions to install and run with possible speedups with thundersvm. You can check it out here: https://medium.com/analytics-vidhya/how-to-install-and-run-thundersvm-in-google-colab-de1fe49eef85
I am able to use Thundersvm in Colab just fine by building and installing with the following cell:
! git clone https://github.com/Xtra-Computing/thundersvm.git
! cd thundersvm && mkdir build && cd build && cmake .. && make -j
! python /content/thundersvm/python/setup.py install
The CUDA version in Google Colab is 10.x. But, to run thundersvm in colab, we need CUDA 9.0. I have listed all the instructions to install and run with possible speedups with thundersvm. You can check it out here: https://medium.com/analytics-vidhya/how-to-install-and-run-thundersvm-in-google-colab-de1fe49eef85
This is the error I got on !wget https://developer.nvidia.com/compute/cuda/9.0/Prod/local_installers/cuda-repo-ubuntu1704-9-0-local_9.0.176-1_amd64-deb
The issue can be replicated with runtime cpu and runtime gpu
I also issues just importing. Steps to reproduce
2) Importing fails