Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
TonyTonyFun
Paddle
提交
ee341efd
P
Paddle
项目概览
TonyTonyFun
/
Paddle
与 Fork 源项目一致
Fork自
PaddlePaddle / Paddle
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
ee341efd
编写于
1月 04, 2018
作者:
T
Tao Luo
提交者:
GitHub
1月 04, 2018
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #7183 from tensor-tang/use_mkl_packed
Add flag use_mkl_packed
上级
a4024a5f
3b5e4e0a
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
18 addition
and
1 deletion
+18
-1
paddle/trainer/TrainerConfigHelper.cpp
paddle/trainer/TrainerConfigHelper.cpp
+2
-0
paddle/utils/Flags.cpp
paddle/utils/Flags.cpp
+7
-0
paddle/utils/Flags.h
paddle/utils/Flags.h
+1
-0
python/paddle/trainer/config_parser.py
python/paddle/trainer/config_parser.py
+6
-1
python/paddle/v2/__init__.py
python/paddle/v2/__init__.py
+2
-0
未找到文件。
paddle/trainer/TrainerConfigHelper.cpp
浏览文件 @
ee341efd
...
@@ -29,6 +29,7 @@ DECLARE_bool(with_gpu);
...
@@ -29,6 +29,7 @@ DECLARE_bool(with_gpu);
DECLARE_bool
(
parallel_nn
);
DECLARE_bool
(
parallel_nn
);
DECLARE_string
(
config_args
);
DECLARE_string
(
config_args
);
DECLARE_bool
(
use_mkldnn
);
DECLARE_bool
(
use_mkldnn
);
DECLARE_bool
(
use_mkl_packed
);
const
char
*
kConfigParserModuleName
=
"paddle.trainer.config_parser"
;
const
char
*
kConfigParserModuleName
=
"paddle.trainer.config_parser"
;
const
char
*
kConfigParserFuncName
=
"parse_config_and_serialize"
;
const
char
*
kConfigParserFuncName
=
"parse_config_and_serialize"
;
...
@@ -46,6 +47,7 @@ TrainerConfigHelper::TrainerConfigHelper(const std::string &configFilePath)
...
@@ -46,6 +47,7 @@ TrainerConfigHelper::TrainerConfigHelper(const std::string &configFilePath)
<<
",with_cost="
<<
FLAGS_with_cost
<<
",use_gpu="
<<
FLAGS_use_gpu
<<
",with_cost="
<<
FLAGS_with_cost
<<
",use_gpu="
<<
FLAGS_use_gpu
<<
",parallel_nn="
<<
FLAGS_parallel_nn
<<
",parallel_nn="
<<
FLAGS_parallel_nn
<<
",use_mkldnn="
<<
FLAGS_use_mkldnn
<<
",use_mkldnn="
<<
FLAGS_use_mkldnn
<<
",use_mkl_packed="
<<
FLAGS_use_mkl_packed
<<
",cudnn_version="
<<
hl_get_cudnn_lib_version
();
<<
",cudnn_version="
<<
hl_get_cudnn_lib_version
();
if
(
!
FLAGS_config_args
.
empty
())
{
if
(
!
FLAGS_config_args
.
empty
())
{
configArgs
<<
","
<<
FLAGS_config_args
;
configArgs
<<
","
<<
FLAGS_config_args
;
...
...
paddle/utils/Flags.cpp
浏览文件 @
ee341efd
...
@@ -27,6 +27,13 @@ DEFINE_bool(use_mkldnn, false, "Default still keep use CPU training");
...
@@ -27,6 +27,13 @@ DEFINE_bool(use_mkldnn, false, "Default still keep use CPU training");
DEFINE_bool
(
use_mkldnn
,
false
,
"Only support CPU training"
);
DEFINE_bool
(
use_mkldnn
,
false
,
"Only support CPU training"
);
#endif
#endif
#ifdef PADDLE_WITH_MKLML
// TODO(TJ): change to true when fully confirmed
DEFINE_bool
(
use_mkl_packed
,
false
,
"Whether to use MKL Packed Optimization"
);
#else
DEFINE_bool
(
use_mkl_packed
,
false
,
"Not to use MKL Packed Optimization"
);
#endif
DEFINE_bool
(
parallel_nn
,
DEFINE_bool
(
parallel_nn
,
false
,
false
,
"Whether to use multi-threads to calculate one neural network."
"Whether to use multi-threads to calculate one neural network."
...
...
paddle/utils/Flags.h
浏览文件 @
ee341efd
...
@@ -41,3 +41,4 @@ DECLARE_string(predict_file);
...
@@ -41,3 +41,4 @@ DECLARE_string(predict_file);
DECLARE_bool
(
prev_batch_state
);
DECLARE_bool
(
prev_batch_state
);
DECLARE_string
(
init_model_path
);
DECLARE_string
(
init_model_path
);
DECLARE_bool
(
use_mkldnn
);
DECLARE_bool
(
use_mkldnn
);
DECLARE_bool
(
use_mkl_packed
);
python/paddle/trainer/config_parser.py
浏览文件 @
ee341efd
...
@@ -3622,8 +3622,13 @@ class ConcatenateLayer2(LayerBase):
...
@@ -3622,8 +3622,13 @@ class ConcatenateLayer2(LayerBase):
@
config_layer
(
'recurrent'
)
@
config_layer
(
'recurrent'
)
class
RecurrentLayer
(
LayerBase
):
class
RecurrentLayer
(
LayerBase
):
layer_type
=
'recurrent'
def
__init__
(
self
,
name
,
inputs
,
reversed
=
False
,
bias
=
True
,
**
xargs
):
def
__init__
(
self
,
name
,
inputs
,
reversed
=
False
,
bias
=
True
,
**
xargs
):
super
(
RecurrentLayer
,
self
).
__init__
(
name
,
'recurrent'
,
0
,
inputs
,
use_mkl_packed
=
bool
(
int
(
g_command_config_args
.
get
(
"use_mkl_packed"
,
0
)))
self
.
layer_type
=
'mkl_packed_recurrent'
if
use_mkl_packed
else
'recurrent'
super
(
RecurrentLayer
,
self
).
__init__
(
name
,
self
.
layer_type
,
0
,
inputs
,
**
xargs
)
**
xargs
)
config_assert
(
len
(
self
.
inputs
)
==
1
,
'RecurrentLayer must have 1 input'
)
config_assert
(
len
(
self
.
inputs
)
==
1
,
'RecurrentLayer must have 1 input'
)
input_layer
=
self
.
get_input_layer
(
0
)
input_layer
=
self
.
get_input_layer
(
0
)
...
...
python/paddle/v2/__init__.py
浏览文件 @
ee341efd
...
@@ -135,6 +135,8 @@ def init(**kwargs):
...
@@ -135,6 +135,8 @@ def init(**kwargs):
cp
.
g_command_config_args
[
'use_gpu'
]
=
kwargs
[
'use_gpu'
]
cp
.
g_command_config_args
[
'use_gpu'
]
=
kwargs
[
'use_gpu'
]
if
'use_mkldnn'
in
kwargs
:
if
'use_mkldnn'
in
kwargs
:
cp
.
g_command_config_args
[
'use_mkldnn'
]
=
kwargs
[
'use_mkldnn'
]
cp
.
g_command_config_args
[
'use_mkldnn'
]
=
kwargs
[
'use_mkldnn'
]
if
'use_mkl_packed'
in
kwargs
:
cp
.
g_command_config_args
[
'use_mkl_packed'
]
=
kwargs
[
'use_mkl_packed'
]
assert
'parallel_nn'
not
in
kwargs
,
(
"currently 'parallel_nn' is not "
assert
'parallel_nn'
not
in
kwargs
,
(
"currently 'parallel_nn' is not "
"supported in v2 APIs."
)
"supported in v2 APIs."
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录