Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
magicwindyyd
mindspore
提交
6414e23f
M
mindspore
项目概览
magicwindyyd
/
mindspore
与 Fork 源项目一致
Fork自
MindSpore / mindspore
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
M
mindspore
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
6414e23f
编写于
6月 12, 2020
作者:
V
VectorSL
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
gpu codex fix
上级
553432c9
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
16 addition
and
16 deletion
+16
-16
mindspore/ccsrc/kernel/gpu/nn/pooling_grad_gpu_kernel.cc
mindspore/ccsrc/kernel/gpu/nn/pooling_grad_gpu_kernel.cc
+4
-4
mindspore/ccsrc/kernel/gpu/nn/pooling_grad_gpu_kernel.h
mindspore/ccsrc/kernel/gpu/nn/pooling_grad_gpu_kernel.h
+5
-5
mindspore/ccsrc/kernel/gpu/nn/relu_grad_kernel.cc
mindspore/ccsrc/kernel/gpu/nn/relu_grad_kernel.cc
+2
-2
mindspore/ccsrc/kernel/gpu/nn/relu_grad_kernel.h
mindspore/ccsrc/kernel/gpu/nn/relu_grad_kernel.h
+5
-5
未找到文件。
mindspore/ccsrc/kernel/gpu/nn/pooling_grad_gpu_kernel.cc
浏览文件 @
6414e23f
...
...
@@ -24,27 +24,27 @@ MS_REG_GPU_KERNEL_ONE(MaxPoolGrad,
.
AddInputAttr
(
kNumberTypeFloat32
)
.
AddInputAttr
(
kNumberTypeFloat32
)
.
AddOutputAttr
(
kNumberTypeFloat32
),
PoolingGradGpu
Fwd
Kernel
,
float
)
PoolingGradGpuKernel
,
float
)
MS_REG_GPU_KERNEL_ONE
(
MaxPoolGrad
,
KernelAttr
()
.
AddInputAttr
(
kNumberTypeFloat16
)
.
AddInputAttr
(
kNumberTypeFloat16
)
.
AddInputAttr
(
kNumberTypeFloat16
)
.
AddOutputAttr
(
kNumberTypeFloat16
),
PoolingGradGpu
Fwd
Kernel
,
half
)
PoolingGradGpuKernel
,
half
)
MS_REG_GPU_KERNEL_ONE
(
AvgPoolGradGpu
,
KernelAttr
()
.
AddInputAttr
(
kNumberTypeFloat32
)
.
AddInputAttr
(
kNumberTypeFloat32
)
.
AddInputAttr
(
kNumberTypeFloat32
)
.
AddOutputAttr
(
kNumberTypeFloat32
),
PoolingGradGpu
Fwd
Kernel
,
float
)
PoolingGradGpuKernel
,
float
)
MS_REG_GPU_KERNEL_ONE
(
AvgPoolGradGpu
,
KernelAttr
()
.
AddInputAttr
(
kNumberTypeFloat16
)
.
AddInputAttr
(
kNumberTypeFloat16
)
.
AddInputAttr
(
kNumberTypeFloat16
)
.
AddOutputAttr
(
kNumberTypeFloat16
),
PoolingGradGpu
Fwd
Kernel
,
half
)
PoolingGradGpuKernel
,
half
)
}
// namespace kernel
}
// namespace mindspore
mindspore/ccsrc/kernel/gpu/nn/pooling_grad_gpu_kernel.h
浏览文件 @
6414e23f
...
...
@@ -28,9 +28,9 @@
namespace
mindspore
{
namespace
kernel
{
template
<
typename
T
>
class
PoolingGradGpu
Fwd
Kernel
:
public
GpuKernel
{
class
PoolingGradGpuKernel
:
public
GpuKernel
{
public:
PoolingGradGpu
Fwd
Kernel
()
PoolingGradGpuKernel
()
:
cudnn_handle_
(
nullptr
),
pooling_descriptor_
(
nullptr
),
y_descriptor_
(
nullptr
),
...
...
@@ -55,7 +55,7 @@ class PoolingGradGpuFwdKernel : public GpuKernel {
padded_size_
(
0
),
workspace_size_
(
0
),
use_pad_
(
true
)
{}
~
PoolingGradGpu
Fwd
Kernel
()
override
{
DestroyResource
();
}
~
PoolingGradGpuKernel
()
override
{
DestroyResource
();
}
const
std
::
vector
<
size_t
>
&
GetInputSizeList
()
const
override
{
return
input_size_list_
;
}
const
std
::
vector
<
size_t
>
&
GetOutputSizeList
()
const
override
{
return
output_size_list_
;
}
...
...
@@ -108,7 +108,7 @@ class PoolingGradGpuFwdKernel : public GpuKernel {
auto
input_mask
=
AnfAlgo
::
GetPrevNodeOutputInferShape
(
kernel_node
,
1
);
is_null_input_
=
CHECK_NULL_INPUT
(
input_shape
)
||
CHECK_NULL_INPUT
(
input_mask
);
if
(
is_null_input_
)
{
MS_LOG
(
WARNING
)
<<
"PoolingGradGpu
Fwd
Kernel input is null."
;
MS_LOG
(
WARNING
)
<<
"PoolingGradGpuKernel input is null."
;
InitSizeLists
();
return
true
;
}
...
...
@@ -196,7 +196,7 @@ class PoolingGradGpuFwdKernel : public GpuKernel {
bool
CheckParam
(
const
CNodePtr
&
kernel_node
)
{
size_t
input_num
=
AnfAlgo
::
GetInputTensorNum
(
kernel_node
);
if
(
input_num
!=
3
)
{
MS_LOG
(
ERROR
)
<<
"Input number is "
<<
input_num
<<
", but PoolingGradGpu
Fwd
Kernel needs 3 inputs."
;
MS_LOG
(
ERROR
)
<<
"Input number is "
<<
input_num
<<
", but PoolingGradGpuKernel needs 3 inputs."
;
return
false
;
}
return
true
;
...
...
mindspore/ccsrc/kernel/gpu/nn/relu_grad_kernel.cc
浏览文件 @
6414e23f
...
...
@@ -21,10 +21,10 @@ namespace kernel {
MS_REG_GPU_KERNEL_ONE
(
ReluGrad
,
KernelAttr
().
AddInputAttr
(
kNumberTypeFloat32
).
AddInputAttr
(
kNumberTypeFloat32
).
AddOutputAttr
(
kNumberTypeFloat32
),
ReluGradGpu
Fwd
Kernel
,
float
)
ReluGradGpuKernel
,
float
)
MS_REG_GPU_KERNEL_ONE
(
ReluGrad
,
KernelAttr
().
AddInputAttr
(
kNumberTypeFloat16
).
AddInputAttr
(
kNumberTypeFloat16
).
AddOutputAttr
(
kNumberTypeFloat16
),
ReluGradGpu
Fwd
Kernel
,
half
)
ReluGradGpuKernel
,
half
)
}
// namespace kernel
}
// namespace mindspore
mindspore/ccsrc/kernel/gpu/nn/relu_grad_kernel.h
浏览文件 @
6414e23f
...
...
@@ -25,9 +25,9 @@
namespace
mindspore
{
namespace
kernel
{
template
<
typename
T
>
class
ReluGradGpu
Fwd
Kernel
:
public
GpuKernel
{
class
ReluGradGpuKernel
:
public
GpuKernel
{
public:
ReluGradGpu
Fwd
Kernel
()
ReluGradGpuKernel
()
:
cudnn_handle_
(
nullptr
),
activation_desc_
(
nullptr
),
mode_
(
CUDNN_ACTIVATION_RELU
),
...
...
@@ -35,7 +35,7 @@ class ReluGradGpuFwdKernel : public GpuKernel {
is_null_input_
(
false
),
cudnn_data_type_
(
CUDNN_DATA_FLOAT
),
input_size_
(
0
)
{}
~
ReluGradGpu
Fwd
Kernel
()
override
{
DestroyResource
();
}
~
ReluGradGpuKernel
()
override
{
DestroyResource
();
}
const
std
::
vector
<
size_t
>
&
GetInputSizeList
()
const
override
{
return
input_size_list_
;
}
const
std
::
vector
<
size_t
>
&
GetOutputSizeList
()
const
override
{
return
output_size_list_
;
}
const
std
::
vector
<
size_t
>
&
GetWorkspaceSizeList
()
const
override
{
return
workspace_size_list_
;
}
...
...
@@ -63,14 +63,14 @@ class ReluGradGpuFwdKernel : public GpuKernel {
cudnn_data_type_
=
GetCudnnDataType
(
TypeIdLabel
(
AnfAlgo
::
GetInputDeviceDataType
(
kernel_node
,
0
)));
size_t
input_num
=
AnfAlgo
::
GetInputTensorNum
(
kernel_node
);
if
(
input_num
!=
2
)
{
MS_LOG
(
ERROR
)
<<
"Argument number is "
<<
input_num
<<
", but ReluGradGpu
Fwd
Kernel needs 2."
;
MS_LOG
(
ERROR
)
<<
"Argument number is "
<<
input_num
<<
", but ReluGradGpuKernel needs 2."
;
return
false
;
}
auto
input_shape
=
AnfAlgo
::
GetOutputInferShape
(
kernel_node
,
0
);
mode_
=
CUDNN_ACTIVATION_RELU
;
is_null_input_
=
CHECK_NULL_INPUT
(
input_shape
);
if
(
is_null_input_
)
{
MS_LOG
(
WARNING
)
<<
"ReluGradGpu
Fwd
Kernel input is null."
;
MS_LOG
(
WARNING
)
<<
"ReluGradGpuKernel input is null."
;
InitSizeLists
();
return
true
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录