-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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] Add bfloat16 Support for elementwise_pow
Op
#51888
Conversation
@@ -310,9 +311,9 @@ def setUp(self): | |||
|
|||
def test_check_output(self): | |||
if hasattr(self, 'attrs'): | |||
self.check_output(check_eager=False) | |||
self.check_output(check_eager=False, atol=1e-3) |
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.
这里默认值可以不显式设置
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
@@ -323,6 +324,34 @@ def test_check_grad(self): | |||
), | |||
check_eager=True, | |||
check_prim=True, | |||
max_relative_error=1e-2, |
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.
这个不设置会报错吗?之前应该是能过的?
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.
不会报错,已移除
|
||
def test_check_grad(self): | ||
self.check_grad( | ||
['X', 'Y'], 'Out', check_eager=True, max_relative_error=1e-2 |
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.
max_relative_error默认值可以不设置
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
|
||
def test_check_output(self): | ||
if hasattr(self, 'attrs'): | ||
self.check_output(check_eager=False, atol=0.01) |
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.
atol默认值可以不设置
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
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
Performance optimization
PR changes
OPs
Describe
Add bfloat16 support (on CPU, GPU, and XPU devices) for the
elementwise_pow
operator. The unittest cases get updated, too.