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 combine amp dgc recompute meta optimizer #27643

Merged
merged 4 commits into from
Oct 12, 2020

Conversation

wangxicoding
Copy link
Contributor

@wangxicoding wangxicoding commented Sep 27, 2020

PR types

Others

PR changes

Others

Describe

Refine amp&dgc&recompute&lars&lamb&local_sgd, make them can be an inner_opt of other meta optimizer.
Now the following strategies that can be combined:

import paddle.distributed.fleet as fleet
strategy = fleet.DistributedStrategy()

# 1. amp + recompute
strategy.amp = True
strategy.recompute = True

# 2. dgc + recompute
strategy.dgc = True
strategy.recompute = True

# 3. lars + recompute
strategy.lars = True
strategy.recompute = True

# 4. lamb + recompute
strategy.lamb = True
strategy.recompute = True

# 6. amp + localsgd
strategy.amp = True
strategy.localsgd = True

# 6. amp + adaptive_localsgd
strategy.amp = True
strategy.adaptive_localsgd = True

# 7. amp + lars
strategy.amp = True
strategy.lars = True

# 8. amp + lamb
strategy.amp = True
strategy.lamb = True

# amp + dgc still have a problem, not combine them for now.
# 9. need supply

@paddle-bot-old
Copy link

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

@wangxicoding wangxicoding force-pushed the fleet_meta_combine branch 3 times, most recently from 4d94b0a to 0e1e098 Compare September 28, 2020 04:42
ForFishes
ForFishes previously approved these changes Sep 28, 2020
Copy link
Member

@ForFishes ForFishes left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@mapingshuo mapingshuo left a comment

Choose a reason for hiding this comment

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

LGTM for recomputeOptimizer.

self.inner_opt = optimizer
self.wrapped_opt = RO(optimizer)
self.wrapped_opt = None
# we do not allow meta optimizer to be inner optimizer currently
self.meta_optimizers_white_list = [
"LarsOptimizer",
"LambOptimizer",
"GradientMergeOptimizer",
Copy link
Contributor

Choose a reason for hiding this comment

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

help remove this from the meta_optimizers_white_list of RecomputeOptimizer.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

removed

Copy link
Contributor

@mapingshuo mapingshuo left a comment

Choose a reason for hiding this comment

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

LGTM

@wangxicoding wangxicoding merged commit 0a1862d into PaddlePaddle:develop Oct 12, 2020
chen-zhiyu pushed a commit to chen-zhiyu/Paddle that referenced this pull request Oct 15, 2020
@wangxicoding wangxicoding deleted the fleet_meta_combine branch December 2, 2020 04:00
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.

3 participants