Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
0e610d8a
提交
0e610d8a
authored
10月 31, 2016
作者:
abergeron
提交者:
GitHub
10月 31, 2016
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #5133 from nouiz/time_linker
Add profiling of which node make_thunk take times.
上级
856b98d3
bde22e6c
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
17 行增加
和
4 行删除
+17
-4
profiling.py
theano/compile/profiling.py
+10
-1
vm.py
theano/gof/vm.py
+7
-3
没有找到文件。
theano/compile/profiling.py
浏览文件 @
0e610d8a
...
@@ -19,6 +19,7 @@ __docformat__ = "restructuredtext en"
...
@@ -19,6 +19,7 @@ __docformat__ = "restructuredtext en"
import
atexit
import
atexit
import
copy
import
copy
import
operator
import
os
import
os
import
sys
import
sys
import
time
import
time
...
@@ -78,7 +79,8 @@ def _atexit_print_fn():
...
@@ -78,7 +79,8 @@ def _atexit_print_fn():
# merge dictonary
# merge dictonary
for
attr
in
[
"apply_time"
,
"apply_callcount"
,
for
attr
in
[
"apply_time"
,
"apply_callcount"
,
"apply_cimpl"
,
"variable_shape"
,
"variable_strides"
]:
"apply_cimpl"
,
"variable_shape"
,
"variable_strides"
,
"linker_make_thunk_time"
]:
cum_attr
=
getattr
(
cum
,
attr
)
cum_attr
=
getattr
(
cum
,
attr
)
for
key
,
val
in
iteritems
(
getattr
(
ps
,
attr
)):
for
key
,
val
in
iteritems
(
getattr
(
ps
,
attr
)):
assert
key
not
in
cum_attr
assert
key
not
in
cum_attr
...
@@ -193,6 +195,8 @@ class ProfileStats(object):
...
@@ -193,6 +195,8 @@ class ProfileStats(object):
linker_node_make_thunks
=
0.0
linker_node_make_thunks
=
0.0
linker_make_thunk_time
=
{}
line_width
=
config
.
profiling
.
output_line_width
line_width
=
config
.
profiling
.
output_line_width
nb_nodes
=
-
1
nb_nodes
=
-
1
...
@@ -670,6 +674,11 @@ class ProfileStats(object):
...
@@ -670,6 +674,11 @@ class ProfileStats(object):
print
(
' Import time
%
es'
%
self
.
import_time
,
file
=
file
)
print
(
' Import time
%
es'
%
self
.
import_time
,
file
=
file
)
print
(
' Node make_thunk time
%
es'
%
self
.
linker_node_make_thunks
,
print
(
' Node make_thunk time
%
es'
%
self
.
linker_node_make_thunks
,
file
=
file
)
file
=
file
)
for
node
,
t
in
sorted
(
self
.
linker_make_thunk_time
.
items
(),
key
=
operator
.
itemgetter
(
1
))[::
-
1
][:
5
]:
print
(
' Node
%
s time
%
es'
%
(
node
,
t
),
file
=
file
)
print
(
''
,
file
=
file
)
print
(
''
,
file
=
file
)
# The validation time is a subset of optimizer_time
# The validation time is a subset of optimizer_time
...
...
theano/gof/vm.py
浏览文件 @
0e610d8a
...
@@ -1041,16 +1041,19 @@ class VM_Linker(link.LocalLinker):
...
@@ -1041,16 +1041,19 @@ class VM_Linker(link.LocalLinker):
reallocated_info
=
calculate_reallocate_info
(
reallocated_info
=
calculate_reallocate_info
(
order
,
fgraph
,
storage_map
,
compute_map_re
,
dependencies
)
order
,
fgraph
,
storage_map
,
compute_map_re
,
dependencies
)
t0
=
time
.
time
()
t0
=
time
.
time
()
linker_make_thunk_time
=
{}
impl
=
None
if
self
.
c_thunks
is
False
:
impl
=
'py'
for
node
in
order
:
for
node
in
order
:
try
:
try
:
impl
=
None
thunk_start
=
time
.
time
()
if
self
.
c_thunks
is
False
:
impl
=
'py'
thunks
.
append
(
node
.
op
.
make_thunk
(
node
,
thunks
.
append
(
node
.
op
.
make_thunk
(
node
,
storage_map
,
storage_map
,
compute_map
,
compute_map
,
no_recycling
,
no_recycling
,
impl
=
impl
))
impl
=
impl
))
linker_make_thunk_time
[
node
]
=
time
.
time
()
-
thunk_start
if
not
hasattr
(
thunks
[
-
1
],
'lazy'
):
if
not
hasattr
(
thunks
[
-
1
],
'lazy'
):
# We don't want all ops maker to think about lazy Ops.
# We don't want all ops maker to think about lazy Ops.
# So if they didn't specify that its lazy or not, it isn't.
# So if they didn't specify that its lazy or not, it isn't.
...
@@ -1064,6 +1067,7 @@ class VM_Linker(link.LocalLinker):
...
@@ -1064,6 +1067,7 @@ class VM_Linker(link.LocalLinker):
if
self
.
profile
:
if
self
.
profile
:
self
.
profile
.
linker_node_make_thunks
+=
t1
-
t0
self
.
profile
.
linker_node_make_thunks
+=
t1
-
t0
self
.
profile
.
linker_make_thunk_time
=
linker_make_thunk_time
for
node
,
thunk
in
zip
(
order
,
thunks
):
for
node
,
thunk
in
zip
(
order
,
thunks
):
thunk
.
inputs
=
[
storage_map
[
v
]
for
v
in
node
.
inputs
]
thunk
.
inputs
=
[
storage_map
[
v
]
for
v
in
node
.
inputs
]
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论