提交 aa6066ca authored 作者: abergeron's avatar abergeron

Merge pull request #2105 from carriepl/profilingOutput

Add new flag for theano profiling output cropping
...@@ -50,6 +50,11 @@ AddConfigVar('profiling.n_ops', ...@@ -50,6 +50,11 @@ AddConfigVar('profiling.n_ops',
IntParam(20, lambda i: i > 0), IntParam(20, lambda i: i > 0),
in_c_key=False) in_c_key=False)
AddConfigVar('profiling.output_line_width',
"Max line width for the profiling output",
IntParam(512, lambda i: i > 0),
in_c_key=False)
AddConfigVar('profiling.min_memory_size', AddConfigVar('profiling.min_memory_size',
"""For the memory profile, do not print Apply nodes if the size """For the memory profile, do not print Apply nodes if the size
of their outputs (in bytes) is lower than this threshold""", of their outputs (in bytes) is lower than this threshold""",
...@@ -175,7 +180,7 @@ class ProfileStats(object): ...@@ -175,7 +180,7 @@ class ProfileStats(object):
linker_time = 0.0 linker_time = 0.0
# time spent linking graph (FunctionMaker.create) # time spent linking graph (FunctionMaker.create)
line_width = 140 line_width = config.profiling.output_line_width
optimizer_profile = None optimizer_profile = None
# None or tuple (the optimizer, the profile it returned) # None or tuple (the optimizer, the profile it returned)
...@@ -360,7 +365,7 @@ class ProfileStats(object): ...@@ -360,7 +365,7 @@ class ProfileStats(object):
es += [' %4d '] es += [' %4d ']
upto_length = numpy.sum([len(x) for x in hs]) + len(hs) upto_length = numpy.sum([len(x) for x in hs]) + len(hs)
maxlen = self.line_width - upto_length maxlen = max(self.line_width - upto_length, 0)
hs += ['<Class name>'] hs += ['<Class name>']
es += ['%s'] es += ['%s']
header_str = ' '.join(hs) header_str = ' '.join(hs)
...@@ -443,7 +448,7 @@ class ProfileStats(object): ...@@ -443,7 +448,7 @@ class ProfileStats(object):
es += [' %4d '] es += [' %4d ']
upto_length = numpy.sum([len(x) for x in hs]) + len(hs) upto_length = numpy.sum([len(x) for x in hs]) + len(hs)
maxlen = self.line_width - upto_length maxlen = max(self.line_width - upto_length, 0)
hs += ['<Op name>'] hs += ['<Op name>']
es += ['%s'] es += ['%s']
header_str = ' '.join(hs) header_str = ' '.join(hs)
...@@ -510,7 +515,7 @@ class ProfileStats(object): ...@@ -510,7 +515,7 @@ class ProfileStats(object):
hs += ['<Mflops>', '<Gflops/s>'] hs += ['<Mflops>', '<Gflops/s>']
upto_length = numpy.sum([len(x) for x in hs]) + len(hs) upto_length = numpy.sum([len(x) for x in hs]) + len(hs)
maxlen = self.line_width - upto_length maxlen = max(self.line_width - upto_length, 0)
hs += ['<Apply name>'] hs += ['<Apply name>']
es += ['%s'] es += ['%s']
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论