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

make all cpp tests dynamic linked to libpaddle.so [except windows] #47088

Merged
merged 16 commits into from Oct 27, 2022

Conversation

zhiqiu
Copy link
Contributor

@zhiqiu zhiqiu commented Oct 18, 2022

PR types

Others

PR changes

Others

Describe

make all cpp tests dynamic linked to libpaddle.so
see the comments added in paddle/CMakeLists.txt for details

Why

  1. Reduce the size of each cpp test, thus reduce the whole size of paddle build directory
  2. Make it easy to write the cmake file of cpp test, i.e., do not need to consider its dependencies
  3. [TODO] Support built cpp tests separatly, with libpaddle.so provided

Result

The build directory of coverage CI decreased from 168G to 117G, 51G reduced, 30%.

PS0. There are 229 tests using dynamic link now and still some cpp tests use static link, configured using cc_test_old in CMakeLists.txt.
PS1. The dynamic library on windows encountered unresolved symbol problem, so it is not supported now.
PS2. Found some tests contains symbols that is not in libpaddle.so, it means that the code is unused. So here are some PRs to clean the related code.
#47103

@paddle-bot
Copy link

paddle-bot bot commented Oct 18, 2022

你的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.

@zhiqiu zhiqiu force-pushed the dev/cpp_test_dynamic_link branch 10 times, most recently from da6752b to 3254dfd Compare October 24, 2022 09:44
@zhiqiu zhiqiu changed the title make all cpp tests dynamic linked to libpaddle.so make all cpp tests dynamic linked to libpaddle.so [except windows] Oct 26, 2022
@zhiqiu zhiqiu force-pushed the dev/cpp_test_dynamic_link branch 3 times, most recently from 14be5aa to b087c30 Compare October 26, 2022 12:58
Copy link
Contributor

@XieYunshen XieYunshen left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@luotao1 luotao1 left a comment

Choose a reason for hiding this comment

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

LGTM for CMakeLists.txt

Copy link
Contributor

@XiaoguangHu01 XiaoguangHu01 left a comment

Choose a reason for hiding this comment

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

LGTM

@zhiqiu zhiqiu merged commit 2096448 into PaddlePaddle:develop Oct 27, 2022
zhiqiu added a commit to zhiqiu/Paddle that referenced this pull request Nov 3, 2022
…addlePaddle#47088)

* make all cpp tests dynamic linked to libpaddle.so

* add comments

* keep old cc_test for some tests

* fix some ut

* make some ut use cc_test_old

* fix typos and fit for win32

* fix lib path

* fix some tests

* skip lite test

* fit for rocm

* fit for cinn

* fit for mac

* fit for win32

* skip inference ut

* skip  windows

* fix coverage
@zhiqiu zhiqiu mentioned this pull request Nov 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants