Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
1b81a00e
提交
1b81a00e
authored
10月 18, 2015
作者:
Frederic
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Start a documentation section about memory/speed trade-off
上级
4e0b5023
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
53 行增加
和
2 行删除
+53
-2
faq.txt
doc/faq.txt
+39
-0
config.txt
doc/library/config.txt
+14
-2
没有找到文件。
doc/faq.txt
浏览文件 @
1b81a00e
...
@@ -225,3 +225,42 @@ preferable not to use those dtypes together.
...
@@ -225,3 +225,42 @@ preferable not to use those dtypes together.
To help you find where float64 are created, see the
To help you find where float64 are created, see the
:attr:`warn_float64` Theano flag.
:attr:`warn_float64` Theano flag.
Theano memory/speed trade-off
-----------------------------
There is a few things you can easily do to change the trade-off
between speed and memory usage. It nothing is said, this affect the
CPU and GPU memory usage.
Could speed up and lower memory usage:
- :ref:`CuDNN <libdoc_cuda_dnn>` default CuDNN convolution use less
memory then Theano version. But some flags allow it to use more
memory. GPU only.
- Shortly avail, multi-GPU.
Could raise memory usage but speed up computation:
- :attr:`config.lib.cnmem` =1 # Do not raise much memory usage, but if you are at the limit of GPU memory available. GPU only.
- :attr:`config.allow_gc` =False
- :attr:`config.optimizer_excluding` =low_memory , GPU only for now.
Could lower the memory usage, but raise computation time:
- :attr:`config.scan.allow_gc` =True # Probably not significant slowdown if config.lib.cnmem is used.
- :attr:`config.scan.allow_output_prealloc` =False
- Use :func:`batch_normalization()
<theano.tensor.nnet.bn.batch_normalization>`. It use less memory
then building a corresponding Theano graph.
- Disable one or scan more optimizations:
- ``optimizer_excluding=scanOp_pushout_seqs_ops``
- ``optimizer_excluding=scan_pushout_dot1``
- ``optimizer_excluding=scanOp_pushout_output``
- Disable all optimization tagged as raising memory usage:
``optimizer_excluding=more_mem`` (currently only the 3 scan optimizations above)
- `float16 <https://github.com/Theano/Theano/issues/2908>`_.
If you want to analyze the memory usage during computation, the
simplest is to let the memory error happen during Theano execution and
use the Theano flags :attr:`exception_verbosity=high`.
doc/library/config.txt
浏览文件 @
1b81a00e
...
@@ -208,7 +208,7 @@ import theano and print the config variable, as in:
...
@@ -208,7 +208,7 @@ import theano and print the config variable, as in:
significant speed up on functions with many ops that are fast to
significant speed up on functions with many ops that are fast to
execute, but this increases Theano's memory usage.
execute, but this increases Theano's memory usage.
.. attribute:: scan.allow_output_prealloc
.. attribute::
config.
scan.allow_output_prealloc
Bool value, either ``True`` or ``False``
Bool value, either ``True`` or ``False``
...
@@ -219,6 +219,18 @@ import theano and print the config variable, as in:
...
@@ -219,6 +219,18 @@ import theano and print the config variable, as in:
give a significant speed up with Scan at the cost of slightly increased
give a significant speed up with Scan at the cost of slightly increased
memory usage.
memory usage.
.. attribute:: config.scan.allow_gc
Bool value, either ``True`` or ``False``
Default: ``False``
Allow/disallow gc inside of Scan.
If config.allow_gc is ``True``, but config.scan.allow_gc is
``False``, then we will gc the inner of scan after all
iterations. This is the default.
.. attribute:: openmp
.. attribute:: openmp
Bool value: either True or False
Bool value: either True or False
...
@@ -612,7 +624,7 @@ import theano and print the config variable, as in:
...
@@ -612,7 +624,7 @@ import theano and print the config variable, as in:
cost of precision. This also disables support for denormal
cost of precision. This also disables support for denormal
numbers.
numbers.
.. attribute:: optimizer_excluding
.. attribute::
config.
optimizer_excluding
Default: ""
Default: ""
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论