提交 17fa9f7a authored 作者: abergeron's avatar abergeron

Merge pull request #3703 from mohammadpz/update_profiling_doc

Doc for the new type of profiling added.
...@@ -11,30 +11,39 @@ Profiling Theano function ...@@ -11,30 +11,39 @@ Profiling Theano function
anymore. anymore.
Besides checking for errors, another important task is to profile your Besides checking for errors, another important task is to profile your
code. For this, you can use Theano flags and/or parameters which are code in terms of speed and/or memory usage.
to be passed as an argument to :func:`theano.function <function.function>`.
You can profile your
functions using either of the following two options:
1. Use Theano flag :attr:`config.profile` to enable profiling.
- To enable the memory profiler use the Theano flag:
:attr:`config.profile_memory` in addition to :attr:`config.profile`.
- Moreover, to enable the profiling of Theano optimization phase,
use the Theano flag: :attr:`config.profile_optimizer` in addition
to :attr:`config.profile`.
- You can also use the Theano flags :attr:`profiling.n_apply`,
:attr:`profiling.n_ops` and :attr:`profiling.min_memory_size`
to modify the quantify of information printed.
2. Pass the argument :attr:`profile=True` to the function
:func:`theano.function <function.function>`. And then call
:attr:`f.profile.print_summary()` for a single function.
- Use this option when you want to profile not all the
functions but one or more specific function(s).
- You can also combine the profile of many functions:
.. testcode::
profile = theano.compile.ProfileStats()
f = theano.function(..., profile=profile)
g = theano.function(..., profile=profile)
...
profile.print_summary()
The simplest way to profile Theano functions is to use the Theano
flags described below. When the process exits, they will cause the
information to be printed on stdout.
Using the ProfileMode is a three-step process.
Enabling the profiler is pretty easy. Just use the Theano flag
:attr:`config.profile`.
To enable the memory profiler use the Theano flag:
:attr:`config.profile_memory` in addition to :attr:`config.profile`.
To enable the profiling of Theano optimization phase, use the Theano
flag: :attr:`config.profile_optimizer` in addition to
:attr:`config.profile`.
You can use the Theano flags :attr:`profiling.n_apply`,
:attr:`profiling.n_ops` and :attr:`profiling.min_memory_size` to
modify the quantify of information printed.
The profiler will output one profile per Theano function and profile The profiler will output one profile per Theano function and profile
that is the sum of the printed profile. Each profile contains 4 that is the sum of the printed profile. Each profile contains 4
sections: global info, class info, Ops info and Apply node info. sections: global info, class info, Ops info and Apply node info.
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论