-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
[AMP OP&Test] Append bf16/fp16 support 4 elementwise_max #51151
Conversation
你的PR提交成功,感谢你对开源项目的贡献! |
@@ -120,9 +120,13 @@ def test_check_output(self): | |||
|
|||
def test_check_grad_normal(self): | |||
if hasattr(self, 'attrs'): | |||
self.check_grad(['X', 'Y'], 'Out', check_eager=False) | |||
self.check_grad( | |||
['X', 'Y'], 'Out', numeric_grad_delta=0.01, check_eager=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.
为什么要指定numeric_grad_delta
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.
不指定数值解错误
) | ||
|
||
|
||
class TestElementwiseFP16Op(TestElementwiseOp): |
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.
改一下类名,用TestElementwiseMaxFP16Op代替
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.
done
@@ -131,6 +178,53 @@ def test_check_grad_ingore_y(self): | |||
self.check_grad(['X'], 'Out', no_grad_set=set('Y')) | |||
|
|||
|
|||
class TestElementwiseMaxBF16Op_ZeroDim1(TestElementwiseBF16Op): | |||
def setUp(self): |
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.
很多子类的setUp都复用了基类的一些代码,建议不同点用init_data等函数单独提取出来,减少重复代码
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.
done
PR的Describe里面请多补充FP16/BF16/API Check已在其他PR中完成,以及不同于规范的点及原因,如FP16中max_relative_error=0.005及BF16中delta=0.05 |
|
LGTM |
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
New features
PR changes
Others
Describe