Skip to content
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

Split byref op #9956

Merged
merged 11 commits into from
Apr 18, 2018
Merged

Split byref op #9956

merged 11 commits into from
Apr 18, 2018

Conversation

typhoonzero
Copy link
Contributor

@typhoonzero typhoonzero commented Apr 16, 2018

Resolves #9675

Split tensors using shared data to reduce copying when doing distributed training. Currently split by axis0 is supported only.

@typhoonzero typhoonzero changed the title Split byref op [WIP] Split byref op Apr 16, 2018
@typhoonzero typhoonzero changed the title [WIP] Split byref op Split byref op Apr 17, 2018
@@ -162,6 +162,37 @@ inline Tensor& Tensor::ShareDataWith(const Tensor& src) {
return *this;
}

inline Tensor& Tensor::ShareDataWith(const Tensor* src, size_t offset) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use Tensor::Slice instead of this new function?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@@ -176,6 +176,34 @@ class Tensor {
std::type_index type_;
};

template <typename Place>
struct SharedPlaceholderImpl : public Placeholder {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please delete the unused function.

Copy link
Contributor

@Yancey1989 Yancey1989 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@typhoonzero typhoonzero merged commit d655417 into PaddlePaddle:develop Apr 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants