Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
974bd517
提交
974bd517
authored
5月 18, 2016
作者:
slefrancois
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Doc corrections for new gpu backend
上级
007b9db2
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
25 行增加
和
18 行删除
+25
-18
install.txt
doc/install.txt
+2
-2
config.txt
doc/library/config.txt
+9
-6
using_gpu.txt
doc/tutorial/using_gpu.txt
+14
-10
没有找到文件。
doc/install.txt
浏览文件 @
974bd517
...
...
@@ -524,8 +524,8 @@ You can also set these options in the .theanorc file's ``[global]`` section:
Note that:
* If your computer has multiple GPUs and you use 'device=cuda', the driver
selects the one to use (usually
gpu
0).
* You can use the program
nvida-smi
to change this policy.
selects the one to use (usually
cuda
0).
* You can use the program
``nvidia-smi``
to change this policy.
* You can choose one specific GPU by specifying 'device=cudaX', with X the
the corresponding GPU index (0, 1, 2, ...)
* By default, when ``device`` indicates preference for GPU computations,
...
...
doc/library/config.txt
浏览文件 @
974bd517
...
...
@@ -103,13 +103,16 @@ import theano and print the config variable, as in:
.. attribute:: device
String value: either ``'cpu'``, ``'cuda'``, ``'cuda0'``, ``'cuda1'``,
``'opencl0:0'``,
or ``'opencl0:1
'`` ...
``'opencl0:0'``,
``'opencl0:1'``, ``'gpu'``, ``'gpu0
'`` ...
Default device for computations. If ``'cuda*``, change the default to try
to move computation to the GPU using CUDA libraries. If ``'opencl*'``,
the openCL libraries will be used. To let the driver select the device,
use ``'cuda'`` or ``'opencl'``. If we are not able to use the GPU,
either we fall back on the CPU, or an error is raised, depending on the :attr:`force_device` flag.
use ``'cuda'`` or ``'opencl'``. If ``'gpu*'``, the old gpu backend will
be used, although users are encouraged to migrate to the new GpuArray
backend. If we are not able to use the GPU,
either we fall back on the CPU, or an error is raised, depending
on the :attr:`force_device` flag.
This flag's value cannot be modified during the program execution.
...
...
@@ -135,11 +138,11 @@ import theano and print the config variable, as in:
.. attribute:: init_gpu_device
String value: either ``''``, ``'cuda'``, ``'cuda0'``, ``'cuda1'``,
``'opencl0:0'``,
or ``'opencl0:1
'`` ...
``'opencl0:0'``,
``'opencl0:1'``, ``'gpu'``, ``'gpu0
'`` ...
Initialize the gpu device to use.
When its value is
cuda* or opencl*, the theano flag :attr:`device` must
be ``"cpu"
``.
When its value is
``'cuda*'``, ``'opencl*'`` or ``'gpu*'``, the theano
flag :attr:`device` must be ``'cpu'
``.
Unlike :attr:`device`, setting this flag to a specific GPU will not
try to use this device by default, in particular it will **not** move
computations, nor shared variables, to the specified GPU.
...
...
doc/tutorial/using_gpu.txt
浏览文件 @
974bd517
...
...
@@ -133,7 +133,7 @@ the GPU object directly. The following code is modified to do just that.
rng = numpy.random.RandomState(22)
x = shared(numpy.asarray(rng.rand(vlen), config.floatX))
f = function([], tensor.exp(x).transfer(
'dev0'
))
f = function([], tensor.exp(x).transfer(
None
))
print(f.maker.fgraph.toposort())
t0 = time.time()
for i in range(iters):
...
...
@@ -148,7 +148,7 @@ the GPU object directly. The following code is modified to do just that.
else:
print('Used the gpu')
Here ``tensor.exp(x).transfer(
'None'
)`` means "copy ``exp(x)`` to the GPU",
Here ``tensor.exp(x).transfer(
None
)`` means "copy ``exp(x)`` to the GPU",
with ``None`` the default GPU context when not explicitly given.
For information on how to set GPU contexts, see :ref:`tut_using_multi_gpu`.
...
...
@@ -158,12 +158,15 @@ The output is
:hide:
:options: +ELLIPSIS, +SKIP
Using device cuda0: ...
[GpuElemwise{exp,no_inplace}(<GpuArray<float64>>)]
Looping 1000 times took ... seconds
Result is ...
$ THEANO_FLAGS=device=cuda0 python gpu_tutorial2.py
Mapped name None to device cuda0: GeForce GTX 680 (cuDNN version 5004)
[GpuElemwise{exp,no_inplace}(<GpuArrayType<None>(float64, (False,))>)]
Looping 1000 times took 0.088381 seconds
Result is [ 1.23178032 1.61879341 1.52278065 ..., 2.20771815 2.29967753
1.62323285]
Used the gpu
.. code-block:: none
$ THEANO_FLAGS=device=cuda0 python gpu_tutorial2.py
...
...
@@ -212,7 +215,7 @@ double (float64) or small (less than 32 bits like int16) data types.
You will get an error at compile time or runtime if this is the case.
By default all inputs will get transferred to GPU. You can prevent an
input from getting transferred by setting its
tag.target
attribute to
input from getting transferred by setting its
``tag.target``
attribute to
'cpu'.
Complex support is untested and most likely completely broken.
...
...
@@ -225,9 +228,10 @@ Tips for Improving Performance on GPU
* The GPU backend supports *float64* variables, but they are still slower
to compute than *float32*. The more *float32*, the better GPU performance
you will get.
* Prefer constructors like ``matrix``, ``vector`` and ``scalar`` to
``dmatrix``, ``dvector`` and ``dscalar`` because the former will give
you *float32* variables and ignore the type given to ``floatX``.
* Prefer constructors like ``matrix``, ``vector`` and ``scalar`` (which
follow the type set in ``floatX``) to ``dmatrix``, ``dvector`` and
``dscalar``. The latter enforce double precision (*float64* on most
machines), which slows down GPU computations on current hardware.
* Minimize transfers to the GPU device by using ``shared`` variables
to store frequently-accessed data (see :func:`shared()<shared.shared>`).
When using the GPU, tensor ``shared`` variables are stored on
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论