-
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] Arg min max bf16 test #52276
Conversation
… arg_min_max_test
你的PR提交成功,感谢你对开源项目的贡献! |
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
@unittest.skipIf( | ||
not paddle.is_compiled_with_cuda(), "BFP16 test runs only on GPU" | ||
) | ||
class BFP16TestCase0(OpTest): |
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.
单测类内部没有添加test_check_output和test_check_grad,这会导致此单测类没有真正执行测试代码
self.dims = (3, 4, 5) | ||
self.axis = 0 | ||
|
||
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.
BF16的单测的setUp中最好设置上self.dtype = np.uint16
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
self.inputs = {'X': self.x} | ||
self.attrs = {'axis': self.axis} | ||
if self.op_type == "arg_min": | ||
self.outputs = {'Out': np.argmin(x, axis=self.axis)} |
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.
self.outputs 字典中的值部分请调用convert_float_to_uint16进行转换
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.
argmin 返回的已然是 int
@unittest.skipIf( | ||
not paddle.is_compiled_with_cuda(), "BFP16 test runs only on GPU" | ||
) | ||
class BFP16TestCase0(OpTest): |
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.
类名按照规范从BFP16TestCase1修改为TestArgMinBF16OP
确定一下API Check Dtype任务是否完成 |
… arg_min_max_test
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
Arg min max bf16 test