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 No.47】为 Paddle cross 算子实现 float16 数据类型支持 #50924

Merged
merged 4 commits into from
Mar 14, 2023

Conversation

denglianbin
Copy link
Contributor

@denglianbin denglianbin commented Feb 26, 2023

PR types

Others

PR changes

Others

Describe

性能数据(op benchmark)

shape axis fp32 fp16
2048, 3 1 0.119930141 0.119697561
16, 3, 20480 1 0.136250866 0.124568842
16, 20, 3, 40, 50 2 0.164437537 0.140431219

@paddle-bot
Copy link

paddle-bot bot commented Feb 26, 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.

@CLAassistant
Copy link

CLAassistant commented Feb 26, 2023

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.

✅ denglianbin
❌ Zhang Ting


Zhang Ting seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@zhangting2020
Copy link
Contributor

  • 请为python api的静态图分支增加类型检查,并且添加1个静态图的单测以保证测试覆盖率可通过
  • 另外不要忘记了需要修改中英文文档

可以参考#51168

@@ -65,6 +65,21 @@ def init_output(self):
self.outputs = {'Out': np.array(z_list).reshape(self.shape)}


class TestCrossOpCase2(TestCrossOp):
def initTestCase(self):
Copy link
Contributor

Choose a reason for hiding this comment

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

需要参考低精度单测规范修改单测命名,TestCrossOpCase2 -> TestCrossFP16Op
https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/dev_guides/amp_precision/amp_test_dev_guide_cn.html#optest

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.outputs = {'Out': np.array(z_list).reshape(self.shape)}

def test_check_output(self):
self.check_output(atol=1e-3, check_eager=True)
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可以删掉,因为OpTest内部对fp16类型的阈值设置默认是1e-3。这里不需要为FP16实现这个方法

Copy link
Contributor Author

Choose a reason for hiding this comment

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

老师,这里如果不设置atol=1e-3那么测试就会失败,设置后才能测试通过。不确定是不是内部对cross这个op单独设置了阈值。

Copy link
Contributor

Choose a reason for hiding this comment

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

这个阈值大概也是近期刚刚默认加入的,是不是你开发环境的代码没有合入paddle的dev的内容,所以导致无法通过,我先在PR中删除,重新跑CI看看

@denglianbin
Copy link
Contributor Author

@zhangting2020 这是中文文档pr:PaddlePaddle/docs#5708

Copy link
Contributor

@zhangting2020 zhangting2020 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
Copy link
Contributor

luotao1 commented Mar 13, 2023

请根据 PR-CI-Codestyle-Check 流水线提示修改下代码风格

@luotao1 luotao1 merged commit 871d2d3 into PaddlePaddle:develop Mar 14, 2023
@luotao1
Copy link
Contributor

luotao1 commented Mar 14, 2023

hi, @denglianbin

  • 非常感谢你对飞桨框架的贡献,我们正在运营一个PFCC组织,会通过定期分享技术知识与发布开发者主导任务的形式持续为飞桨框架做贡献,详情可见 https://github.com/luotao1 主页说明。
  • 如果你对PFCC有兴趣,请发送邮件至 [email protected],我们会邀请你加入~

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.

6 participants