Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
640c12f3
提交
640c12f3
authored
3月 29, 2022
作者:
Brandon T. Willard
提交者:
Brandon T. Willard
4月 07, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Remove fast_compile_gpu tag
上级
5415f12d
显示空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
13 行增加
和
21 行删除
+13
-21
mode.py
aesara/compile/mode.py
+3
-11
basic.py
aesara/tensor/nnet/basic.py
+9
-9
subtensor_opt.py
aesara/tensor/subtensor_opt.py
+1
-1
没有找到文件。
aesara/compile/mode.py
浏览文件 @
640c12f3
...
@@ -71,14 +71,8 @@ OPT_NONE = OptimizationQuery(include=[], exclude=exclude)
...
@@ -71,14 +71,8 @@ OPT_NONE = OptimizationQuery(include=[], exclude=exclude)
OPT_MERGE
=
OptimizationQuery
(
include
=
[
"merge"
],
exclude
=
exclude
)
OPT_MERGE
=
OptimizationQuery
(
include
=
[
"merge"
],
exclude
=
exclude
)
OPT_FAST_RUN
=
OptimizationQuery
(
include
=
[
"fast_run"
],
exclude
=
exclude
)
OPT_FAST_RUN
=
OptimizationQuery
(
include
=
[
"fast_run"
],
exclude
=
exclude
)
OPT_FAST_RUN_STABLE
=
OPT_FAST_RUN
.
requiring
(
"stable"
)
OPT_FAST_RUN_STABLE
=
OPT_FAST_RUN
.
requiring
(
"stable"
)
# We need fast_compile_gpu here. As on the GPU, we don't have all
# operation that exist in fast_compile, but have some that get
OPT_FAST_COMPILE
=
OptimizationQuery
(
include
=
[
"fast_compile"
],
exclude
=
exclude
)
# introduced in fast_run, we want those optimization to also run in
# fast_compile+gpu. We can't tag them just as 'gpu', as this would
# exclude them if we exclude 'gpu'.
OPT_FAST_COMPILE
=
OptimizationQuery
(
include
=
[
"fast_compile"
,
"fast_compile_gpu"
],
exclude
=
exclude
)
OPT_STABILIZE
=
OptimizationQuery
(
include
=
[
"fast_run"
],
exclude
=
exclude
)
OPT_STABILIZE
=
OptimizationQuery
(
include
=
[
"fast_run"
],
exclude
=
exclude
)
OPT_STABILIZE
.
position_cutoff
=
1.5000001
OPT_STABILIZE
.
position_cutoff
=
1.5000001
OPT_NONE
.
name
=
"OPT_NONE"
OPT_NONE
.
name
=
"OPT_NONE"
...
@@ -252,9 +246,7 @@ optdb.register(
...
@@ -252,9 +246,7 @@ optdb.register(
)
# 'fast_run', 'fast_compile')
)
# 'fast_run', 'fast_compile')
# misc special cases for speed
# misc special cases for speed
optdb
.
register
(
optdb
.
register
(
"specialize"
,
EquilibriumDB
(),
"fast_run"
,
"fast_compile"
,
position
=
2
)
"specialize"
,
EquilibriumDB
(),
"fast_run"
,
"fast_compile_gpu"
,
position
=
2
)
# misc special cases for speed that break canonicalization
# misc special cases for speed that break canonicalization
optdb
.
register
(
"uncanonicalize"
,
EquilibriumDB
(),
"fast_run"
,
position
=
3
)
optdb
.
register
(
"uncanonicalize"
,
EquilibriumDB
(),
"fast_run"
,
position
=
3
)
...
...
aesara/tensor/nnet/basic.py
浏览文件 @
640c12f3
...
@@ -1156,7 +1156,7 @@ def logsoftmax(c, axis=UNSET_AXIS):
...
@@ -1156,7 +1156,7 @@ def logsoftmax(c, axis=UNSET_AXIS):
return
LogSoftmax
(
axis
=
axis
)(
c
)
return
LogSoftmax
(
axis
=
axis
)(
c
)
@register_specialize
(
"fast_compile
_gpu
"
)
@register_specialize
(
"fast_compile"
)
@local_optimizer
([
softmax_legacy
])
@local_optimizer
([
softmax_legacy
])
def
local_softmax_with_bias
(
fgraph
,
node
):
def
local_softmax_with_bias
(
fgraph
,
node
):
"""
"""
...
@@ -1852,8 +1852,8 @@ class CrossentropyCategorical1Hot(Op):
...
@@ -1852,8 +1852,8 @@ class CrossentropyCategorical1Hot(Op):
crossentropy_categorical_1hot
=
CrossentropyCategorical1Hot
()
crossentropy_categorical_1hot
=
CrossentropyCategorical1Hot
()
@register_stabilize
(
"fast_compile
_gpu
"
)
@register_stabilize
(
"fast_compile"
)
@register_specialize
(
"fast_compile
_gpu
"
)
@register_specialize
(
"fast_compile"
)
@optimizer
@optimizer
def
crossentropy_to_crossentropy_with_softmax_with_bias
(
fgraph
):
def
crossentropy_to_crossentropy_with_softmax_with_bias
(
fgraph
):
"""
"""
...
@@ -1953,13 +1953,13 @@ optdb.register(
...
@@ -1953,13 +1953,13 @@ optdb.register(
crossentropy_to_crossentropy_with_softmax
,
crossentropy_to_crossentropy_with_softmax
,
"fast_run"
,
"fast_run"
,
"xent"
,
"xent"
,
"fast_compile
_gpu
"
,
"fast_compile"
,
position
=
2.01
,
position
=
2.01
,
)
)
@register_specialize
(
@register_specialize
(
"fast_compile
_gpu
"
,
"local_crossentropy_to_crossentropy_with_softmax_grad"
"fast_compile"
,
"local_crossentropy_to_crossentropy_with_softmax_grad"
)
# old name
)
# old name
@local_optimizer
([
softmax_grad_legacy
])
@local_optimizer
([
softmax_grad_legacy
])
def
local_softmax_grad_to_crossentropy_with_softmax_grad
(
fgraph
,
node
):
def
local_softmax_grad_to_crossentropy_with_softmax_grad
(
fgraph
,
node
):
...
@@ -1977,7 +1977,7 @@ def local_softmax_grad_to_crossentropy_with_softmax_grad(fgraph, node):
...
@@ -1977,7 +1977,7 @@ def local_softmax_grad_to_crossentropy_with_softmax_grad(fgraph, node):
return
[
dx
]
return
[
dx
]
@register_specialize
(
"fast_compile
_gpu
"
)
@register_specialize
(
"fast_compile"
)
@local_optimizer
([
MaxAndArgmax
])
@local_optimizer
([
MaxAndArgmax
])
def
local_argmax_pushdown
(
fgraph
,
node
):
def
local_argmax_pushdown
(
fgraph
,
node
):
if
(
if
(
...
@@ -2066,7 +2066,7 @@ def _is_const(z, val, approx=False):
...
@@ -2066,7 +2066,7 @@ def _is_const(z, val, approx=False):
return
np
.
all
(
maybe
==
val
)
return
np
.
all
(
maybe
==
val
)
@register_specialize
(
"fast_compile
_gpu
"
)
@register_specialize
(
"fast_compile"
)
@local_optimizer
([
AdvancedSubtensor
,
log
])
@local_optimizer
([
AdvancedSubtensor
,
log
])
def
local_advanced_indexing_crossentropy_onehot
(
fgraph
,
node
):
def
local_advanced_indexing_crossentropy_onehot
(
fgraph
,
node
):
log_op
=
None
log_op
=
None
...
@@ -2114,7 +2114,7 @@ def local_advanced_indexing_crossentropy_onehot(fgraph, node):
...
@@ -2114,7 +2114,7 @@ def local_advanced_indexing_crossentropy_onehot(fgraph, node):
return
[
ret
]
return
[
ret
]
@register_specialize
(
"fast_compile
_gpu
"
)
@register_specialize
(
"fast_compile"
)
@local_optimizer
([
softmax_grad_legacy
])
@local_optimizer
([
softmax_grad_legacy
])
def
local_advanced_indexing_crossentropy_onehot_grad
(
fgraph
,
node
):
def
local_advanced_indexing_crossentropy_onehot_grad
(
fgraph
,
node
):
if
not
(
node
.
op
==
softmax_grad_legacy
and
node
.
inputs
[
1
]
.
ndim
==
2
):
if
not
(
node
.
op
==
softmax_grad_legacy
and
node
.
inputs
[
1
]
.
ndim
==
2
):
...
@@ -2329,7 +2329,7 @@ def local_advanced_indexing_crossentropy_onehot_grad(fgraph, node):
...
@@ -2329,7 +2329,7 @@ def local_advanced_indexing_crossentropy_onehot_grad(fgraph, node):
return
return
@register_specialize
(
"fast_compile
_gpu
"
)
@register_specialize
(
"fast_compile"
)
@local_optimizer
([
softmax_with_bias
])
@local_optimizer
([
softmax_with_bias
])
def
graph_merge_softmax_with_crossentropy_softmax
(
fgraph
,
node
):
def
graph_merge_softmax_with_crossentropy_softmax
(
fgraph
,
node
):
if
node
.
op
==
softmax_with_bias
:
if
node
.
op
==
softmax_with_bias
:
...
...
aesara/tensor/subtensor_opt.py
浏览文件 @
640c12f3
...
@@ -704,7 +704,7 @@ def local_subtensor_inc_subtensor(fgraph, node):
...
@@ -704,7 +704,7 @@ def local_subtensor_inc_subtensor(fgraph, node):
@register_specialize
@register_specialize
@register_canonicalize
(
"fast_compile
_gpu
"
)
@register_canonicalize
(
"fast_compile"
)
@register_useless
@register_useless
@local_optimizer
([
Subtensor
,
AdvancedSubtensor1
])
@local_optimizer
([
Subtensor
,
AdvancedSubtensor1
])
def
local_subtensor_make_vector
(
fgraph
,
node
):
def
local_subtensor_make_vector
(
fgraph
,
node
):
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论