-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
feature/parallel_do #6730
feature/parallel_do #6730
Conversation
paddle/framework/lod_tensor.h
Outdated
@@ -144,6 +144,9 @@ class LoDTensor : public Tensor { | |||
*/ | |||
void ShrinkInLevel(size_t level, size_t elem_begin, size_t elem_end); | |||
|
|||
void MergeLoDTensor(const std::vector<const LoDTensor*>& lod_tensors, |
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.
Do we need to add comments about this function?
} else if (var->IsType<SelectedRows>()) { | ||
t = &(var->Get<SelectedRows>().value()); | ||
} else { | ||
PADDLE_THROW("Variable type must be LoDTensor/SelectedRows."); | ||
PADDLE_THROW("Variable type_id %s, expect LoDTensor/SelectedRows.", |
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.
expect LoDTensor/SelectedRows => expect LoDTensor/SelectedRows/Tensor?
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.
This is a leftover from debugging. Sorry for the confusion.
} else if (var->IsType<SelectedRows>()) { | ||
t = var->GetMutable<SelectedRows>()->mutable_value(); | ||
} else { | ||
PADDLE_THROW("Variable type must be LoDTensor/SelectedRows."); | ||
PADDLE_THROW("Variable type_id %s, expect LoDTensor/SelectedRows.", |
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.
expect LoDTensor/SelectedRows => expect LoDTensor/SelectedRows/Tensor?
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.
This is a leftover from debugging. Sorry for the confusion.
} else if (var->IsType<SelectedRows>()) { | ||
return var->Get<SelectedRows>().GetCompleteDims(); | ||
} else { | ||
PADDLE_THROW("Variable type must be LoDTensor/SelectedRows."); | ||
PADDLE_THROW("Variable %s type_id %s, expect LoDTensor/SelectedRows.", |
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.
Same as above.
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.
This is a leftover from debugging. Sorry for the confusion.
} else if (var->IsType<SelectedRows>()) { | ||
var->GetMutable<SelectedRows>()->set_height(dim[0]); | ||
} else { | ||
PADDLE_THROW("Variable type must be LoDTensor/SelectedRows."); | ||
PADDLE_THROW("Variable %s type_id %s, expect LoDTensor/SelectedRows.", |
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.
Same as above.
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.
This is a leftover from debugging. Sorry for the confusion.
paddle/framework/operator.cc
Outdated
@@ -179,10 +179,13 @@ static const Tensor* GetTensorFromVar(const Variable* var) { | |||
const Tensor* t = nullptr; | |||
if (var->IsType<LoDTensor>()) { | |||
t = &(var->Get<LoDTensor>()); | |||
} else if (var->IsType<Tensor>()) { |
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.
A little confused about it: do the ParallelDo operator need it?
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.
This is a leftover from debugging. Sorry for the confusion.
paddle/operators/parallel_do_op.cc
Outdated
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. */ |
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.
The license format is not correct, please refer to #7022
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.
done.
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.
Just merge it.
Following PRs will fix this PR's problems:
fix #6637
depends on: #6728