提交 87e4edd2 编写于 作者: Q Qiao Longfei

fix grad_varname in remote prefetch

上级 d98c59fd
...@@ -49,14 +49,14 @@ class LookupTableKernel : public framework::OpKernel<T> { ...@@ -49,14 +49,14 @@ class LookupTableKernel : public framework::OpKernel<T> {
auto id_name = context.Inputs("Ids").front(); auto id_name = context.Inputs("Ids").front();
auto out_name = context.Outputs("Out").front(); auto out_name = context.Outputs("Out").front();
auto table_name = context.Inputs("W").front();
// 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 (remote_prefetch) { if (!height_sections.empty()) {
// if emap is not empty, then the parameter will be fetched from remote // if emap is not empty, then the parameter will be fetched from remote
// parameter // parameter
// server // server
......
...@@ -369,7 +369,7 @@ class DistributeTranspiler(object): ...@@ -369,7 +369,7 @@ class DistributeTranspiler(object):
program.global_block(), splited_grad_varname, reverse=True) program.global_block(), splited_grad_varname, reverse=True)
if splited_vars[0].type == core.VarDesc.VarType.SELECTED_ROWS: if splited_vars[0].type == core.VarDesc.VarType.SELECTED_ROWS:
sparse_param_name = self.grad_name_to_param_name[ sparse_param_name = self.grad_name_to_param_name[
splited_grad_varname] grad_varname]
if self._is_input_of_remote_sparse_update_op( if self._is_input_of_remote_sparse_update_op(
sparse_param_name): sparse_param_name):
self.sparse_param_to_height_sections[ self.sparse_param_to_height_sections[
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册