- 
                Notifications
    You must be signed in to change notification settings 
- Fork 5.9k
[CMake]Optimize the dependency of PIR module and Unittest #60066
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
[CMake]Optimize the dependency of PIR module and Unittest #60066
Conversation
| 你的PR提交成功,感谢你对开源项目的贡献! | 
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,great job
| set(PYBIND_DEPS ${PYBIND_DEPS} pir) | ||
| endif() | ||
|  | ||
| if(WITH_CUSTOM_DEVICE) | 
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.
windows pir是静态库,有没有统计下,windows,libpaddle.dll增大多少,whl包增大有多少。可能因为whl包体积会影响发版本。最好是把pir打通windows场景下编译动态库方式
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.
预计会增加20M,最优解法是将pir变成动态库,但当前pir变成动态库难度及遇到的困难都未知,当前windows的cmake治理已经成为项目正常推进中的阻塞点,为了能够尽快推进项目顺利开发,减少开发过程中遇到的windows编译链接问题,这里采用次优解法将pir打入paddle.dll中。后续需要专项解决pir变成动态库的工作
| op_dialect_vjp | ||
| pir | ||
| gtest) | ||
| paddle_test(shape_op_test SRCS shape_op_test.cc DEPS gtest) | 
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.
这个gtest应该也是不需要的
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修改:#59790
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,very great work!
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
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 types
Others
PR changes
Others
Description
Pcard-67164
背景:
cmake代码治理不够彻底,依然存在大量的动静态库混链的问题,在单测模块尤为严重。在这样的条件下,尤其是windows环境下,跨模块使用静态变量的时候存在各种符号链接问题,同时也存在运行时问题。
本PR针对cmake做了一些优化工作:
1,在pir编译静态库的场景下,将符号全部打入paddle.so中,减少动静态库混链产生的全局单例失效问题。
2,优化windows下模块的符号暴露,pir模块内统一规范使用IR_API来暴露,pir模块外统一使用TEST_API来暴露,减少动静态库混链产生的符号未定义以及重定义问题。
3,暴露多处PIR模块隐藏的C++代码语法问题,解决windows下vs系列编译器无法识别 / 处理 PIR模块的一些语言特性及代码写法漏洞
4,phi算子库模块头文件引用优化,解耦Fluid头文件
5,优化单测模块依赖,减少动静态库混链写法