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

[fleet_executor] Add sync method #37167

Merged
merged 20 commits into from
Nov 16, 2021
Merged

Conversation

FeixLiu
Copy link
Contributor

@FeixLiu FeixLiu commented Nov 13, 2021

PR types

Others

PR changes

Others

Describe

Add sync method.

If Carrier receives messages during creating interceptors, it may encounter a situation where the target interceptor has not been initialized, then it will fall into a RunTime error (dst interceptor was not found). To avoid this happen, we add a new flag creating_interceptors which indicating all interceptors all still under initialization.

For now, if Carrier receives messages during creating interceptors, it will first push those messages into a tmp vector. After creating all interceptors, the Carrier will handle all messages in the vector.

Three usages:

No. 1

User provides an init config, and won't set new interceptors later.
No extra codes are needed.

No. 2

User doesn't provide an init config, and will set interceptors later by calling SetInterceptor.
After adding all interceptors, method SetCreatingFlag(false) needs to be called.

No. 3

User provides an init config, and will set more interceptors later by calling SetInterceptor.
Before adding new interceptors, method SetCreatingFlag(true) needs to be called.
After adding all interceptors, method SetCreatingFlag(false) needs to be called.

@paddle-bot-old
Copy link

Thanks for your contribution!
Please wait for the result of CI firstly. See Paddle CI Manual for details.

@FeixLiu FeixLiu changed the title [fleet_esxecutor] Add sync method [fleet_executor] Add sync method Nov 15, 2021
wangxicoding
wangxicoding previously approved these changes Nov 15, 2021
Copy link
Contributor

@wangxicoding wangxicoding left a comment

Choose a reason for hiding this comment

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

LGTM

paddle/fluid/distributed/fleet_executor/carrier.cc Outdated Show resolved Hide resolved
@FeixLiu FeixLiu merged commit f49c2c2 into PaddlePaddle:develop Nov 16, 2021
@FeixLiu FeixLiu deleted the add_sync_method branch November 16, 2021 00:44
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