提交 e3133b80 authored 作者: Frederic Bastien's avatar Frederic Bastien

Clip cnmem at 95% and update doc

上级 bb6b88b8
...@@ -403,17 +403,18 @@ import theano and print the config variable, as in: ...@@ -403,17 +403,18 @@ import theano and print the config variable, as in:
Float value: >= 0 Float value: >= 0
Controls the use of `CNMeM <https://github.com/NVIDIA/cnmem>`_ (a Controls the use of `CNMeM <https://github.com/NVIDIA/cnmem>`_ (a
faster CUDA memory allocator). In Theano dev version until 0.7.1 faster CUDA memory allocator). In Theano dev version until 0.8
is released. is released.
The CNMeM library is included in Theano and does not need to be separately installed. The CNMeM library is included in Theano and does not need to be
separately installed.
The value represents the start size (either in MB or the fraction of total GPU The value represents the start size (either in MB or the fraction of total GPU
memory) of the memory pool. If more memory is needed, Theano will memory) of the memory pool. If more memory is needed, Theano will
try to obtain more, but this can cause memory fragmentation. try to obtain more, but this can cause memory fragmentation.
* 0: not enabled. * 0: not enabled.
* 0 < N <= 1: use this fraction of the total GPU memory (clipped to .985 for driver memory) * 0 < N <= 1: use this fraction of the total GPU memory (clipped to .95 for driver memory).
* > 1: use this number in megabytes (MB) of memory. * > 1: use this number in megabytes (MB) of memory.
...@@ -426,6 +427,13 @@ import theano and print the config variable, as in: ...@@ -426,6 +427,13 @@ import theano and print the config variable, as in:
the start or disable it. If you try this, report your result the start or disable it. If you try this, report your result
on :ref`theano-dev`. on :ref`theano-dev`.
.. note::
The clipping at 95% can be bypassed by specifing the exact
number of megabytes. If more then 95% are needed, it will try
automatically to get more memory. But this can cause
fragmentation, see note above.
.. attribute:: linker .. attribute:: linker
String value: 'c|py', 'py', 'c', 'c|py_nogc' String value: 'c|py', 'py', 'c', 'c|py_nogc'
......
...@@ -3246,7 +3246,7 @@ CudaNdarray_gpu_init(PyObject* _unused, PyObject* args) ...@@ -3246,7 +3246,7 @@ CudaNdarray_gpu_init(PyObject* _unused, PyObject* args)
else{ else{
// Clip to 95% to let memory for the driver. // Clip to 95% to let memory for the driver.
// 98% didn't worked in some cases. // 98% didn't worked in some cases.
if (cnmem > .99){ if (cnmem > .95){
cnmem = .95; cnmem = .95;
} }
size_t free = 0, total = 0; size_t free = 0, total = 0;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论