Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
b131e669
提交
b131e669
authored
10月 01, 2012
作者:
lamblin
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #977 from nouiz/flags
Flags
上级
147a7155
c8f20390
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
16 行增加
和
98 行删除
+16
-98
config.txt
doc/library/config.txt
+16
-43
opt.py
theano/gof/opt.py
+0
-55
没有找到文件。
doc/library/config.txt
浏览文件 @
b131e669
...
...
@@ -245,6 +245,22 @@ import theano and print the config variable, as in:
This sets the default compilation mode for theano functions. By default the
mode Mode is equivalent to FAST_RUN. See Config attribute linker and optimizer.
.. attribute:: profile
Bool value: either True or False
Default False
Do the vm/cvm linker profile the execution of Theano function?
.. attribute:: profile_optimizer
Bool value: either True or False
Default False
Do the vm/cvm linker profile the optimization phase when compiling a Theano function?
.. attribute:: config.lib.amdlibm
Bool value: either True or False
...
...
@@ -580,49 +596,6 @@ import theano and print the config variable, as in:
B. log_likelihood_v_given_h
C. log_likelihood_h
.. attribute:: config.time_seq_optimizer
Bool value, default: False
Should each SeqOptimizer object print the time taken by each of its
optimizer. Each SeqOptimizer prints something like this::
SeqOptimizer gpu_opt time 0.014s for 8/9 nodes before/after optimization
0.012573s - ('gpu_local_optimizations', 'EquilibriumOptimizer')
0.001373s - ('gpu_cut_transfers', 'EquilibriumOptimizer')
0.000441s - ('InputToGpuOptimizer', 'InputToGpuOptimizer')
This prints the name of the SeqOptimizer (gpu_opt), the number of
Apply nodes in the graph before (8) and after (9)
optimizations. Then a list of lines, one per optimization
in this SeqOptimizer. The first element is the time
taken by this optimization and then it is a tuple with the name of the
optimization and this class. This list is sorted from the sub
optimization that takes the most time to the optimization that takes
the least time.
.. attribute:: config.time_eq_optimizer
Bool value, default: False
Should each EquilibriumOptimizer print the time taken by each of its
iterations, the total number of times each of its optimizers is applied,
and informations about the total number of nodes in the graph.
Here is an example of output::
EquilibriumOptimizer specialize
time 4.760s for 4 passes, 3801 nodes max
0 - 1.961s (0.079s in global opts) - 3797 nodes
1 - 1.233s (0.080s in global opts) - 3801 nodes
2 - 0.857s (0.071s in global opts) - 3203 nodes
3 - 0.710s (0.066s in global opts) - 3095 nodes
times applied - optimizer:
384 - dimshuffle_as_view
262 - constant_folding
216 - local_subtensor_make_vector
216 - local_shape_to_shape_i
4 - local_mul_specialize
.. attribute:: config.cmodule.warn_no_version
...
...
theano/gof/opt.py
浏览文件 @
b131e669
...
...
@@ -26,15 +26,6 @@ from theano.configparser import AddConfigVar, BoolParam
_logger
=
logging
.
getLogger
(
'theano.gof.opt'
)
AddConfigVar
(
'time_seq_optimizer'
,
"Should SeqOptimizer print the time taked by each of its optimizer"
,
BoolParam
(
False
),
in_c_key
=
False
)
AddConfigVar
(
'time_eq_optimizer'
,
"Should EquilibriumOptimizer print the time taken by each optimizer"
,
BoolParam
(
False
),
in_c_key
=
False
)
import
destroyhandler
as
dh
import
traceback
...
...
@@ -180,29 +171,6 @@ class SeqOptimizer(Optimizer, list):
else
:
raise
if
config
.
time_seq_optimizer
:
print
"SeqOptimizer"
,
if
hasattr
(
self
,
"name"
):
print
self
.
name
,
elif
hasattr
(
self
,
"__name__"
):
print
self
.
__name__
,
print
" time
%.3
fs for
%
d/
%
d nodes before/after optimization"
%
(
sum
(
l
),
nb_node_before
,
len
(
fgraph
.
apply_nodes
))
print
" time
%.3
fs for validate "
%
(
fgraph
.
profile
.
validate_time
-
validate_before
)
ll
=
[]
for
opt
in
self
:
if
hasattr
(
opt
,
"__name__"
):
ll
.
append
((
opt
.
__name__
,
opt
.
__class__
.
__name__
))
else
:
ll
.
append
((
opt
.
name
,
opt
.
__class__
.
__name__
))
lll
=
zip
(
l
,
ll
)
def
cmp
(
a
,
b
):
if
a
[
0
]
==
b
[
0
]:
return
0
if
a
[
0
]
<
b
[
0
]:
return
-
1
return
1
lll
.
sort
(
cmp
)
for
(
t
,
opt
)
in
lll
[::
-
1
]:
print
'
%.6
fs -
%
s'
%
(
t
,
opt
)
print
if
fgraph
.
profile
:
validate_time
=
fgraph
.
profile
.
validate_time
-
validate_before
else
:
...
...
@@ -1517,29 +1485,6 @@ class EquilibriumOptimizer(NavigatorOptimizer):
+
"
%
f with the theano flag 'optdb.max_use_ratio'."
%
config
.
optdb
.
max_use_ratio
)
if
config
.
time_eq_optimizer
:
print
"EquilibriumOptimizer"
,
print
getattr
(
self
,
"name"
,
getattr
(
self
,
"__name__"
,
""
))
print
" time
%.3
fs for
%
d passes,
%
d nodes max"
%
(
sum
(
loop_timing
),
len
(
loop_timing
),
max_nb_nodes
)
for
i
in
range
(
len
(
loop_timing
)):
print
'
%
d -
%.3
fs (
%.3
fs in global opts) -
%
d nodes'
%
(
i
,
loop_timing
[
i
],
global_opt_timing
[
i
],
nb_nodes
[
i
])
print
count_opt
=
[]
for
opt
,
count
in
process_count
.
iteritems
():
if
count
>
0
:
count_opt
.
append
((
count
,
opt
))
if
count_opt
:
print
'times applied - optimizer:'
count_opt
.
sort
()
for
(
count
,
opt
)
in
count_opt
[::
-
1
]:
print
'
%
d -
%
s'
%
(
count
,
opt
)
print
return
(
self
,
loop_timing
,
process_count
,
max_nb_nodes
,
global_opt_timing
,
nb_nodes
,
time_lopts
,
io_toposort_timing
)
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论