Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
ccf4f75f
提交
ccf4f75f
authored
6月 14, 2012
作者:
Frederic
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Added config flag profile_optimizer that allow to profile the optimizer.
上级
4922359b
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
23 行增加
和
2 行删除
+23
-2
function_module.py
theano/compile/function_module.py
+4
-2
profiling.py
theano/compile/profiling.py
+16
-0
opt.py
theano/gof/opt.py
+0
-0
vm.py
theano/gof/vm.py
+3
-0
没有找到文件。
theano/compile/function_module.py
浏览文件 @
ccf4f75f
...
@@ -1049,13 +1049,15 @@ class FunctionMaker(object):
...
@@ -1049,13 +1049,15 @@ class FunctionMaker(object):
theano
.
config
.
compute_test_value
=
"off"
theano
.
config
.
compute_test_value
=
"off"
gof
.
Op
.
add_stack_trace_on_call
=
False
gof
.
Op
.
add_stack_trace_on_call
=
False
start_optimizer
=
time
.
time
()
start_optimizer
=
time
.
time
()
optimizer
(
env
)
optimizer
_profile
=
optimizer
(
env
)
end_optimizer
=
time
.
time
()
end_optimizer
=
time
.
time
()
opt_time
=
end_optimizer
-
start_optimizer
opt_time
=
end_optimizer
-
start_optimizer
mode
.
optimizer_time
+=
opt_time
mode
.
optimizer_time
+=
opt_time
if
profile
:
if
profile
:
profile
.
optimizer_time
+=
opt_time
profile
.
optimizer_time
+=
opt_time
if
theano
.
config
.
profile_optimizer
:
profile
.
optimizer_profile
=
(
optimizer
,
optimizer_profile
)
_logger
.
debug
(
'Optimizing took
%
f seconds'
,
opt_time
)
_logger
.
debug
(
'Optimizing took
%
f seconds'
,
opt_time
)
#Add deep copy to respect the memory interface
#Add deep copy to respect the memory interface
...
...
theano/compile/profiling.py
浏览文件 @
ccf4f75f
...
@@ -64,6 +64,15 @@ def _atexit_print_fn():
...
@@ -64,6 +64,15 @@ def _atexit_print_fn():
for
key
,
val
in
getattr
(
ps
,
attr
)
.
iteritems
():
for
key
,
val
in
getattr
(
ps
,
attr
)
.
iteritems
():
assert
key
not
in
cum_attr
assert
key
not
in
cum_attr
cum_attr
[
key
]
=
val
cum_attr
[
key
]
=
val
if
cum
.
optimizer_profile
and
ps
.
optimizer_profile
:
merge
=
cum
.
optimizer_profile
[
0
]
.
merge_profile
(
cum
.
optimizer_profile
[
1
],
ps
.
optimizer_profile
[
1
])
cum
.
optimizer_profile
=
(
cum
.
optimizer_profile
[
0
],
merge
)
else
:
cum
.
optimizer_profile
=
None
cum
.
summary
(
file
=
_atexit_print_file
)
cum
.
summary
(
file
=
_atexit_print_file
)
...
@@ -133,6 +142,9 @@ class ProfileStats(object):
...
@@ -133,6 +142,9 @@ class ProfileStats(object):
line_width
=
140
line_width
=
140
optimizer_profile
=
None
# None or tuple (the optimizer, the profile it returned)
# param is called flag_time_thunks because most other attributes with time
# param is called flag_time_thunks because most other attributes with time
# in the name are times *of* something, rather than configuration flags.
# in the name are times *of* something, rather than configuration flags.
def
__init__
(
self
,
atexit_print
=
True
,
flag_time_thunks
=
None
,
**
kwargs
):
def
__init__
(
self
,
atexit_print
=
True
,
flag_time_thunks
=
None
,
**
kwargs
):
...
@@ -419,6 +431,10 @@ class ProfileStats(object):
...
@@ -419,6 +431,10 @@ class ProfileStats(object):
elif
self
.
fct_callcount
>
0
:
elif
self
.
fct_callcount
>
0
:
print
>>
file
,
(
" No node time accumulated "
print
>>
file
,
(
" No node time accumulated "
"(hint: try config profiling.time_thunks=1)"
)
"(hint: try config profiling.time_thunks=1)"
)
if
self
.
optimizer_profile
:
print
"Optimizer Profile"
print
"-----------------"
self
.
optimizer_profile
[
0
]
.
print_profile
(
file
,
self
.
optimizer_profile
[
1
])
if
0
:
# old code still to be ported from ProfileMode
if
0
:
# old code still to be ported from ProfileMode
...
...
theano/gof/opt.py
浏览文件 @
ccf4f75f
差异被折叠。
点击展开。
theano/gof/vm.py
浏览文件 @
ccf4f75f
...
@@ -17,6 +17,9 @@ logger = logging.getLogger(__name__)
...
@@ -17,6 +17,9 @@ logger = logging.getLogger(__name__)
AddConfigVar
(
'profile'
,
AddConfigVar
(
'profile'
,
"If VM should collect profile information"
,
"If VM should collect profile information"
,
BoolParam
(
False
))
BoolParam
(
False
))
AddConfigVar
(
'profile_optimizer'
,
"If VM should collect optimizer profile information"
,
BoolParam
(
False
))
raise_with_op
=
link
.
raise_with_op
raise_with_op
=
link
.
raise_with_op
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论