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

[OpenCL]remove process_type to fix FP16 result error #10451

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

engineer1109
Copy link
Contributor

PR devices

OpenCL

PR types

Bug fixes

PR changes

OP

Description

之前离职员工tiantian留下的BUG。
对于某些特殊模型,会设置process_type为2, 禁止io_copy的FP16模式(触发机制和意义不明,会导致yolov5_s等推理结果出错)
导致FP16的Tensor,被当成FP32使用。精度混乱。

这里删除了 param.process_type != 2的判定条件。
强制在FP16模式,使用FP16的逻辑处理。

Copy link

paddle-bot bot commented Feb 26, 2024

Thanks for your contribution!

@engineer1109
Copy link
Contributor Author

yolov5_s复现模型 链接: https://pan.baidu.com/s/1xfv8A0LXm-6-Yk0wyq5sEA?pwd=tvbe 提取码: tvbe

@engineer1109
Copy link
Contributor Author

@hong19860320 CI已经年久失修了,连git clone的能力都没有

@hong19860320
Copy link
Collaborator

hong19860320 commented Feb 26, 2024

@hong19860320 CI已经年久失修了,连git clone的能力都没有

已经正在修了,git clone 失败是代理问题。

@hong19860320
Copy link
Collaborator

hong19860320 commented Feb 26, 2024

@engineer1109 从之前 tiantian 提的 PR 来看 #9688 ,可能是为了解决自定义 CPU GPU 异构时,在 h2d 过程中可以同步实现 fp32->fp16 的转换,可能实现考虑的不全。
@Travis-Lee 看下这个PR吧,基于提供的模型看下是否可以复现这个问题,然后结合 @engineer1109 的修复方案,看下是否有影响最小的解决方案。

@sprouteer
Copy link
Collaborator

空闲时间回忆了下当初的实现思路,大致如下,如#9688 所描述,为了支持更多的模型,支持cpu, opencl image2d, opencl buffer 混合layout,混合精度推理,可配置算子后端信息等,对iocopy, layout 等算子和pass做出了修改。对于yolo模型,之前未进行适配,可能存在精度问题,需进一步check
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants