提交 9f2be8f3 authored 作者: abergeron's avatar abergeron

Merge pull request #4273 from nouiz/profile

Add flag: profiling.ignore_first_call and Update How To release.
...@@ -21,7 +21,11 @@ learning/machine learning <http://www.mila.umontreal.ca/Home/courses>`_ classes) ...@@ -21,7 +21,11 @@ learning/machine learning <http://www.mila.umontreal.ca/Home/courses>`_ classes)
News News
==== ====
* We added support for :ref:`CuDNN v3 <libdoc_cuda_dnn>`. * Theano 0.8 was released 21th March 2016. Everybody is encouraged to update.
* Multi-GPU.
* We added support for :ref:`CuDNN v4 <libdoc_cuda_dnn>`.
* We added support for :attr:`CNMeM <config.lib.cnmem>` to speed up * We added support for :attr:`CNMeM <config.lib.cnmem>` to speed up
the GPU memory allocation. the GPU memory allocation.
......
...@@ -14,6 +14,8 @@ and all commit log messages. Update the index.txt *News* section. ...@@ -14,6 +14,8 @@ and all commit log messages. Update the index.txt *News* section.
Update the "Vision"/"Vision State" in the file Update the "Vision"/"Vision State" in the file
``Theano/doc/introduction.txt``. ``Theano/doc/introduction.txt``.
Update the file ``.mailmap`` to clean up the list of contributor.
Get a fresh copy of the repository Get a fresh copy of the repository
================================== ==================================
...@@ -112,60 +114,6 @@ Finally ...@@ -112,60 +114,6 @@ Finally
Change ``ISRELEASED`` back to ``False``. Change ``ISRELEASED`` back to ``False``.
Generate and upload the Windows installer
=========================================
We are now able to build and distribute an MSI installer for Windows,
assuming that Anaconda is the installed Python distribution. This
installer is generated by `WiX`_ from an XML file, stored in the
`Theano-wininstaller <https://github.com/Theano/Theano-wininstaller>`__
Git repository.
* Install `WiX`_ if it is not already installed.
* On a Windows machine, checkout the ``Theano-wininstaller`` repository::
git checkout https://github.com/Theano/Theano-wininstaller.git
* In ``Theano-wininstaller\src``, create a *new*
``theano_installer_<version>.wxs`` from the previous one. We want to
keep a history of these files, as they contain globally unique IDs.
* Change the strings and GUIDs appropriately, see `the WiX tutorial
<http://wix.tramontana.co.hu/tutorial/upgrades-and-modularization>`__
for a reference.
* Compile the ``.wxs`` file following the instructions in it, it will be something like::
candle.exe theano_installer_<version>.wxs
light.exe -ext WixUIExtension theano_installer_<version>.wixobj
This will generate a ``theano_installer_<version>.msi`` file in ``src``.
* Test it by trying to install and uninstall it. It can be done by
double-clicking on it, then uninstalling it from the Windows control
panel, or (more easily) from the command line, which also allows to
save the logs (use the ``*v`` modifier to increase verbosity)::
msiexec /i <file>.msi [/l[*v] install.log]
msiexec /x <file>.msi [/l[*v] uninstall.log]
* When the test works, copy ``theano_installer_<version>.msi``
into ``Theano-wininstaller\bin``, overwrite
``bin\theano_installer_latest.msi`` with another copy, then add the new
files into the Git repository, and push to master::
copy src\theano_installer_<version>.msi bin\
copy /y src\theano_installer_<version>.msi bin\theano_installer_latest.msi
git add src\theano_installer_<version>.wxs
git add bin\theano_installer_<version>.msi
git add bin\theano_installer_latest.msi
git commit
git push
.. _WiX: http://wixtoolset.org/
Announce the release Announce the release
==================== ====================
......
...@@ -388,6 +388,14 @@ import theano and print the config variable, as in: ...@@ -388,6 +388,14 @@ import theano and print the config variable, as in:
Do a debugprint of the profiled functions Do a debugprint of the profiled functions
.. attribute:: config.profiling.ignore_first_call
Bool value: either True or False
Default False
Do we ignore the first call to a Theano function while profiling.
.. attribute:: config.lib.amdlibm .. attribute:: config.lib.amdlibm
Bool value: either True or False Bool value: either True or False
......
...@@ -928,7 +928,9 @@ class Function(object): ...@@ -928,7 +928,9 @@ class Function(object):
profile.fct_call_time += dt_call profile.fct_call_time += dt_call
if hasattr(self.fn, 'update_profile'): if hasattr(self.fn, 'update_profile'):
self.fn.update_profile(profile) self.fn.update_profile(profile)
if profile.ignore_first_call:
profile.reset()
profile.ignore_first_call = False
if self.return_none: if self.return_none:
return None return None
elif self.unpack_single and len(outputs) == 1: elif self.unpack_single and len(outputs) == 1:
......
...@@ -110,7 +110,16 @@ class ProfileStats(object): ...@@ -110,7 +110,16 @@ class ProfileStats(object):
in this class. in this class.
""" """
def reset(self):
""" Ignore previous function call"""
#self.compile_time = 0.
self.fct_call_time = 0.
self.fct_callcount = 0
self.vm_call_time = 0.
self.apply_time = {}
self.apply_callcount = {}
# self.apply_cimpl = None
#self.messge = None
# #
# Note on implementation: # Note on implementation:
# Class variables are used here so that each one can be # Class variables are used here so that each one can be
...@@ -216,6 +225,7 @@ class ProfileStats(object): ...@@ -216,6 +225,7 @@ class ProfileStats(object):
if not _atexit_registered: if not _atexit_registered:
atexit.register(_atexit_print_fn) atexit.register(_atexit_print_fn)
_atexit_registered = True _atexit_registered = True
self.ignore_first_call = theano.config.profiling.ignore_first_call
def class_time(self): def class_time(self):
""" """
......
...@@ -1043,6 +1043,13 @@ AddConfigVar('profiling.debugprint', ...@@ -1043,6 +1043,13 @@ AddConfigVar('profiling.debugprint',
BoolParam(False), BoolParam(False),
in_c_key=False) in_c_key=False)
AddConfigVar('profiling.ignore_first_call',
"""
Do we ignore the first call of a Theano function.
""",
BoolParam(False),
in_c_key=False)
AddConfigVar('optdb.position_cutoff', AddConfigVar('optdb.position_cutoff',
'Where to stop eariler during optimization. It represent the' 'Where to stop eariler during optimization. It represent the'
' position of the optimizer where to stop.', ' position of the optimizer where to stop.',
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论