Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle
提交
9a7832f8
P
Paddle
项目概览
PaddlePaddle
/
Paddle
1 年多 前同步成功
通知
2305
Star
20932
Fork
5423
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1423
列表
看板
标记
里程碑
合并请求
543
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1,423
Issue
1,423
列表
看板
标记
里程碑
合并请求
543
合并请求
543
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
9a7832f8
编写于
11月 25, 2019
作者:
T
Thunderbrook
提交者:
GitHub
11月 25, 2019
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
print table stat info for pslib (#21296)
* print table stat test=develop * notes test=develop * notes test=develop
上级
341dee06
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
35 addition
and
0 deletion
+35
-0
paddle/fluid/framework/fleet/fleet_wrapper.cc
paddle/fluid/framework/fleet/fleet_wrapper.cc
+13
-0
paddle/fluid/framework/fleet/fleet_wrapper.h
paddle/fluid/framework/fleet/fleet_wrapper.h
+2
-0
paddle/fluid/pybind/fleet_wrapper_py.cc
paddle/fluid/pybind/fleet_wrapper_py.cc
+1
-0
python/paddle/fluid/incubate/fleet/parameter_server/pslib/__init__.py
...e/fluid/incubate/fleet/parameter_server/pslib/__init__.py
+19
-0
未找到文件。
paddle/fluid/framework/fleet/fleet_wrapper.cc
浏览文件 @
9a7832f8
...
...
@@ -560,6 +560,19 @@ void FleetWrapper::SaveModel(const std::string& path, const int mode) {
#endif
}
void
FleetWrapper
::
PrintTableStat
(
const
uint64_t
table_id
)
{
#ifdef PADDLE_WITH_PSLIB
auto
ret
=
pslib_ptr_
->
_worker_ptr
->
print_table_stat
(
table_id
);
ret
.
wait
();
int32_t
err_code
=
ret
.
get
();
if
(
err_code
==
-
1
)
{
LOG
(
ERROR
)
<<
"print table stat failed"
;
}
#else
VLOG
(
0
)
<<
"FleetWrapper::PrintTableStat does nothing when no pslib"
;
#endif
}
double
FleetWrapper
::
GetCacheThreshold
(
int
table_id
)
{
#ifdef PADDLE_WITH_PSLIB
double
cache_threshold
=
0.0
;
...
...
paddle/fluid/framework/fleet/fleet_wrapper.h
浏览文件 @
9a7832f8
...
...
@@ -167,6 +167,8 @@ class FleetWrapper {
std
::
string
model_path
,
std
::
string
model_proto_file
,
std
::
vector
<
std
::
string
>
table_var_list
,
bool
load_combine
);
void
PrintTableStat
(
const
uint64_t
table_id
);
// mode = 0, load all feature
// mode = 1, laod delta feature, which means load diff
void
LoadModel
(
const
std
::
string
&
path
,
const
int
mode
);
...
...
paddle/fluid/pybind/fleet_wrapper_py.cc
浏览文件 @
9a7832f8
...
...
@@ -63,6 +63,7 @@ void BindFleetWrapper(py::module* m) {
&
framework
::
FleetWrapper
::
CreateClient2ClientConnection
)
.
def
(
"shrink_sparse_table"
,
&
framework
::
FleetWrapper
::
ShrinkSparseTable
)
.
def
(
"shrink_dense_table"
,
&
framework
::
FleetWrapper
::
ShrinkDenseTable
)
.
def
(
"print_table_stat"
,
&
framework
::
FleetWrapper
::
PrintTableStat
)
.
def
(
"client_flush"
,
&
framework
::
FleetWrapper
::
ClientFlush
)
.
def
(
"load_from_paddle_model"
,
&
framework
::
FleetWrapper
::
LoadFromPaddleModel
)
...
...
python/paddle/fluid/incubate/fleet/parameter_server/pslib/__init__.py
浏览文件 @
9a7832f8
...
...
@@ -238,6 +238,25 @@ class PSLib(Fleet):
"""
self
.
_fleet_ptr
.
save_model
(
dirname
)
def
print_table_stat
(
self
,
table_id
):
"""
print stat info of table_id,
format: tableid, feasign size, mf size
Args:
table_id(int): the id of table
Example:
.. code-block:: python
fleet.print_table_stat(0)
"""
self
.
_role_maker
.
_barrier_worker
()
if
self
.
_role_maker
.
is_first_worker
():
self
.
_fleet_ptr
.
print_table_stat
(
table_id
)
self
.
_role_maker
.
_barrier_worker
()
def
save_persistables
(
self
,
executor
,
dirname
,
main_program
=
None
,
**
kwargs
):
"""
save presistable parameters,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录