-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Add xpu2 compiler #37254
Add xpu2 compiler #37254
Conversation
Thanks for your contribution! |
ea413a5
to
8a9cdad
Compare
Sorry to inform you that d473766's CIs have passed for more than 7 days. To prevent PR conflicts, you need to re-run all CIs manually. |
Sorry to inform you that bdaa02c's CIs have passed for more than 7 days. To prevent PR conflicts, you need to re-run all CIs manually. |
b55d391
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 for operator.h
PR types
New features
PR changes
Others
Describe
This PR adds the source code compilation mode of XPU2, and the compilation commands are as follows:
Its realization mainly involves the following aspects:
1. Support source code compilation mode of XPU2 code:
Mainly related to the modification of cmake, the main files involved are: cmake/generic.cmake cmake/operators.cmake cmake/xpu_kp.cmake
The specific calling process is as follows:
2. Compatible operator mapping mode and source code compilation mode
After adding the source code compilation mode, there are two XPU kernels for the same OP.
In order to be compatible with the two modes, three aspects of work have been done.
Added a new library_type to distinguish the original mode.
The main files involved are: paddle/fluid/framework/library_type.h
In order to dynamically select the kernel at runtime, the flag and the list involved in the KP mode are added.
The main files involved are: paddle/fluid/platform/flags.cc paddle/fluid/platform/device/xpu/xpu_op_kpfirst_list.h paddle/fluid/platform/device/xpu/xpu_op_list.cc
Increase specific runtime control methods
The main files involved are:
paddle/fluid/framework/operator.cc (static graph)
paddle/fluid/imperative/prepared_operator.cc (dynamic graph)
The control graph of runtime is as follows: