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

[Phi] Remove needless deps in unittests #40256

Merged

Conversation

chenwhql
Copy link
Contributor

@chenwhql chenwhql commented Mar 8, 2022

PR types

Function optimization

PR changes

Others

Describe

[Phi] Remove needless deps in unittests

#include "paddle/phi/kernels/declarations.h"

这里declarations.h头文件包含所有phi kernel的实现文件中的符号导出所需要的符号声明,include这个头文件会导致编译对象带有全部phi kernel的实现

由于 phi/api/lib/api.cc include了declarations.h,间接导致 phi/tests/api 目录下的单测、fluid/eager/tests 目录下新动态图的单测、以及使用了具体op的其他单测,在编译时都依赖了phi的全部kernel,这导致的随着phi kernel迁移数目的增多,这数十个单测编译体积会逐渐增大,本PR移除这一依赖。

在coverage CI编译前后的相关目录体积对比如下:

本PR前build整体目录大小:

image

本PR后build整体目录大小:

image

后续需要特别注意#include "paddle/phi/kernels/declarations.h"的使用!!!

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

@chenwhql chenwhql merged commit 89ed57e into PaddlePaddle:develop Mar 11, 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.

4 participants