Skip to content

Commit a90b0a2

Browse files
lixinqiXrekihxzd5568
authored
Implement abstract pass and paddle compiler collection api. (#71119)
* abstract pass initial commit * remove unused index_expr code * Fix compiling error on CI. * Change the log level. * Rename ap_lower_fusion_op_pass to ap_generic_drr_pass. * Rename ap_unary -> ap_variadic, ApUnary -> ApVariadic. * Fallback to cinn when ap fails, and disable fuse_gemm_epilogue when ap is enabled. * Fix compiling error in CI, including: using std::memcpy instead of reinterpret_cast to avoid strict-aliasing. * Fix narrowing conversion error and unused value error. * Fix missing-field-initializers and unused-result error on CI. * Fix some sign-compare error on CI. * Add cmake dependent. * Fix some using statement without creating an alias. * Support experimental/type_traits for WIN32. * Fix an unused-but-set-parameter and remove the `typename` in using statement added by previous commit. * Disable AP when cinn is not enabled. * Remove the use of Reciprocal because Reciprocal is deleted by #70376. * Fix "basic_string::_M_construct null not valid" error. * Fix typo. * Support meticulous matching (with input/outoput number). Submit by hxzd5568. * remove redundant sentence * Using void* as StreamT. * Fix compiling error related to std::optional<StreamT> on gcc12. * support no-extra-use for temporary ir value in source pattern * minor fix * minor fix * Return the address of stream instead. * support paddle.cc.* * fix adt::WeakPtrLock bug * rename all non python standard api's to __builtin__xxx * move paddle.cc into paddle.incubate.cc * Add pcc to setup.py. * Add missing modules and return partial_program_layer directly in pcc.compile. * Fix the mismatched output numerical order issue * Remove force_register_fusion related codes in pcc api. * Add an argument train. * Add pcc to setup.py. --------- Co-authored-by: Liu Yiqun <liuyiqun01@baidu.com> Co-authored-by: hxzd5568 <3257591325@qq.com>
1 parent 19b46c2 commit a90b0a2

File tree

444 files changed

+43516
-10
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

444 files changed

+43516
-10
lines changed

paddle/CMakeLists.txt

+3
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ set(PYTHON_TESTS_DIR
55
add_subdirectory(utils)
66
add_subdirectory(common)
77
add_subdirectory(pir)
8+
if(WITH_CINN)
9+
add_subdirectory(ap)
10+
endif()
811
add_subdirectory(scripts)
912
add_subdirectory(testing)
1013
add_subdirectory(phi)

paddle/ap/CMakeLists.txt

+67
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
set(AP_COMMON_DEPS absl)
2+
if(WITH_ONEDNN)
3+
list(APPEND AP_COMMON_DEPS onednn)
4+
endif()
5+
6+
file(GLOB_RECURSE axpr_srcs "src/axpr/*.cc")
7+
set(axpr_deps common)
8+
cc_library(
9+
axpr
10+
SRCS ${axpr_srcs}
11+
DEPS ${AP_COMMON_DEPS} ${axpr_deps})
12+
13+
file(GLOB_RECURSE ap_drr_srcs "src/drr/*.cc")
14+
set(ap_drr_deps axpr)
15+
cc_library(
16+
ap_drr
17+
SRCS ${ap_drr_srcs}
18+
DEPS ${AP_COMMON_DEPS} ${ap_drr_deps})
19+
20+
file(GLOB_RECURSE ap_code_module_srcs "src/code_module/*.cc")
21+
set(ap_code_module_deps axpr)
22+
cc_library(
23+
ap_code_module
24+
SRCS ${ap_code_module_srcs}
25+
DEPS ${AP_COMMON_DEPS} ${ap_code_module_deps})
26+
27+
file(GLOB_RECURSE ap_code_gen_srcs "src/code_gen/*.cc")
28+
set(ap_code_gen_deps axpr ap_code_module)
29+
cc_library(
30+
ap_code_gen
31+
SRCS ${ap_code_gen_srcs}
32+
DEPS ${AP_COMMON_DEPS} ${ap_code_gen_deps})
33+
34+
file(GLOB_RECURSE ap_kernel_dispatch_srcs "src/kernel_dispatch/*.cc")
35+
set(ap_kernel_dispatch_deps axpr ap_code_module ap_code_gen)
36+
cc_library(
37+
ap_kernel_dispatch
38+
SRCS ${ap_kernel_dispatch_srcs}
39+
DEPS ${AP_COMMON_DEPS} ${ap_kernel_dispatch_deps})
40+
41+
file(GLOB_RECURSE ap_phi_srcs "src/paddle/phi/*.cc")
42+
set(ap_phi_deps axpr ap_code_module ap_code_gen ap_kernel_dispatch)
43+
cc_library(
44+
ap_phi
45+
SRCS ${ap_phi_srcs}
46+
DEPS ${AP_COMMON_DEPS} ${ap_phi_deps})
47+
48+
file(GLOB_RECURSE ap_pir_srcs "src/paddle/pir/*.cc")
49+
set(ap_pir_deps axpr ap_drr)
50+
cc_library(
51+
ap_pir
52+
SRCS ${ap_pir_srcs}
53+
DEPS ${AP_COMMON_DEPS} ${ap_pir_deps})
54+
55+
file(GLOB_RECURSE ap_reified_drr_srcs "src/reified_drr/*.cc")
56+
set(ap_reified_drr_deps axpr ap_drr ap_code_module ap_code_gen)
57+
cc_library(
58+
ap_reified_drr
59+
SRCS ${ap_reified_drr_srcs}
60+
DEPS ${AP_COMMON_DEPS} ${ap_reified_drr_deps})
61+
62+
file(GLOB_RECURSE ap_pass_srcs "src/paddle/pass/*.cc")
63+
set(ap_pass_deps axpr ap_pir ap_drr ap_code_module ap_code_gen ap_reified_drr)
64+
cc_library(
65+
ap_pass
66+
SRCS ${ap_pass_srcs}
67+
DEPS ${AP_COMMON_DEPS} ${ap_pass_deps})

0 commit comments

Comments
 (0)