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

【Hackathon No57】 add fp16 & bf16 for flip, fp16 for gaussian #52380

Merged
merged 4 commits into from
Apr 10, 2023

Conversation

Difers
Copy link
Contributor

@Difers Difers commented Mar 30, 2023

PR types

Others

PR changes

APIs

Describe

gaussian, 完善FP16单测,确认误差阈值设置是否合理
flip, 增加BF16支持,完善FP16, BF16单测

@paddle-bot
Copy link

paddle-bot bot commented Mar 30, 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.

@@ -74,9 +74,21 @@ def setUp(self):
self.op_type = 'flip'
self.python_api = paddle.tensor.flip
self.init_test_case()
self.inputs = {'X': np.random.random(self.in_shape).astype('float64')}
self.input = np.random.random(self.in_shape).astype(self.dtype)
Copy link
Contributor

Choose a reason for hiding this comment

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

在使用self.dtype之前没有调用init_dtype函数

self.inputs = {'X': self.input.astype(self.dtype)}
output = output.astype(self.dtype)

self.outputs = {'Out': output}
Copy link
Contributor

Choose a reason for hiding this comment

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

BF16的情况下,outputs部分应当也是用convert_float_to_uint16做类型转换

@Vvsmile
Copy link
Contributor

Vvsmile commented Apr 3, 2023

修改好PR描述后可以重新Close-reopen 一下该PR,让他通过一下CheckPRTemplate 检测

@Difers Difers force-pushed the add_fp_bf_4_flip_gaussian branch from 3a15ca4 to cab8b6b Compare April 3, 2023 15:10
@Difers Difers force-pushed the add_fp_bf_4_flip_gaussian branch from cab8b6b to 9e10224 Compare April 4, 2023 04:57
@Difers
Copy link
Contributor Author

Difers commented Apr 5, 2023

done,辛苦再review下~

@Vvsmile
Copy link
Contributor

Vvsmile commented Apr 6, 2023

LGTM

self.init_attrs()
self.outputs = {'Out': self.calc_ref_res()}
self.init_dtype()
self.input = np.random.random(self.in_shape).astype(self.dtype)
Copy link
Contributor

@ZzSean ZzSean Apr 6, 2023

Choose a reason for hiding this comment

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

当dtype==np.uint16时候self.dtype需要改成np.float32,可以与下面类似,搞个分支判断

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,,辛苦再review下~

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

@luotao1 luotao1 merged commit 2b0fffc into PaddlePaddle:develop Apr 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contributor External developers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants