-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
[XPU] Support several ops on precision of fp16. #10025
Conversation
Thanks for your contribution! |
3393166
to
ef102db
Compare
ef102db
to
bf20323
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
新增算子至少要有fp32的单测
04890ed
to
ec4217d
Compare
已添加相关新算子的测例,并解决float16类型未定义的编译报错问题。@zhupengyang |
ec4217d
to
e536ad9
Compare
e536ad9
to
20f88c2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
剩下的小问题后面的PR改下
using xpu_calib_fp32_to_fp16_kfp16 = | ||
paddle::lite::kernels::xpu::CalibCompute<float, float16, PRECISION(kFP16)>; | ||
using xpu_calib_fp16_to_fp32_kfp16 = | ||
paddle::lite::kernels::xpu::CalibCompute<float16, float, PRECISION(kFP16)>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
命名改下
xpu_calib_fp32_to_fp16
xpu_calib_fp16_to_fp32
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个等业务侧模型验证之后再改吧。
#elif defined(LITE_WITH_XPU) | ||
place = TARGET(kXPU); | ||
alias = "silu_fp32"; | ||
abs_error = 2e-4; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
放到 LITE_WITH_ARM 前面一行
#elif defined(LITE_WITH_XPU) | ||
Place place(TARGET(kXPU), PRECISION(kFloat)); | ||
test_sin(place); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
同上
#elif defined(LITE_WITH_XPU) | ||
Place place(TARGET(kXPU), PRECISION(kFloat)); | ||
test_sin(place); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
同上
PR devices
XPU
PR types
New features
PR changes
OP
Description
Add silu/sin/cos/slice ops for fp16 precision on XPU backend.