Make computer go faster - theunissenlab/lab-documentation GitHub Wiki

CPU

One way to improve your performance is to take advantage of multithreading. The default numpy backend is not multithreaded and can only take advantage of one core. You can try to install numpy with a different backend that supports multithreading but I haven't got this to work yet.

GPU

Not sure the best packages/software to interface with our GPUs yet but here are some options.

Add these lines to your .bashrc or .bash_profile or whatever

export CUDA_HOME=/usr/local/cuda
export LD_LIBRARY_PATH=$CUDA_HOME/lib64:$LD_LIBRARY_PATH
export PATH=$CUDA_HOME/bin:$PATH

Python

tensorflow-gpu

step 1: pip install tensorflow-gpu==1.4 (1.5 requires higher version of CUDA and cudnn than we are using)

step 2: learn tensorflow

theano

Here are some ancient notes I wrote on getting theano to work

  • Have scikit-cuda installed

  • Create a file ~/.theanorc

[nvcc]
flags=-D_FORCE_INLINES
 
[cuda]
root=/usr/local/cuda-8.0/
 
[global]
device = cuda
floatX = float32

gnumpy

This has a similar interface to numpy I think. It requires a library called cudamat which is not on pypi so you need to clone and install it. From inside your project directory (and virtualenv if you are using it)

git clone https://github.com/cudamat/cudamat.git
pip install ./cudamat
pip install gnumpy

Example:

$ python
>>> import numpy as np
>>> import gnumpy as gpu
>>> a = np.random.random(size=(100000, 100000))
>>> b = np.random.random(size=(100000, 100000))
>>> a_gpu = gpu.garray(a)
>>> b_gpu = gpu.garray(b)
>>> result = a_gpu.dot(b_gpu).as_numpy_array()

http://www.cs.toronto.edu/~tijmen/gnumpyDoc.html

pycuda

low level?