Monday, January 20, 2014

Theano for GPU Computing

In the near future Flux will be offering GPGPU services based on the Nvidia K20x GPU.

A user had requested support for Theano for GPU computing, so we installed it:
Theano is a Python library that allows you to define, optimize, and evaluate mathematical expressions involving multi-dimensional arrays efficiently. Theano features:
  • tight integration with NumPy – Use numpy.ndarray in Theano-compiled functions.
  • transparent use of a GPU – Perform data-intensive calculations up to 140x faster than with CPU.(float32 only)
  • efficient symbolic differentiation – Theano does your derivatives for function with one or many inputs.
  • speed and stability optimizations – Get the right answer for log(1+x) even when x is really tiny.
  • dynamic C code generation – Evaluate expressions faster.
  • extensive unit-testing and self-verification – Detect and diagnose many types of mistake.
 To use Theano for GPU's run it as so:
Setting device=gpu rather than gpu# lets our system assign the correct GPU for you.  For testing on CPU set device=cpu. Theano has many configuration options but the above are the most common.

 If you want to use Theano on multiple GPUs in a single job contact us.