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

Add brpc serialization support. #11430

Merged
merged 136 commits into from
Dec 14, 2018
Merged

Conversation

gongweibao
Copy link
Contributor

@gongweibao gongweibao commented Jun 13, 2018

Fix part of #10804

@gongweibao gongweibao changed the title [WIP]Add brpc serialization support. Add brpc serialization support. Jun 14, 2018
@gongweibao gongweibao requested review from typhoonzero, panyx0718 and Yancey1989 and removed request for typhoonzero and panyx0718 June 14, 2018 10:13
typhoonzero
typhoonzero previously approved these changes Dec 12, 2018
Copy link
Contributor

@typhoonzero typhoonzero left a comment

Choose a reason for hiding this comment

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

LGTM basically, but still need a way to check this through CI later.

iobuf->append(reinterpret_cast<char*>(&k), 4);
iobuf->append(reinterpret_cast<char*>(&vlen), 8);

// FIXME(gongwb): use append_zerocopy
Copy link
Contributor

Choose a reason for hiding this comment

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

why cannot use this? need brpc support?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We changed tensor memory holder, and brpc didn't support destroy userdata but only support destroy the payload data.

PADDLE_ENFORCE_NOT_NULL(payload);

// FIXME(gongwb): it seems that can use zero copy.
if (var_is_not_stable) {
Copy link
Contributor

Choose a reason for hiding this comment

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

what var_is_not_stable means?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

When a var is a temp variable, it's memory can be free out, so we can't append only a pointer but copy data.
Yuyang change it tensor data holder to sharedptr and then this not useful.I'll clean up next pr.

@CLAassistant
Copy link

CLAassistant commented Dec 13, 2018

CLA assistant check
All committers have signed the CLA.

@gongweibao gongweibao force-pushed the brpcserial branch 3 times, most recently from a6be0a7 to ddbd878 Compare December 14, 2018 02:23
test=develop
if (it != rpc_call_map.end()) {
request_send_h_ = it->second;
send_threads_.reset(new paddle::framework::ThreadPool(
rpc_server_->GetThreadNum(distributed::kRequestSend)));
Copy link
Contributor

Choose a reason for hiding this comment

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

can use FLAGS_rpc_send_thread_num etc

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The caller will use FLAGS_rpc_send_thread_num to register this property and it use the arguments.

@gongweibao gongweibao merged commit 0b1c7d8 into PaddlePaddle:develop Dec 14, 2018
@gongweibao gongweibao deleted the brpcserial branch December 14, 2018 12:01
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.

None yet