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

NO.49 为 Paddle bce_loss 算子实现 float16 数据类型支持 #51490

Closed
wants to merge 35 commits into from

Conversation

mrcangye
Copy link
Contributor

@mrcangye mrcangye commented Mar 10, 2023

PR types

New features

PR changes

OPs

Describe

任务链接:#51281
NO.49 为 Paddle bce_loss 算子实现 float16 数据类型支持

@paddle-bot
Copy link

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

@paddle-bot paddle-bot bot added contributor External developers status: proposed labels Mar 10, 2023
@mrcangye mrcangye changed the title 任务链接:#51281 NO.49 为 Paddle bce_loss 算子实现 float16 数据类型支持 NO.49 为 Paddle bce_loss 算子实现 float16 数据类型支持 Mar 10, 2023
self.shape = [10, 10]


class TestBceLossOpStaticFP16(unittest.TestCase):
Copy link
Contributor

Choose a reason for hiding this comment

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

APITest无需添加和修改

self.outputs = {'Out': output_np}

def test_check_output(self):
if fluid.core.is_compiled_with_cuda():
Copy link
Contributor

Choose a reason for hiding this comment

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

直接继承父类相关函数即可

@mrcangye
Copy link
Contributor Author

@ZzSean 政哥辛苦 review 一下

@@ -18,6 +18,8 @@
#include <vector>

#include "paddle/phi/backends/gpu/gpu_context.h"
#include "paddle/phi/common/amp_type_traits.h"
#include "paddle/phi/common/data_type.h"
Copy link
Contributor

Choose a reason for hiding this comment

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

这个头文件可以删

Copy link
Contributor Author

Choose a reason for hiding this comment

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

这个头文件可以删

#include "paddle/phi/common/data_type.h"这个?

self.outputs = {'Out': output_np}

def test_check_output(self):
self.check_output(atol=1e-3)
Copy link
Contributor

Choose a reason for hiding this comment

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

默认值无需设置

self.check_output(atol=1e-3)

def test_check_grad(self):
self.check_grad(['X'], 'Out', max_relative_error=1e-3)
Copy link
Contributor

Choose a reason for hiding this comment

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

同上

@luotao1
Copy link
Contributor

luotao1 commented Apr 17, 2023

@luotao1 luotao1 closed this Apr 17, 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.

4 participants