-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Add merge_ids_op #11342
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add merge_ids_op #11342
Conversation
… add-merge-splited-ids
… add-merge-splited-ids
@@ -330,8 +330,12 @@ void Executor::RunPreparedContext(ExecutorPrepareContext* ctx, Scope* scope, | |||
} | |||
|
|||
for (auto& op : ctx->ops_) { | |||
VLOG(3) << place_ << " " << op->DebugStringEx(local_scope); | |||
VLOG(4) << place_ << " " << op->DebugStringEx(local_scope); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we keep the log level before op run
and after?
AddComment(R"DOC( | ||
Merge multi LoDTensor's into one according to Ids's shard num. | ||
The values in the input LoDTensor are lookuped from the output of split_ids_op | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about adding some comments to explain why X0 is mapped to index 3 and 6.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated
// copy data from ins[shard_num] to out. | ||
for (int i = 0; i < ids_dims[0]; ++i) { | ||
int64_t id = ids[i]; | ||
size_t shard_id = static_cast<size_t>(id) % shard_num; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hash method is currently hardcoded, just a message for notice.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, will be an independent module in the future.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
project: #10868
dist lookup table返回的结果需要merge在一起,之前用的concat是不对的,会打乱结果的顺序,merge_ids参考原始Id的顺序才能把结果正确的merge在一起,同时也把lod信息拷贝给merge的结果。