提交 2d5a2297 authored 作者: Olivier Delalleau's avatar Olivier Delalleau 提交者: Frederic

Documentation improvement

上级 20e9af3b
...@@ -135,12 +135,16 @@ Running the GPU at Full Speed ...@@ -135,12 +135,16 @@ Running the GPU at Full Speed
------------------------------ ------------------------------
.. TODO: the discussion of this section is unintelligible to a beginner .. TODO: the discussion of this section is unintelligible to a beginner
.. TODO: is it better now?
To really get maximum performance in this simple example, we need to use an :class:`Out` To really get maximum performance in this simple example, we need to use an :class:`Out`
instance to tell Theano not to copy the output it returns to us. Theano allocates memory for instance to tell Theano not to copy the output it returns to us.
internal use like a working buffer, but by default it will never return a result that is This is because Theano pre-allocates memory for internal use (like working buffers), and by default
allocated in the working buffer. This is normally what you want, but our example is so simple will never return a result that is aliased to one of its internal buffers: instead, it will
copy the buffers associated to outputs into newly allocated memory at each function call.
This is to ensure that subsequent function calls will not overwrite previously computed outputs.
Although this is normally what you want, our example is so simple
that it has the unwanted side-effect of really slowing things down. that it has the unwanted side-effect of really slowing things down.
...@@ -149,6 +153,8 @@ that it has the unwanted side-effect of really slowing things down. ...@@ -149,6 +153,8 @@ that it has the unwanted side-effect of really slowing things down.
The story here about copying and working buffers is misleading and potentially not correct The story here about copying and working buffers is misleading and potentially not correct
... why exactly does borrow=True cut 75% of the runtime ??? ... why exactly does borrow=True cut 75% of the runtime ???
.. TODO: Answer by Olivier D: it sounds correct to me -- memory allocations must be slow.
.. If you modify this code, also change : .. If you modify this code, also change :
.. theano/tests/test_tutorial.py:T_using_gpu.test_using_gpu_3 .. theano/tests/test_tutorial.py:T_using_gpu.test_using_gpu_3
.. code-block:: python .. code-block:: python
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论