Move the codes of fused operators to operators/fused directory. (#20881)
* Move the codes of fused operators to operators/fused directory. test=develop * Correct the op name in cmake. * Change the use of PADDLE_ENFORCE. test=developyaoxuefeng
parent
a9bc92c314
commit
03ba0fdae6
@ -1,12 +1,29 @@
|
||||
include(operators)
|
||||
register_operators(EXCLUDES fusion_transpose_flatten_concat_op fusion_conv_inception_op fused_fc_elementwise_layernorm_op)
|
||||
register_operators(EXCLUDES
|
||||
conv_fusion_op
|
||||
fusion_transpose_flatten_concat_op
|
||||
fusion_conv_inception_op
|
||||
fused_fc_elementwise_layernorm_op
|
||||
multihead_matmul_op)
|
||||
|
||||
if (WITH_GPU)
|
||||
op_library(fusion_transpose_flatten_concat_op)
|
||||
file(APPEND ${pybind_file} "USE_CUDA_ONLY_OP(fusion_transpose_flatten_concat);\n")
|
||||
if (NOT ${CUDNN_VERSION} VERSION_LESS 7100)
|
||||
op_library(fusion_conv_inception_op)
|
||||
file(APPEND ${pybind_file} "USE_CUDA_ONLY_OP(conv2d_inception_fusion);\n")
|
||||
endif()
|
||||
op_library(fused_fc_elementwise_layernorm_op)
|
||||
file(APPEND ${pybind_file} "USE_CUDA_ONLY_OP(fused_fc_elementwise_layernorm);\n")
|
||||
# conv_fusion_op needs cudnn 7 above
|
||||
if (NOT ${CUDNN_VERSION} VERSION_LESS 7100)
|
||||
op_library(conv_fusion_op)
|
||||
file(APPEND ${pybind_file} "USE_CUDA_ONLY_OP(conv2d_fusion);\n")
|
||||
endif()
|
||||
# fusion_transpose_flatten_concat_op
|
||||
op_library(fusion_transpose_flatten_concat_op)
|
||||
file(APPEND ${pybind_file} "USE_CUDA_ONLY_OP(fusion_transpose_flatten_concat);\n")
|
||||
# fusion_conv_inception_op needs cudnn 7 above
|
||||
if (NOT ${CUDNN_VERSION} VERSION_LESS 7100)
|
||||
op_library(fusion_conv_inception_op)
|
||||
file(APPEND ${pybind_file} "USE_CUDA_ONLY_OP(conv2d_inception_fusion);\n")
|
||||
endif()
|
||||
# fused_fc_elementwise_layernorm_op
|
||||
op_library(fused_fc_elementwise_layernorm_op)
|
||||
file(APPEND ${pybind_file} "USE_CUDA_ONLY_OP(fused_fc_elementwise_layernorm);\n")
|
||||
# multihead_matmul_op
|
||||
op_library(multihead_matmul_op)
|
||||
file(APPEND ${pybind_file} "USE_CUDA_ONLY_OP(multihead_matmul);\n")
|
||||
endif()
|
||||
|
Loading…
Reference in new issue