Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
机器未来
Paddle
提交
0c30098f
P
Paddle
项目概览
机器未来
/
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看板
未验证
提交
0c30098f
编写于
3月 20, 2020
作者:
H
hutuxian
提交者:
GitHub
3月 20, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add need_save_delta parameter to solve OOM (#23097)
上级
2e2da712
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
10 addition
and
10 deletion
+10
-10
paddle/fluid/framework/fleet/box_wrapper.cc
paddle/fluid/framework/fleet/box_wrapper.cc
+2
-2
paddle/fluid/framework/fleet/box_wrapper.h
paddle/fluid/framework/fleet/box_wrapper.h
+3
-3
python/paddle/fluid/dataset.py
python/paddle/fluid/dataset.py
+3
-3
python/paddle/fluid/tests/unittests/test_boxps.py
python/paddle/fluid/tests/unittests/test_boxps.py
+2
-2
未找到文件。
paddle/fluid/framework/fleet/box_wrapper.cc
浏览文件 @
0c30098f
...
@@ -117,8 +117,8 @@ void BoxWrapper::BeginPass() const {
...
@@ -117,8 +117,8 @@ void BoxWrapper::BeginPass() const {
"BeginPass failed in BoxPS."
));
"BeginPass failed in BoxPS."
));
}
}
void
BoxWrapper
::
EndPass
()
const
{
void
BoxWrapper
::
EndPass
(
bool
need_save_delta
)
const
{
int
ret
=
boxps_ptr_
->
EndPass
();
int
ret
=
boxps_ptr_
->
EndPass
(
need_save_delta
);
PADDLE_ENFORCE_EQ
(
PADDLE_ENFORCE_EQ
(
ret
,
0
,
platform
::
errors
::
PreconditionNotMet
(
"EndPass failed in BoxPS."
));
ret
,
0
,
platform
::
errors
::
PreconditionNotMet
(
"EndPass failed in BoxPS."
));
}
}
...
...
paddle/fluid/framework/fleet/box_wrapper.h
浏览文件 @
0c30098f
...
@@ -129,7 +129,7 @@ class BoxWrapper {
...
@@ -129,7 +129,7 @@ class BoxWrapper {
void
BeginFeedPass
(
int
date
,
boxps
::
PSAgentBase
**
agent
)
const
;
void
BeginFeedPass
(
int
date
,
boxps
::
PSAgentBase
**
agent
)
const
;
void
EndFeedPass
(
boxps
::
PSAgentBase
*
agent
)
const
;
void
EndFeedPass
(
boxps
::
PSAgentBase
*
agent
)
const
;
void
BeginPass
()
const
;
void
BeginPass
()
const
;
void
EndPass
()
const
;
void
EndPass
(
bool
need_save_delta
)
const
;
void
PullSparse
(
const
paddle
::
platform
::
Place
&
place
,
void
PullSparse
(
const
paddle
::
platform
::
Place
&
place
,
const
std
::
vector
<
const
uint64_t
*>&
keys
,
const
std
::
vector
<
const
uint64_t
*>&
keys
,
const
std
::
vector
<
float
*>&
values
,
const
std
::
vector
<
float
*>&
values
,
...
@@ -503,10 +503,10 @@ class BoxHelper {
...
@@ -503,10 +503,10 @@ class BoxHelper {
box_ptr
->
BeginPass
();
box_ptr
->
BeginPass
();
#endif
#endif
}
}
void
EndPass
()
{
void
EndPass
(
bool
need_save_delta
)
{
#ifdef PADDLE_WITH_BOX_PS
#ifdef PADDLE_WITH_BOX_PS
auto
box_ptr
=
BoxWrapper
::
GetInstance
();
auto
box_ptr
=
BoxWrapper
::
GetInstance
();
box_ptr
->
EndPass
();
box_ptr
->
EndPass
(
need_save_delta
);
#endif
#endif
}
}
void
LoadIntoMemory
()
{
void
LoadIntoMemory
()
{
...
...
python/paddle/fluid/dataset.py
浏览文件 @
0c30098f
...
@@ -832,7 +832,7 @@ class BoxPSDataset(InMemoryDataset):
...
@@ -832,7 +832,7 @@ class BoxPSDataset(InMemoryDataset):
"""
"""
self
.
boxps
.
begin_pass
()
self
.
boxps
.
begin_pass
()
def
end_pass
(
self
):
def
end_pass
(
self
,
need_save_delta
):
"""
"""
End Pass
End Pass
Notify BoxPS that current pass ended
Notify BoxPS that current pass ended
...
@@ -841,9 +841,9 @@ class BoxPSDataset(InMemoryDataset):
...
@@ -841,9 +841,9 @@ class BoxPSDataset(InMemoryDataset):
import paddle.fluid as fluid
import paddle.fluid as fluid
dataset = fluid.DatasetFactory().create_dataset("BoxPSDataset")
dataset = fluid.DatasetFactory().create_dataset("BoxPSDataset")
dataset.end_pass()
dataset.end_pass(
True
)
"""
"""
self
.
boxps
.
end_pass
()
self
.
boxps
.
end_pass
(
need_save_delta
)
def
wait_preload_done
(
self
):
def
wait_preload_done
(
self
):
"""
"""
...
...
python/paddle/fluid/tests/unittests/test_boxps.py
浏览文件 @
0c30098f
...
@@ -150,7 +150,7 @@ class TestBoxPSPreload(unittest.TestCase):
...
@@ -150,7 +150,7 @@ class TestBoxPSPreload(unittest.TestCase):
program
=
fluid
.
default_main_program
(),
program
=
fluid
.
default_main_program
(),
dataset
=
datasets
[
0
],
dataset
=
datasets
[
0
],
print_period
=
1
)
print_period
=
1
)
datasets
[
0
].
end_pass
()
datasets
[
0
].
end_pass
(
True
)
datasets
[
1
].
wait_preload_done
()
datasets
[
1
].
wait_preload_done
()
datasets
[
1
].
begin_pass
()
datasets
[
1
].
begin_pass
()
exe
.
train_from_dataset
(
exe
.
train_from_dataset
(
...
@@ -158,7 +158,7 @@ class TestBoxPSPreload(unittest.TestCase):
...
@@ -158,7 +158,7 @@ class TestBoxPSPreload(unittest.TestCase):
dataset
=
datasets
[
1
],
dataset
=
datasets
[
1
],
print_period
=
1
,
print_period
=
1
,
debug
=
True
)
debug
=
True
)
datasets
[
1
].
end_pass
()
datasets
[
1
].
end_pass
(
False
)
for
f
in
filelist
:
for
f
in
filelist
:
os
.
remove
(
f
)
os
.
remove
(
f
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录