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

Reduce inference library size and compile time #53193

Merged
merged 4 commits into from
Apr 25, 2023

Conversation

chalsliu
Copy link
Contributor

@chalsliu chalsliu commented Apr 21, 2023

PR types

Others

PR changes

Others

Description

Reduce inference library size and compile time.

@paddle-bot
Copy link

paddle-bot bot commented Apr 21, 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 contributor External developers status: proposed labels Apr 21, 2023
@paddle-bot
Copy link

paddle-bot bot commented Apr 21, 2023

❌ The PR is not created using PR's template. You can refer to this Demo.
Please use PR's template, it helps save our maintainers' time so that more developers get helped.

@chalsliu chalsliu changed the title Reduce inference library size and compilation time Reduce inference library size and compile time Apr 23, 2023
Copy link
Contributor

@jiweibo jiweibo left a comment

Choose a reason for hiding this comment

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

LGTM

@chalsliu
Copy link
Contributor Author

使用方式:

1、编译前执行:python tools/remove_grad_op_and_kernel.py --only_kernel
2、cmake 参数加上: -DREDUCE_INFERENCE_LIB_SIZE=ON

@qingqing01 qingqing01 merged commit ac01ddd into PaddlePaddle:release/2.5 Apr 25, 2023
@chalsliu
Copy link
Contributor Author

chalsliu commented Apr 26, 2023

效果:

  1. with third_party pre-compiled
  2. 90并发编译

whl_so_SIZE -> size of libpaddle.so
infer_so_SIZE -> size of libpaddle_inference.so

REDUCE WITH_PYTHON STRIP ARCH_NUM whl_so_SIZE infer_so_SIZE
OFF ON ON 2 (sm_80 sm_86) 960M 924M
ON ON ON 2 (sm_80 sm_86) 678M
(-282M)
643M
(-281M)
OFF OFF ON 2 (sm_80 sm_86) NA 922M
ON OFF ON 2 (sm_80 sm_86) NA 639M
(-283M)
OFF ON ON 5 (sm_61 sm_70 sm_75 sm_80 sm_86) 2.0G 2.0G
ON ON ON 5 (sm_61 sm_70 sm_75 sm_80 sm_86) 1.4G
(-613M)
1.4G
(-613M)

@luotao1
Copy link
Contributor

luotao1 commented May 4, 2023

@qingqing01 @chalsliu @jiweibo 请问 tools/infer_prune_patches/ 还需要维护么?

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.

None yet

4 participants