Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
81245414
提交
81245414
authored
5月 08, 2017
作者:
Frederic Bastien
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
gpu opt, don't move float16 ops or cast to/from float32 in the graph for some…
gpu opt, don't move float16 ops or cast to/from float32 in the graph for some ops that don't support float16
上级
8735401b
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
31 行增加
和
6 行删除
+31
-6
opt.py
theano/gpuarray/opt.py
+31
-6
没有找到文件。
theano/gpuarray/opt.py
浏览文件 @
81245414
...
...
@@ -1327,6 +1327,8 @@ theano.tensor.nnet.conv2d()
@op_lifter
([
SparseBlockGemv
])
@register_opt2
([
SparseBlockGemv
],
'fast_compile'
)
def
local_gpua_sparseblockgemv
(
op
,
context_name
,
inputs
,
outputs
):
if
inputs
[
0
]
.
dtype
==
'float16'
:
return
if
op
.
inplace
:
return
gpu_sparse_block_gemv_inplace
else
:
...
...
@@ -1337,6 +1339,8 @@ def local_gpua_sparseblockgemv(op, context_name, inputs, outputs):
@op_lifter
([
SparseBlockOuter
])
@register_opt2
([
SparseBlockOuter
],
'fast_compile'
)
def
local_gpua_sparseblockouter
(
op
,
context_name
,
inputs
,
outputs
):
if
inputs
[
0
]
.
dtype
==
'float16'
:
return
if
op
.
inplace
:
return
gpu_sparse_block_outer_inplace
else
:
...
...
@@ -1990,9 +1994,15 @@ def local_gpu_maxandargmax(op, context_name, inputs, outputs):
def
local_gpu_solve
(
op
,
context_name
,
inputs
,
outputs
):
if
not
cusolver_available
:
return
if
inputs
[
0
]
.
dtype
not
in
[
'float16'
,
'float32'
]:
return
if
op
.
A_structure
not
in
MATRIX_STRUCTURES_SOLVE
:
return
return
GpuCusolverSolve
(
A_structure
=
op
.
A_structure
)
op
=
GpuCusolverSolve
(
A_structure
=
op
.
A_structure
)
if
inputs
[
0
]
.
dtype
==
'float16'
:
return
op
(
inputs
[
0
]
.
astype
(
'float32'
),
inputs
[
1
]
.
astype
(
'float32'
))
.
astype
(
'float16'
)
return
op
@register_inplace
()
...
...
@@ -2010,7 +2020,13 @@ def local_inplace_gpu_solve(node):
def
local_gpu_cholesky
(
op
,
context_name
,
inputs
,
outputs
):
if
not
cusolver_available
:
return
return
GpuCholesky
(
lower
=
op
.
lower
,
inplace
=
op
.
destructive
)
if
inputs
[
0
]
.
dtype
not
in
[
'float16'
,
'float32'
]:
return
op
=
GpuCholesky
(
lower
=
op
.
lower
,
inplace
=
op
.
destructive
)
if
inputs
[
0
]
.
dtype
==
'float16'
:
return
op
(
inputs
[
0
]
.
astype
(
'float32'
))
.
astype
(
'float16'
)
return
op
@register_inplace
()
...
...
@@ -2026,7 +2042,12 @@ def local_inplace_cholesky(node):
def
local_gpu_matrix_inverse
(
op
,
context_name
,
inputs
,
outputs
):
if
not
config
.
magma
.
enabled
:
return
return
GpuMagmaMatrixInverse
()
if
inputs
[
0
]
.
dtype
not
in
[
'float16'
,
'float32'
]:
return
op
=
GpuMagmaMatrixInverse
()
if
inputs
[
0
]
.
dtype
==
'float16'
:
return
op
(
inputs
[
0
]
.
astype
(
'float32'
))
.
astype
(
'float16'
)
return
op
@register_inplace
()
...
...
@@ -2043,9 +2064,13 @@ def local_inplace_matrix_inverse_inplace(node):
def
local_gpu_svd
(
op
,
context_name
,
inputs
,
outputs
):
if
not
config
.
magma
.
enabled
:
return
return
GpuMagmaSVD
(
full_matrices
=
op
.
full_matrices
,
compute_uv
=
op
.
compute_uv
)
if
inputs
[
0
]
.
dtype
not
in
[
'float16'
,
'float32'
]:
return
op
=
GpuMagmaSVD
(
full_matrices
=
op
.
full_matrices
,
compute_uv
=
op
.
compute_uv
)
if
inputs
[
0
]
.
dtype
==
'float16'
:
return
op
(
inputs
[
0
]
.
astype
(
'float32'
))
.
astype
(
'float16'
)
return
op
# Do not register in fast_run or fast_compile.
# It will be added to fast_run if the GPU is enabled.
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论