Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
1390cc39
Unverified
提交
1390cc39
authored
10月 25, 2022
作者:
Anirudh
提交者:
GitHub
10月 25, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Use time.perf_counter for aesara.function timing results
上级
471657a5
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
11 行增加
和
11 行删除
+11
-11
types.py
aesara/compile/function/types.py
+11
-11
没有找到文件。
aesara/compile/function/types.py
浏览文件 @
1390cc39
...
@@ -824,7 +824,7 @@ class Function:
...
@@ -824,7 +824,7 @@ class Function:
self
[
i
]
=
value
self
[
i
]
=
value
profile
=
self
.
profile
profile
=
self
.
profile
t0
=
time
.
time
()
t0
=
time
.
perf_counter
()
output_subset
=
kwargs
.
pop
(
"output_subset"
,
None
)
output_subset
=
kwargs
.
pop
(
"output_subset"
,
None
)
if
output_subset
is
not
None
and
self
.
output_keys
is
not
None
:
if
output_subset
is
not
None
and
self
.
output_keys
is
not
None
:
...
@@ -965,7 +965,7 @@ class Function:
...
@@ -965,7 +965,7 @@ class Function:
)
)
# Do the actual work
# Do the actual work
t0_fn
=
time
.
time
()
t0_fn
=
time
.
perf_counter
()
try
:
try
:
outputs
=
(
outputs
=
(
self
.
vm
()
self
.
vm
()
...
@@ -991,7 +991,7 @@ class Function:
...
@@ -991,7 +991,7 @@ class Function:
# old-style linkers raise their own exceptions
# old-style linkers raise their own exceptions
raise
raise
dt_fn
=
time
.
time
()
-
t0_fn
dt_fn
=
time
.
perf_counter
()
-
t0_fn
self
.
maker
.
mode
.
fn_time
+=
dt_fn
self
.
maker
.
mode
.
fn_time
+=
dt_fn
if
profile
:
if
profile
:
profile
.
vm_call_time
+=
dt_fn
profile
.
vm_call_time
+=
dt_fn
...
@@ -1039,7 +1039,7 @@ class Function:
...
@@ -1039,7 +1039,7 @@ class Function:
# grep for 'PROFILE_CODE'
# grep for 'PROFILE_CODE'
#
#
dt_call
=
time
.
time
()
-
t0
dt_call
=
time
.
perf_counter
()
-
t0
aesara
.
compile
.
profiling
.
total_fct_exec_time
+=
dt_call
aesara
.
compile
.
profiling
.
total_fct_exec_time
+=
dt_call
self
.
maker
.
mode
.
call_time
+=
dt_call
self
.
maker
.
mode
.
call_time
+=
dt_call
if
profile
:
if
profile
:
...
@@ -1395,7 +1395,7 @@ class FunctionMaker:
...
@@ -1395,7 +1395,7 @@ class FunctionMaker:
):
):
try
:
try
:
start_rewriter
=
time
.
time
()
start_rewriter
=
time
.
perf_counter
()
rewriter_profile
=
None
rewriter_profile
=
None
rewrite_time
=
None
rewrite_time
=
None
...
@@ -1406,7 +1406,7 @@ class FunctionMaker:
...
@@ -1406,7 +1406,7 @@ class FunctionMaker:
):
):
rewriter_profile
=
rewriter
(
fgraph
)
rewriter_profile
=
rewriter
(
fgraph
)
end_rewriter
=
time
.
time
()
end_rewriter
=
time
.
perf_counter
()
rewrite_time
=
end_rewriter
-
start_rewriter
rewrite_time
=
end_rewriter
-
start_rewriter
_logger
.
debug
(
f
"Rewriting took {rewrite_time:f} seconds"
)
_logger
.
debug
(
f
"Rewriting took {rewrite_time:f} seconds"
)
...
@@ -1416,7 +1416,7 @@ class FunctionMaker:
...
@@ -1416,7 +1416,7 @@ class FunctionMaker:
# If the rewriter got interrupted
# If the rewriter got interrupted
if
rewrite_time
is
None
:
if
rewrite_time
is
None
:
end_rewriter
=
time
.
time
()
end_rewriter
=
time
.
perf_counter
()
rewrite_time
=
end_rewriter
-
start_rewriter
rewrite_time
=
end_rewriter
-
start_rewriter
aesara
.
compile
.
profiling
.
total_graph_rewrite_time
+=
rewrite_time
aesara
.
compile
.
profiling
.
total_graph_rewrite_time
+=
rewrite_time
...
@@ -1645,7 +1645,7 @@ class FunctionMaker:
...
@@ -1645,7 +1645,7 @@ class FunctionMaker:
defaults
.
append
((
required
,
refeed
,
storage
))
defaults
.
append
((
required
,
refeed
,
storage
))
# Get a function instance
# Get a function instance
start_linker
=
time
.
time
()
start_linker
=
time
.
perf_counter
()
start_import_time
=
aesara
.
link
.
c
.
cmodule
.
import_time
start_import_time
=
aesara
.
link
.
c
.
cmodule
.
import_time
with
config
.
change_flags
(
traceback__limit
=
config
.
traceback__compile_limit
):
with
config
.
change_flags
(
traceback__limit
=
config
.
traceback__compile_limit
):
...
@@ -1653,7 +1653,7 @@ class FunctionMaker:
...
@@ -1653,7 +1653,7 @@ class FunctionMaker:
input_storage
=
input_storage_lists
,
storage_map
=
storage_map
input_storage
=
input_storage_lists
,
storage_map
=
storage_map
)
)
end_linker
=
time
.
time
()
end_linker
=
time
.
perf_counter
()
linker_time
=
end_linker
-
start_linker
linker_time
=
end_linker
-
start_linker
aesara
.
compile
.
profiling
.
total_time_linker
+=
linker_time
aesara
.
compile
.
profiling
.
total_time_linker
+=
linker_time
...
@@ -1725,7 +1725,7 @@ def orig_function(
...
@@ -1725,7 +1725,7 @@ def orig_function(
"""
"""
t1
=
time
.
time
()
t1
=
time
.
perf_counter
()
mode
=
aesara
.
compile
.
mode
.
get_mode
(
mode
)
mode
=
aesara
.
compile
.
mode
.
get_mode
(
mode
)
inputs
=
list
(
map
(
convert_function_input
,
inputs
))
inputs
=
list
(
map
(
convert_function_input
,
inputs
))
...
@@ -1758,7 +1758,7 @@ def orig_function(
...
@@ -1758,7 +1758,7 @@ def orig_function(
with
config
.
change_flags
(
compute_test_value
=
"off"
):
with
config
.
change_flags
(
compute_test_value
=
"off"
):
fn
=
m
.
create
(
defaults
)
fn
=
m
.
create
(
defaults
)
finally
:
finally
:
t2
=
time
.
time
()
t2
=
time
.
perf_counter
()
if
fn
and
profile
:
if
fn
and
profile
:
profile
.
compile_time
+=
t2
-
t1
profile
.
compile_time
+=
t2
-
t1
# TODO: append
# TODO: append
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论