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.45】为 Paddle logical 算子实现 float16 数据类型支持 #50926

Merged
merged 4 commits into from
Mar 23, 2023

Conversation

denglianbin
Copy link
Contributor

PR types

Others

PR changes

Others

Describe

性能数据(op benchmark)

op shape_x shape_y fp32 fp16
logical_and 16, 3, 224, 224 16, 3, 224, 224 0.045765419 0.033781723
  16, 102400 16, 102400 0.036889436 0.028767634
  128, 128 128, 128 0.017890638 0.017675818
logical_or 16, 3, 224, 224 16, 3, 224, 224 0.045839135 0.033784886
  16, 102400 16, 102400 0.037104986 0.028587117
  128, 128 128, 128 0.017838575 0.017863147
logical_xor 16, 3, 224, 224 16, 3, 224, 224 0.045718952 0.03373039
  16, 102400 16, 102400 0.036929578 0.028795612
  128, 128 128, 128 0.01771596 0.017614511
logical_not 16, 3, 224, 224 none 0.036817181 0.030557233
  16, 102400 none 0.031756382 0.02452792
  128, 128 none 0.022468275 0.022301382

@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
All committers have signed the CLA.

@paddle-bot paddle-bot bot added contributor External developers status: proposed labels Feb 26, 2023
@denglianbin denglianbin changed the title 【Hackathon No.45】为 Paddle lerp 算子实现 float16 数据类型支持 【Hackathon No.45】为 Paddle logical 算子实现 float16 数据类型支持 Feb 26, 2023
@@ -213,6 +215,7 @@ def type_map_factory():
]


@unittest.skipIf(core.is_compiled_with_cuda(), "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.

这里本身是CPU的test,不需要加这个装饰器。
CPU上不支持FP16,所以可能需要修改调用的函数,当测试place为CPU且dtype为float16时,跳过后续执行的过程

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

@luotao1
Copy link
Contributor

luotao1 commented Mar 9, 2023

@denglianbin 请解决下多个流水线失败的问题,如 PR-CI-Mac-Python3 流水线,test_logical_op (Failed)

@denglianbin
Copy link
Contributor Author

pass.jpg
@zhangting2020 老师您好,能帮忙判断下或者给些排查的建议为什么ci中会出现找不到kernel的情况吗?本地测试都是没有问题的

if use_gpu and (
type_str_map['x'] == np.float16 or type_str_map['y'] == np.float16
):
continue
Copy link
Contributor

Choose a reason for hiding this comment

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

这里是不是有点问题?如果是gpu,并且输入是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.

您好,这里逻辑应该是没有问题的。这个函数为test_type_error,原本未为gpu注册FP16数据类型时,函数内应该拦截FP16的错误。注册FP16类型后,如果use gpu && input tpye == FP16,应该跳过函数执行。

@zhangting2020
Copy link
Contributor

pass.jpg @zhangting2020 老师您好,能帮忙判断下或者给些排查的建议为什么ci中会出现找不到kernel的情况吗?本地测试都是没有问题的

CI提示了具体的报错内容,run_static运行出错。fp16只支持GPU,如果单测运行在CPU上,就会找不到kernel。
image

@denglianbin
Copy link
Contributor Author

@zhangting2020 老师您好,CI问题已经解决,另外这是更新中文文档的pr:https://github.com/PaddlePaddle/docs/pull/5739。

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 luotao1 merged commit 0480ff5 into PaddlePaddle:develop Mar 23, 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.

6 participants