-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
[Recompute] Support ernie for dygraph recompute. #2849
Conversation
@@ -351,6 +351,7 @@ def main(): | |||
model_config[ | |||
"attention_probs_dropout_prob"] = model_args.attention_probs_dropout_prob | |||
model = model_class(base_class(**model_config)) | |||
# model_config["enable_recompute"] = args.use_recompute |
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.
需要改造 trainer 中 DP 的 fused_allreduce_gradients 方式。
这块后续需要分布式优化一下体验。
else: | ||
loss.backward() | ||
|
||
fused_allreduce_gradients(list(model.parameters()), None) |
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.
这里 recompute 基于 PyLayer,所以要手动 fused_allreduce_gradients
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.
LGTM
PR types
Function optimization
PR changes
Others
Description
Support ernie for dygraph recompute.