Skip to content
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

Merged
merged 4 commits into from
Mar 30, 2023

Conversation

liuzhenhai93
Copy link
Contributor

@liuzhenhai93 liuzhenhai93 commented Mar 29, 2023

PR types

Performance optimization

PR changes

OPs

Describe

Arg min max bf16 test

@paddle-bot
Copy link

paddle-bot bot commented Mar 29, 2023

你的PR提交成功,感谢你对开源项目的贡献!
请关注后续CI自动化测试结果,详情请参考Paddle-CI手册
Your PR has been submitted. Thanks for your contribution!
Please wait for the result of CI firstly. See Paddle CI Manual for details.

wanghuancoder
wanghuancoder previously approved these changes Mar 29, 2023
Copy link
Contributor

@wanghuancoder wanghuancoder left a 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):
Copy link
Contributor

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):
Copy link
Contributor

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

Copy link
Contributor Author

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)}
Copy link
Contributor

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进行转换

Copy link
Contributor Author

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):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

类名按照规范从BFP16TestCase1修改为TestArgMinBF16OP

@Vvsmile
Copy link
Contributor

Vvsmile commented Mar 29, 2023

确定一下API Check Dtype任务是否完成

@liuzhenhai93
Copy link
Contributor Author

done

Copy link
Contributor

@ZzSean ZzSean left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ZzSean ZzSean merged commit 3161e6c into PaddlePaddle:develop Mar 30, 2023
@liuzhenhai93 liuzhenhai93 deleted the arg_min_max_test branch March 30, 2023 02:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants