Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
e1e7f2e1
提交
e1e7f2e1
authored
4月 14, 2014
作者:
abergeron
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #1804 from nouiz/fix_scan_mem
[BUG Fix scan mem optimization
上级
2e2a1cb5
9da40b63
显示空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
16 行增加
和
15 行删除
+16
-15
.travis.yml
.travis.yml
+2
-1
mode.py
theano/compile/mode.py
+0
-3
optdb.py
theano/gof/optdb.py
+5
-0
scan_opt.py
theano/scan_module/scan_opt.py
+7
-10
opt.py
theano/tensor/opt.py
+2
-1
没有找到文件。
.travis.yml
浏览文件 @
e1e7f2e1
...
@@ -17,6 +17,7 @@ install:
...
@@ -17,6 +17,7 @@ install:
# So we test with 0.8. Our internal buildbot have 0.7.2.
# So we test with 0.8. Our internal buildbot have 0.7.2.
# We install it later only for the PART that need it.
# We install it later only for the PART that need it.
# - "pip install -q scipy==0.8 --use-mirrors"
# - "pip install -q scipy==0.8 --use-mirrors"
-
"
pip
install
nose-timelimit
--use-mirrors"
-
"
pip
install
.
--no-deps
--use-mirrors"
-
"
pip
install
.
--no-deps
--use-mirrors"
# command to run tests
# command to run tests
env
:
env
:
...
@@ -36,7 +37,7 @@ script:
...
@@ -36,7 +37,7 @@ script:
-
df -h
-
df -h
-
ulimit -a
-
ulimit -a
-
echo $PART
-
echo $PART
-
theano-nose -v $PART
-
theano-nose -
-with-timelimit -
v $PART
#after_script:
#after_script:
...
...
theano/compile/mode.py
浏览文件 @
e1e7f2e1
...
@@ -189,9 +189,6 @@ optdb.register('Print1.51', PrintCurrentFunctionGraph('Post-stabilize'),
...
@@ -189,9 +189,6 @@ optdb.register('Print1.51', PrintCurrentFunctionGraph('Post-stabilize'),
optdb
.
register
(
'specialize'
,
gof
.
EquilibriumDB
(),
optdb
.
register
(
'specialize'
,
gof
.
EquilibriumDB
(),
2
,
'fast_run'
)
2
,
'fast_run'
)
optdb
.
register
(
'Print2.01'
,
PrintCurrentFunctionGraph
(
'Post-specialize'
),
2.01
,)
# 'fast_run', 'fast_compile')
# misc special cases for speed that break canonicalization
# misc special cases for speed that break canonicalization
optdb
.
register
(
'uncanonicalize'
,
gof
.
EquilibriumDB
(),
optdb
.
register
(
'uncanonicalize'
,
gof
.
EquilibriumDB
(),
3
,
'fast_run'
)
3
,
'fast_run'
)
...
...
theano/gof/optdb.py
浏览文件 @
e1e7f2e1
...
@@ -248,6 +248,11 @@ class SequenceDB(DB):
...
@@ -248,6 +248,11 @@ class SequenceDB(DB):
position_cutoff
=
tags
[
0
]
.
position_cutoff
position_cutoff
=
tags
[
0
]
.
position_cutoff
opts
=
[
o
for
o
in
opts
if
self
.
__position__
[
o
.
name
]
<
position_cutoff
]
opts
=
[
o
for
o
in
opts
if
self
.
__position__
[
o
.
name
]
<
position_cutoff
]
# We want to sort by position and then if collision by name
# for deterministic optimization. Since Python 2.2, sort is
# stable, so sort by name first, then by position. This give
# the order we want.
opts
.
sort
(
key
=
lambda
obj
:
obj
.
name
)
opts
.
sort
(
key
=
lambda
obj
:
self
.
__position__
[
obj
.
name
])
opts
.
sort
(
key
=
lambda
obj
:
self
.
__position__
[
obj
.
name
])
ret
=
opt
.
SeqOptimizer
(
opts
,
failure_callback
=
self
.
failure_callback
)
ret
=
opt
.
SeqOptimizer
(
opts
,
failure_callback
=
self
.
failure_callback
)
if
hasattr
(
tags
[
0
],
'name'
):
if
hasattr
(
tags
[
0
],
'name'
):
...
...
theano/scan_module/scan_opt.py
浏览文件 @
e1e7f2e1
...
@@ -1681,7 +1681,6 @@ scan_eqopt1 = theano.gof.EquilibriumDB()
...
@@ -1681,7 +1681,6 @@ scan_eqopt1 = theano.gof.EquilibriumDB()
scan_seqopt1
=
theano
.
gof
.
SequenceDB
()
scan_seqopt1
=
theano
.
gof
.
SequenceDB
()
scan_eqopt2
=
theano
.
gof
.
EquilibriumDB
()
scan_eqopt2
=
theano
.
gof
.
EquilibriumDB
()
scan_seqopt2
=
theano
.
gof
.
EquilibriumDB
()
# We run before blas opt at 1.7 and specialize 2.0
# We run before blas opt at 1.7 and specialize 2.0
# but after stabilize at 1.5. Should we put it before stabilize?
# but after stabilize at 1.5. Should we put it before stabilize?
optdb
.
register
(
'scan_eqopt1'
,
scan_eqopt1
,
.
1
,
'fast_run'
,
'scan'
)
optdb
.
register
(
'scan_eqopt1'
,
scan_eqopt1
,
.
1
,
'fast_run'
,
'scan'
)
...
@@ -1694,8 +1693,6 @@ optdb.register('scanOp_make_inplace',
...
@@ -1694,8 +1693,6 @@ optdb.register('scanOp_make_inplace',
'inplace'
,
'inplace'
,
'scan'
)
'scan'
)
scan_eqopt2
.
register
(
'all_scan_opts'
,
scan_seqopt2
,
1
,
'fast_run'
,
'scan'
)
scan_eqopt1
.
register
(
scan_eqopt1
.
register
(
'all_pushout_opt'
,
scan_seqopt1
,
1
,
'fast_run'
,
'scan'
)
'all_pushout_opt'
,
scan_seqopt1
,
1
,
'fast_run'
,
'scan'
)
...
@@ -1731,7 +1728,7 @@ scan_seqopt1.register('scan_pushout_dot1',
...
@@ -1731,7 +1728,7 @@ scan_seqopt1.register('scan_pushout_dot1',
'scan'
)
'scan'
)
scan_
s
eqopt2
.
register
(
'constant_folding_for_scan2'
,
scan_eqopt2
.
register
(
'constant_folding_for_scan2'
,
opt
.
in2out
(
tensor
.
opt
.
constant_folding
,
opt
.
in2out
(
tensor
.
opt
.
constant_folding
,
ignore_newtrees
=
True
),
ignore_newtrees
=
True
),
1
,
1
,
...
@@ -1739,7 +1736,7 @@ scan_seqopt2.register('constant_folding_for_scan2',
...
@@ -1739,7 +1736,7 @@ scan_seqopt2.register('constant_folding_for_scan2',
'scan'
)
'scan'
)
scan_
s
eqopt2
.
register
(
'scanOp_remove_constants_and_unused_inputs1'
,
scan_eqopt2
.
register
(
'scanOp_remove_constants_and_unused_inputs1'
,
opt
.
in2out
(
remove_constants_and_unused_inputs_scan
,
opt
.
in2out
(
remove_constants_and_unused_inputs_scan
,
ignore_newtrees
=
True
),
ignore_newtrees
=
True
),
2
,
2
,
...
@@ -1751,14 +1748,14 @@ scan_seqopt2.register('scanOp_remove_constants_and_unused_inputs1',
...
@@ -1751,14 +1748,14 @@ scan_seqopt2.register('scanOp_remove_constants_and_unused_inputs1',
# after const merge but before stabilize so that we can have identity
# after const merge but before stabilize so that we can have identity
# for equivalent nodes but we still have the chance to hoist stuff out
# for equivalent nodes but we still have the chance to hoist stuff out
# of the scan later.
# of the scan later.
scan_
s
eqopt2
.
register
(
'scanOp_merge'
,
scan_eqopt2
.
register
(
'scanOp_merge'
,
ScanMerge
(),
ScanMerge
(),
4
,
4
,
'fast_run'
,
'fast_run'
,
'scan'
)
'scan'
)
# After Merge optimization
# After Merge optimization
scan_
s
eqopt2
.
register
(
'scanop_remove_constants_and_unused_inputs2'
,
scan_eqopt2
.
register
(
'scanop_remove_constants_and_unused_inputs2'
,
opt
.
in2out
(
remove_constants_and_unused_inputs_scan
,
opt
.
in2out
(
remove_constants_and_unused_inputs_scan
,
ignore_newtrees
=
True
),
ignore_newtrees
=
True
),
5
,
5
,
...
@@ -1766,7 +1763,7 @@ scan_seqopt2.register('scanop_remove_constants_and_unused_inputs2',
...
@@ -1766,7 +1763,7 @@ scan_seqopt2.register('scanop_remove_constants_and_unused_inputs2',
'fast_run'
,
'fast_run'
,
'scan'
)
'scan'
)
scan_
s
eqopt2
.
register
(
'scanOp_merge_inouts'
,
scan_eqopt2
.
register
(
'scanOp_merge_inouts'
,
opt
.
in2out
(
scan_merge_inouts
,
ignore_newtrees
=
True
),
opt
.
in2out
(
scan_merge_inouts
,
ignore_newtrees
=
True
),
6
,
6
,
'scan_merge_inouts'
,
'scan_merge_inouts'
,
...
@@ -1776,14 +1773,14 @@ scan_seqopt2.register('scanOp_merge_inouts',
...
@@ -1776,14 +1773,14 @@ scan_seqopt2.register('scanOp_merge_inouts',
# Just before specialize to have the other optimization
# Just before specialize to have the other optimization
# like constant folding being applied
# like constant folding being applied
# This don't introduce inplace.
# This don't introduce inplace.
scan_
s
eqopt2
.
register
(
'scanOp_save_mem'
,
scan_eqopt2
.
register
(
'scanOp_save_mem'
,
ScanSaveMem
(),
ScanSaveMem
(),
7
,
7
,
'fast_run'
,
'fast_run'
,
'scan'
)
'scan'
)
# After everything else
# After everything else
scan_
s
eqopt2
.
register
(
'scanOp_remove_constants_and_unused_inputs3'
,
scan_eqopt2
.
register
(
'scanOp_remove_constants_and_unused_inputs3'
,
opt
.
in2out
(
remove_constants_and_unused_inputs_scan
,
opt
.
in2out
(
remove_constants_and_unused_inputs_scan
,
ignore_newtrees
=
True
),
ignore_newtrees
=
True
),
8
,
8
,
...
...
theano/tensor/opt.py
浏览文件 @
e1e7f2e1
...
@@ -303,7 +303,8 @@ def inplace_elemwise_optimizer_op(OP):
...
@@ -303,7 +303,8 @@ def inplace_elemwise_optimizer_op(OP):
return
inplace_elemwise_optimizer
return
inplace_elemwise_optimizer
inplace_elemwise_optimizer
=
inplace_elemwise_optimizer_op
(
T
.
Elemwise
)
inplace_elemwise_optimizer
=
inplace_elemwise_optimizer_op
(
T
.
Elemwise
)
compile
.
optdb
.
register
(
'inplace_opt'
,
inplace_elemwise_optimizer
,
75
,
compile
.
optdb
.
register
(
'inplace_elemwise_opt'
,
inplace_elemwise_optimizer
,
75
,
'inplace_opt'
,
# for historic reason
'inplace_elemwise_optimizer'
,
'inplace_elemwise_optimizer'
,
'fast_run'
,
'inplace'
)
'fast_run'
,
'inplace'
)
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论