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

fix the bug of int8 trt infer #58672

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

Wanglongzhi2001
Copy link
Contributor

@Wanglongzhi2001 Wanglongzhi2001 commented Nov 3, 2023

PR types

Bug fixes

PR changes

Others

Description

在 PaddleSlim PTQ量化后导出的模型在进行 Paddle Inference 的 int8 推理的时候会报如下所示的错误:
image

错误原因:

在运行 trt_delete_weight_dequant_linear_op_pass 时,dequant_linear OP 里面的 weight 是 float32 类型的但是存的是 int8 的值,所以这里直接把 float32 的指针转成 int8 类型会导致这样的错误。

复现步骤:

download 我的这个 repo :https://github.com/Wanglongzhi2001/repo-for-reproduction
运行 custom_infer 文件夹里的 infer.py 进行推理,代码是 paddle-inference-demo 里的示例

量化后的模型提供在这个链接 (pdiparams文件太大了,github 上传不了),是运行 repo 里的 ptq_alexnet.py 文件夹而来,想要复现的话得自行配置好数据集,不想的话就直接用我提供的,代码参考自 PaddleSlim 的示例

Copy link

paddle-bot bot commented Nov 3, 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 the contributor External developers label Nov 3, 2023
@Wanglongzhi2001
Copy link
Contributor Author

fix #58674

Copy link

paddle-ci-bot bot commented Nov 11, 2023

Sorry to inform you that 8507390's CIs have passed for more than 7 days. To prevent PR conflicts, you need to re-run all CIs manually.

Copy link

paddle-ci-bot bot commented Nov 30, 2023

Sorry to inform you that 0e1bb0c's CIs have passed for more than 7 days. To prevent PR conflicts, you need to re-run all CIs manually.

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.

1 participant