提交 0f4f011b authored 作者: Arnaud Bergeron's avatar Arnaud Bergeron

Fixes from review.

上级 99e23d19
.. _using_multi_gpu:
.. _tut_using_multi_gpu:
===================
Using multiple GPUs
......@@ -38,10 +38,20 @@ number of such mappings, but in the example above we have two of them:
The mappings themselves are composed of a context name followed by the
two characters '->' and the device name. The context name is a simple
string which oes not have any special meaning for Theano. For parsing
reasons, the context name cannot contain the sequence '->'. The
device name is a device in the form that gpuarray expects like 'cuda0'
or 'opencl0:0'.
string which does not have any special meaning for Theano. For
parsing reasons, the context name cannot contain the sequence '->' or
';'. To avoid confusion context names that begin with 'cuda' or
'opencl' as disallowed. The device name is a device in the form that
gpuarray expects like 'cuda0' or 'opencl0:0'.
.. note::
Since there are a bunch of shell special characters in the syntax,
defining this on the command-line will require proper quoting, like this:
.. code-block:: shell
$ THEANO_FLAGS="contexts=dev0->cuda0"
If you don't have enough GPUs for a certain model, you can assign the
same device to more than one name. You can also assign extra names
......@@ -72,13 +82,13 @@ which perform two dot products on two different GPUs.
import numpy
import theano
v01 = theano.shared(numpy.random.random(1024, 1024).astype('float32'),
v01 = theano.shared(numpy.random.random((1024, 1024)).astype('float32'),
target='dev0')
v02 = theano.shared(numpy.random.random(1024, 1024).astype('float32'),
v02 = theano.shared(numpy.random.random((1024, 1024)).astype('float32'),
target='dev0')
v11 = theano.shared(numpy.random.random(1024, 1024).astype('float32'),
v11 = theano.shared(numpy.random.random((1024, 1024)).astype('float32'),
target='dev1')
v12 = theano.shared(numpy.random.random(1024, 1024).astype('float32'),
v12 = theano.shared(numpy.random.random((1024, 1024)).astype('float32'),
target='dev1')
f = theano.function([], [theano.tensor.dot(v01, v02),
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论