Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle
提交
a1821a04
P
Paddle
项目概览
PaddlePaddle
/
Paddle
大约 1 年 前同步成功
通知
2299
Star
20931
Fork
5422
代码
文件
提交
分支
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看板
提交
a1821a04
编写于
3月 30, 2019
作者:
Q
Qiao Longfei
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
remote remote_prefetch in embedding layer test=develop
上级
61912e87
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
7 addition
and
4 deletion
+7
-4
paddle/fluid/framework/details/async_ssa_graph_executor.cc
paddle/fluid/framework/details/async_ssa_graph_executor.cc
+3
-0
paddle/fluid/operators/lookup_table_op.h
paddle/fluid/operators/lookup_table_op.h
+2
-1
python/paddle/fluid/layers/nn.py
python/paddle/fluid/layers/nn.py
+2
-3
未找到文件。
paddle/fluid/framework/details/async_ssa_graph_executor.cc
浏览文件 @
a1821a04
...
@@ -81,6 +81,9 @@ void ProcessGraph(std::vector<ir::Graph *> graphs, Scope *scope) {
...
@@ -81,6 +81,9 @@ void ProcessGraph(std::vector<ir::Graph *> graphs, Scope *scope) {
nodes_to_delete
.
push_back
(
node
);
nodes_to_delete
.
push_back
(
node
);
VLOG
(
3
)
<<
"find and remove an recv op: "
VLOG
(
3
)
<<
"find and remove an recv op: "
<<
recv_varname_to_ctx
[
recv_var_name
];
<<
recv_varname_to_ctx
[
recv_var_name
];
}
else
if
(
node
->
Name
()
==
"lookup_table"
)
{
VLOG
(
0
)
<<
"set lookup_table op remote_prefetch to false"
;
node
->
Op
()
->
SetAttr
(
"remote_prefetch"
,
false
);
}
}
}
}
}
}
...
...
paddle/fluid/operators/lookup_table_op.h
浏览文件 @
a1821a04
...
@@ -50,11 +50,12 @@ class LookupTableKernel : public framework::OpKernel<T> {
...
@@ -50,11 +50,12 @@ class LookupTableKernel : public framework::OpKernel<T> {
// for remote prefetch
// for remote prefetch
auto
epmap
=
context
.
Attr
<
std
::
vector
<
std
::
string
>>
(
"epmap"
);
auto
epmap
=
context
.
Attr
<
std
::
vector
<
std
::
string
>>
(
"epmap"
);
auto
remote_prefetch
=
context
.
Attr
<
bool
>
(
"remote_prefetch"
);
auto
height_sections
=
auto
height_sections
=
context
.
Attr
<
std
::
vector
<
int64_t
>>
(
"height_sections"
);
context
.
Attr
<
std
::
vector
<
int64_t
>>
(
"height_sections"
);
auto
table_names
=
context
.
Attr
<
std
::
vector
<
std
::
string
>>
(
"table_names"
);
auto
table_names
=
context
.
Attr
<
std
::
vector
<
std
::
string
>>
(
"table_names"
);
if
(
!
epmap
.
empty
())
{
if
(
remote_prefetch
&&
!
epmap
.
empty
())
{
// if epmap is not empty, then the parameter will be fetched from remote
// if epmap is not empty, then the parameter will be fetched from remote
// parameter
// parameter
// server
// server
...
...
python/paddle/fluid/layers/nn.py
浏览文件 @
a1821a04
...
@@ -341,8 +341,7 @@ def embedding(input,
...
@@ -341,8 +341,7 @@ def embedding(input,
is_distributed
=
False
,
is_distributed
=
False
,
padding_idx
=
None
,
padding_idx
=
None
,
param_attr
=
None
,
param_attr
=
None
,
dtype
=
'float32'
,
dtype
=
'float32'
):
remote_prefetch
=
False
):
"""
"""
**Embedding Layer**
**Embedding Layer**
...
@@ -381,7 +380,7 @@ def embedding(input,
...
@@ -381,7 +380,7 @@ def embedding(input,
"""
"""
helper
=
LayerHelper
(
'embedding'
,
**
locals
())
helper
=
LayerHelper
(
'embedding'
,
**
locals
())
remote_prefetch
=
is_sparse
and
(
not
is_distributed
)
and
remote_prefetch
remote_prefetch
=
is_sparse
and
(
not
is_distributed
)
if
remote_prefetch
:
if
remote_prefetch
:
assert
is_sparse
is
True
and
is_distributed
is
False
assert
is_sparse
is
True
and
is_distributed
is
False
w
=
helper
.
create_parameter
(
w
=
helper
.
create_parameter
(
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录