提交 5a140913 authored 作者: Frederic Bastien's avatar Frederic Bastien

Print warning if we use the new back-end and profiling but don't use profiling.ignore_first_call

上级 5a7ae750
...@@ -9,6 +9,8 @@ ProfileStats object for runtime and memory profiling. ...@@ -9,6 +9,8 @@ ProfileStats object for runtime and memory profiling.
# #
from __future__ import absolute_import, print_function, division from __future__ import absolute_import, print_function, division
import logging
__authors__ = "James Bergstra" __authors__ = "James Bergstra"
__reviewer__ = "Razvan Pascanu" __reviewer__ = "Razvan Pascanu"
__copyright__ = "(c) 2011, Universite de Montreal" __copyright__ = "(c) 2011, Universite de Montreal"
...@@ -30,6 +32,8 @@ import theano ...@@ -30,6 +32,8 @@ import theano
from six import iteritems from six import iteritems
from theano.gof import graph from theano.gof import graph
logger = logging.getLogger('theano.compile.profiling')
theano_imported_time = time.time() theano_imported_time = time.time()
config = theano.config config = theano.config
...@@ -220,6 +224,14 @@ class ProfileStats(object): ...@@ -220,6 +224,14 @@ class ProfileStats(object):
" You must set the environment variable" " You must set the environment variable"
" CUDA_LAUNCH_BLOCKING to 1 to tell the CUDA driver to" " CUDA_LAUNCH_BLOCKING to 1 to tell the CUDA driver to"
" synchronize the execution to get a meaningful profile.") " synchronize the execution to get a meaningful profile.")
if (config.profile and
hasattr(theano, 'gpuarray') and
theano.gpuarray.pygpu_activated and
not config.profiling.ignore_first_call):
logger.warn(
"Theano flag profiling.ignore_first_call is False."
" This cause bad profiling result in the new gpu"
" back-end, we as sometimes we compile at the first call.")
self.apply_callcount = {} self.apply_callcount = {}
self.output_size = {} self.output_size = {}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论