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 phi kernels to 2(host/device) static libraries directly #43247

Merged
merged 9 commits into from
Jun 10, 2022

Conversation

zhiqiu
Copy link
Contributor

@zhiqiu zhiqiu commented Jun 6, 2022

PR types

Others

PR changes

Others

Describe

make all phi kernels to 2(host/device) static libraries directly, it can reduce about 3min of total compilation time.

  • before
    each kernel is compiled to a static library
    image
  • after
    all kernels are compiled to 2 static libraries (libphi_cpu.a and libphi_gpu.a)
    image

why

Consider A kernel uses B in its implementation, if each kernel is compiled to a static library, then libA depends on libB, and thus A is compiled after B, which may result in low concurrency in parellel compilation.

For example, in the following timeline, the matrix_rank_tol_kernel is compiled after reduce_sum_kernel since it reuse reduce_sum and other kernels. It is the last phi kernel compiled and only one thread(process) is being executed at that time even if the command is make -j24.

image

after this pr, matrix_rank_tol_kernel can overlap with others.
image

@paddle-bot-old
Copy link

paddle-bot-old bot commented Jun 6, 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 merged commit 5781999 into PaddlePaddle:develop Jun 10, 2022
@zhiqiu zhiqiu mentioned this pull request Jun 14, 2022
@zhiqiu zhiqiu mentioned this pull request Jul 13, 2022
@zhiqiu zhiqiu mentioned this pull request Dec 29, 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

2 participants