Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
02bde7ea
提交
02bde7ea
authored
7月 15, 2016
作者:
Frederic Bastien
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Split local_abstractconv_cudnn into 3 opt to have better stats.
上级
74b4c807
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
20 行增加
和
14 行删除
+20
-14
dnn.py
theano/gpuarray/dnn.py
+20
-7
opt.py
theano/gpuarray/opt.py
+0
-7
没有找到文件。
theano/gpuarray/dnn.py
浏览文件 @
02bde7ea
...
@@ -32,7 +32,7 @@ from .elemwise import GpuElemwise
...
@@ -32,7 +32,7 @@ from .elemwise import GpuElemwise
# These don't exist in gpuarray
# These don't exist in gpuarray
# GpuDownsampleFactorMax, GpuDownsampleFactorMaxGrad
# GpuDownsampleFactorMax, GpuDownsampleFactorMaxGrad
from
.nnet
import
GpuSoftmax
from
.nnet
import
GpuSoftmax
from
.opt
import
(
gpu_seqopt
,
register_opt
,
conv_groupopt
,
from
.opt
import
(
gpu_seqopt
,
register_opt
,
op_lifter
,
register_opt2
)
op_lifter
,
register_opt2
)
from
.opt_util
import
alpha_merge
,
output_merge
,
inplace_allocempty
from
.opt_util
import
alpha_merge
,
output_merge
,
inplace_allocempty
...
@@ -1472,18 +1472,31 @@ def local_abstractconv_cudnn_graph(op, context_name, inputs, outputs):
...
@@ -1472,18 +1472,31 @@ def local_abstractconv_cudnn_graph(op, context_name, inputs, outputs):
return
[
rval
]
return
[
rval
]
@
local_optimizer
([
AbstractConv2d
,
AbstractConv2d_gradWeights
,
@
register_opt
(
'fast_compile'
,
'conv_dnn'
,
'cudnn'
)
AbstractConv2d_gradInputs
])
@local_optimizer
([
AbstractConv2d
])
def
local_abstractconv_cudnn
(
node
):
def
local_abstractconv_cudnn
(
node
):
ctx
=
infer_context_name
(
*
node
.
inputs
)
ctx
=
infer_context_name
(
*
node
.
inputs
)
if
not
isinstance
(
node
.
inputs
[
0
]
.
type
,
GpuArrayType
):
if
not
isinstance
(
node
.
inputs
[
0
]
.
type
,
GpuArrayType
):
return
return
return
local_abstractconv_cudnn_graph
(
node
.
op
,
ctx
,
node
.
inputs
,
node
.
outputs
)
return
local_abstractconv_cudnn_graph
(
node
.
op
,
ctx
,
node
.
inputs
,
node
.
outputs
)
conv_groupopt
.
register
(
'local_abstractconv_cudnn'
,
local_abstractconv_cudnn
,
20
,
@register_opt
(
'fast_compile'
,
'conv_dnn'
,
'cudnn'
)
'fast_compile'
,
'fast_run'
,
@local_optimizer
([
AbstractConv2d_gradWeights
])
'gpuarray'
,
'conv_dnn'
,
'cudnn'
)
def
local_abstractconv_gw_cudnn
(
node
):
ctx
=
infer_context_name
(
*
node
.
inputs
)
if
not
isinstance
(
node
.
inputs
[
0
]
.
type
,
GpuArrayType
):
return
return
local_abstractconv_cudnn_graph
(
node
.
op
,
ctx
,
node
.
inputs
,
node
.
outputs
)
@register_opt
(
'fast_compile'
,
'conv_dnn'
,
'cudnn'
)
@local_optimizer
([
AbstractConv2d_gradInputs
])
def
local_abstractconv_gi_cudnn
(
node
):
ctx
=
infer_context_name
(
*
node
.
inputs
)
if
not
isinstance
(
node
.
inputs
[
0
]
.
type
,
GpuArrayType
):
return
return
local_abstractconv_cudnn_graph
(
node
.
op
,
ctx
,
node
.
inputs
,
node
.
outputs
)
@inplace_allocempty
(
GpuDnnConv
,
2
)
@inplace_allocempty
(
GpuDnnConv
,
2
)
...
...
theano/gpuarray/opt.py
浏览文件 @
02bde7ea
...
@@ -79,10 +79,6 @@ class GraphToGPUDB(DB):
...
@@ -79,10 +79,6 @@ class GraphToGPUDB(DB):
gpu_seqopt
=
SequenceDB
()
gpu_seqopt
=
SequenceDB
()
# Don't register this right now
conv_groupopt
=
LocalGroupDB
()
conv_groupopt
.
__name__
=
"gpua_conv_opts"
gpu_seqopt
.
register
(
'gpuarray_graph_optimization'
,
GraphToGPUDB
(),
-
0.5
,
gpu_seqopt
.
register
(
'gpuarray_graph_optimization'
,
GraphToGPUDB
(),
-
0.5
,
'fast_compile'
,
'fast_run'
,
'gpuarray'
)
'fast_compile'
,
'fast_run'
,
'gpuarray'
)
...
@@ -1297,9 +1293,6 @@ def local_gpua_lift_abstractconv2d_graph(op, context_name, inputs, outputs):
...
@@ -1297,9 +1293,6 @@ def local_gpua_lift_abstractconv2d_graph(op, context_name, inputs, outputs):
context_name
=
context_name
)
context_name
=
context_name
)
return
[
op
(
*
inps
)]
return
[
op
(
*
inps
)]
# Register this here so that it goes after the abstract lifting
register_opt
(
'fast_compile'
)(
conv_groupopt
)
@register_opt
(
"low_memory"
)
@register_opt
(
"low_memory"
)
@local_optimizer
([
GpuCAReduceCuda
])
@local_optimizer
([
GpuCAReduceCuda
])
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论