{"action":"created","issue":{"url":"https://api.github.com/repos/Theano/Theano/issues/3409","repository_url":"https://api.github.com/repos/Theano/Theano","labels_url":"https://api.github.com/repos/Theano/Theano/issues/3409/labels{/name}","comments_url":"https://api.github.com/repos/Theano/Theano/issues/3409/comments","events_url":"https://api.github.com/repos/Theano/Theano/issues/3409/events","html_url":"https://github.com/Theano/Theano/issues/3409","id":107151982,"number":3409,"title":"No execution time accumulated","user":{"login":"LucasAdams","id":14271183,"avatar_url":"https://avatars.githubusercontent.com/u/14271183?v=3","gravatar_id":"","url":"https://api.github.com/users/LucasAdams","html_url":"https://github.com/LucasAdams","followers_url":"https://api.github.com/users/LucasAdams/followers","following_url":"https://api.github.com/users/LucasAdams/following{/other_user}","gists_url":"https://api.github.com/users/LucasAdams/gists{/gist_id}","starred_url":"https://api.github.com/users/LucasAdams/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LucasAdams/subscriptions","organizations_url":"https://api.github.com/users/LucasAdams/orgs","repos_url":"https://api.github.com/users/LucasAdams/repos","events_url":"https://api.github.com/users/LucasAdams/events{/privacy}","received_events_url":"https://api.github.com/users/LucasAdams/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2015-09-18T07:56:58Z","updated_at":"2017-02-15T16:04:00Z","closed_at":"2017-02-15T16:04:00Z","body":"Default linker / vm does not allow profiling information to be gathered.\n\nSetting `profile=True` in .theanorc is not sufficient and printing the profile information results in the message \"No execution time accumulated (hint: try config profiling.time_thunks=1)\". This is output by [ProfileStats.summary](https://github.com/Theano/Theano/blob/master/theano/compile/profiling.py#L1287). The hint of setting `[profiling]\\n time_thunks=1` doesn't fix the issue.\n\nDebugging:\nProfileStats.summary requires the apply_time dictionary, a mapping of nodes to floats of running time. This dictionary is only modified in [VM.update_profile](https://github.com/Theano/Theano/blob/master/theano/gof/vm.py#L228) which is executed only by  [Function.__call__](https://github.com/Theano/Theano/blob/master/theano/compile/function_module.py#L917) on the Function.fn variable after the function has finished executing. However Function.fn by default is an instance of [streamline_default_f](https://github.com/Theano/Theano/blob/master/theano/gof/link.py#L644) which doesn't have this function (Function.__call__ checks to ensure no error is generated).\n\nThe solution is to use the [newer](https://github.com/Theano/Theano/blob/master/theano/gof/vm.py#L5) vm rather than linker interface. This can be enabled by setting the `mode` [configuration option](https://github.com/Theano/Theano/blob/master/theano/compile/mode.py#L69) to `vm` or `vm_nogc`which enables the LoopGC or Loop VMs respectively. The C-based VMs may also be able to profile (`cvm` or `cvm_nogc`) but I haven't experimented, the comment indicates [no](https://github.com/Theano/Theano/blob/master/theano/gof/lazylinker_c.c#L23) but the code indicates maybe [1](https://github.com/Theano/Theano/blob/master/theano/gof/lazylinker_c.c#L496) [2](https://github.com/Theano/Theano/blob/master/theano/gof/lazylinker_c.c#L526).\n\nIn summary, for profiling:\n\n```\nlinker=vm\nprofile=True\n[profiling]\ntime_thunks=1\n```\n\nI am unsure how this should best be addressed. Either the default VM needs to be `vm` or the documentation should be updated. It is unclear to me why we have the apparently legacy linker system.\n\nAs an aside, to print profiling information without closing (i)python, use `f.profile.summary()`.\n"},"comment":{"url":"https://api.github.com/repos/Theano/Theano/issues/comments/280052722","html_url":"https://github.com/Theano/Theano/issues/3409#issuecomment-280052722","issue_url":"https://api.github.com/repos/Theano/Theano/issues/3409","id":280052722,"user":{"login":"nouiz","id":180987,"avatar_url":"https://avatars.githubusercontent.com/u/180987?v=3","gravatar_id":"","url":"https://api.github.com/users/nouiz","html_url":"https://github.com/nouiz","followers_url":"https://api.github.com/users/nouiz/followers","following_url":"https://api.github.com/users/nouiz/following{/other_user}","gists_url":"https://api.github.com/users/nouiz/gists{/gist_id}","starred_url":"https://api.github.com/users/nouiz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nouiz/subscriptions","organizations_url":"https://api.github.com/users/nouiz/orgs","repos_url":"https://api.github.com/users/nouiz/repos","events_url":"https://api.github.com/users/nouiz/events{/privacy}","received_events_url":"https://api.github.com/users/nouiz/received_events","type":"User","site_admin":false},"created_at":"2017-02-15T16:04:00Z","updated_at":"2017-02-15T16:04:00Z","body":"Closing. Now we have a new Theano flag that allow to print only global stats at the end of the process.\r\n\r\nAlso, now the defeault linker (cvm) allow profiing."}}
{"actor":{"display_login":"nouiz"}}