-
Notifications
You must be signed in to change notification settings - Fork 3k
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
[NPU] ernie-1.0 support npu device #3954
Conversation
Thanks for your contribution! |
Codecov Report
@@ Coverage Diff @@
## develop #3954 +/- ##
===========================================
+ Coverage 33.00% 36.36% +3.36%
===========================================
Files 400 419 +19
Lines 56414 59184 +2770
===========================================
+ Hits 18619 21522 +2903
+ Misses 37795 37662 -133
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
@@ -540,6 +546,7 @@ def do_train(args): | |||
"softmax", | |||
"layer_norm", | |||
"gelu", | |||
"dropout", |
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.
额,这个 dropout 有必要吗?
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.
可以让dropout npu op中的Cast CANN op从AICPU算子变成AICore算子,提升性能。
model_zoo/ernie-1.0/run_pretrain.py
Outdated
@@ -600,7 +607,7 @@ def do_train(args): | |||
else: | |||
optimizer.step() | |||
|
|||
optimizer.clear_grad() | |||
optimizer.clear_grad(set_to_zero=False) |
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.
why?
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.
在NPU上执行时,设置set_to_zero=False可以提升性能。加了npu设备的判断条件。
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
Others
PR changes
Others
Description
为ernie-1.0模型添加NPU设备支持。