Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Crayon鑫
Paddle
提交
7a7c8fd9
P
Paddle
项目概览
Crayon鑫
/
Paddle
与 Fork 源项目一致
Fork自
PaddlePaddle / Paddle
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
7a7c8fd9
编写于
10月 13, 2017
作者:
T
tensor-tang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
simplify some comments and code
上级
59ccb01a
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
17 addition
and
22 deletion
+17
-22
paddle/gserver/layers/MKLDNNConvLayer.cpp
paddle/gserver/layers/MKLDNNConvLayer.cpp
+1
-1
paddle/gserver/layers/MKLDNNLayer.h
paddle/gserver/layers/MKLDNNLayer.h
+4
-5
paddle/trainer/tests/CMakeLists.txt
paddle/trainer/tests/CMakeLists.txt
+12
-16
未找到文件。
paddle/gserver/layers/MKLDNNConvLayer.cpp
浏览文件 @
7a7c8fd9
...
@@ -315,7 +315,7 @@ void MKLDNNConvLayer::resetOutValue(
...
@@ -315,7 +315,7 @@ void MKLDNNConvLayer::resetOutValue(
}
else
{
}
else
{
cpuOutVal_
=
out
;
cpuOutVal_
=
out
;
}
}
// when output is cpu device, change the mkldnn output value and make the
y
// when output is cpu device, change the mkldnn output value and make the
m
// share the same data. Then if next layer use inputlayer->getOuputValue()
// share the same data. Then if next layer use inputlayer->getOuputValue()
// to achieve the input value, it will get the right data.
// to achieve the input value, it will get the right data.
output_
.
value
=
std
::
dynamic_pointer_cast
<
Matrix
>
(
cpuOutVal_
);
output_
.
value
=
std
::
dynamic_pointer_cast
<
Matrix
>
(
cpuOutVal_
);
...
...
paddle/gserver/layers/MKLDNNLayer.h
浏览文件 @
7a7c8fd9
...
@@ -268,9 +268,9 @@ protected:
...
@@ -268,9 +268,9 @@ protected:
/**
/**
* reset the output grad matrix from primitive desc.
* reset the output grad matrix from primitive desc.
* and reset the merge grad primitive if needed.
* and reset the merge grad primitive if needed.
* note: when this layer ha
ve serval output
,
* note: when this layer ha
s serval outputs
,
*
do not support mixing
with cpu device,
*
it could not be mixed
with cpu device,
*
because
can not get memory desc from cpu device.
*
since it
can not get memory desc from cpu device.
*/
*/
virtual
void
resetOutGrad
(
MKLDNNMatrixPtr
&
out
,
virtual
void
resetOutGrad
(
MKLDNNMatrixPtr
&
out
,
mkldnn
::
memory
::
primitive_desc
pd
)
{
mkldnn
::
memory
::
primitive_desc
pd
)
{
...
@@ -281,7 +281,7 @@ protected:
...
@@ -281,7 +281,7 @@ protected:
if
(
outputMap_
.
size
()
<=
1
)
{
if
(
outputMap_
.
size
()
<=
1
)
{
return
;
return
;
}
}
std
::
vector
<
double
>
scales
;
std
::
vector
<
double
>
scales
(
outputMap_
.
size
(),
1.0
)
;
std
::
vector
<
mkldnn
::
memory
::
primitive_desc
>
srcPDs
;
std
::
vector
<
mkldnn
::
memory
::
primitive_desc
>
srcPDs
;
std
::
vector
<
mkldnn
::
primitive
::
at
>
srcs
;
std
::
vector
<
mkldnn
::
primitive
::
at
>
srcs
;
for
(
auto
it
=
outputMap_
.
begin
();
it
!=
outputMap_
.
end
();
++
it
)
{
for
(
auto
it
=
outputMap_
.
begin
();
it
!=
outputMap_
.
end
();
++
it
)
{
...
@@ -297,7 +297,6 @@ protected:
...
@@ -297,7 +297,6 @@ protected:
}
}
srcPDs
.
push_back
(
src
->
getPrimitiveDesc
());
srcPDs
.
push_back
(
src
->
getPrimitiveDesc
());
srcs
.
push_back
(
*
src
);
srcs
.
push_back
(
*
src
);
scales
.
push_back
(
1.0
);
}
}
// TODO(TJ): remove me when mkldnn sum support different formats
// TODO(TJ): remove me when mkldnn sum support different formats
...
...
paddle/trainer/tests/CMakeLists.txt
浏览文件 @
7a7c8fd9
...
@@ -39,22 +39,18 @@ add_test(NAME test_CompareTwoNets
...
@@ -39,22 +39,18 @@ add_test(NAME test_CompareTwoNets
################ test_CompareMKLDNNandCPU ######################
################ test_CompareMKLDNNandCPU ######################
if
(
WITH_MKLDNN
)
if
(
WITH_MKLDNN
)
add_unittest_without_exec
(
test_CompareMKLDNNandCPU
macro
(
gen_command VAR_NAME CONFIG_FILE
)
test_CompareTwoNets.cpp
)
set
(
${
VAR_NAME
}
"
${
PADDLE_SOURCE_DIR
}
/paddle/.set_python_path.sh"
"-d"
"
${
PADDLE_SOURCE_DIR
}
/python/"
add_test
(
NAME test_CompareMKLDNNandCPU
"
${
CMAKE_CURRENT_BINARY_DIR
}
/test_CompareMKLDNNandCPU --use_gpu=False"
COMMAND
${
PADDLE_SOURCE_DIR
}
/paddle/.set_python_path.sh -d
${
PADDLE_SOURCE_DIR
}
/python/
"--config_file_a=trainer/tests/
${
CONFIG_FILE
}
--use_mkldnn_a=True"
${
CMAKE_CURRENT_BINARY_DIR
}
/test_CompareMKLDNNandCPU
"--config_file_b=trainer/tests/
${
CONFIG_FILE
}
--use_mkldnn_b=False"
--config_file_a=trainer/tests/sample_trainer_config_simple_net.conf --use_mkldnn_a=True
"WORKING_DIRECTORY"
"
${
PADDLE_SOURCE_DIR
}
/paddle/"
)
--config_file_b=trainer/tests/sample_trainer_config_simple_net.conf --use_mkldnn_b=False
endmacro
()
--use_gpu=False
add_unittest_without_exec
(
test_CompareMKLDNNandCPU test_CompareTwoNets.cpp
)
WORKING_DIRECTORY
${
PADDLE_SOURCE_DIR
}
/paddle/
)
gen_command
(
compare_simple_net
"sample_trainer_config_simple_net.conf"
)
add_test
(
NAME test_CompareMKLDNNandCPU_Banches
gen_command
(
compare_branch_net
"sample_trainer_config_branch_net.conf"
)
COMMAND
${
PADDLE_SOURCE_DIR
}
/paddle/.set_python_path.sh -d
${
PADDLE_SOURCE_DIR
}
/python/
add_test
(
NAME test_CompareMKLDNNandCPU_simple_net COMMAND
${
compare_simple_net
}
)
${
CMAKE_CURRENT_BINARY_DIR
}
/test_CompareMKLDNNandCPU
add_test
(
NAME test_CompareMKLDNNandCPU_branch_net COMMAND
${
compare_branch_net
}
)
--config_file_a=trainer/tests/sample_trainer_config_branch_net.conf --use_mkldnn_a=True
--config_file_b=trainer/tests/sample_trainer_config_branch_net.conf --use_mkldnn_b=False
--use_gpu=False
WORKING_DIRECTORY
${
PADDLE_SOURCE_DIR
}
/paddle/
)
endif
()
endif
()
############### test_CompareTwoOpts ###################
############### test_CompareTwoOpts ###################
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录