diff --git a/paddle/fluid/operators/fused/CMakeLists.txt b/paddle/fluid/operators/fused/CMakeLists.txt index becef73569b29cb0c1ddb6493ea7757fa1ff165c..261d1905246c8d75761b32786a72cee4a1f383bd 100755 --- a/paddle/fluid/operators/fused/CMakeLists.txt +++ b/paddle/fluid/operators/fused/CMakeLists.txt @@ -74,10 +74,6 @@ if(WITH_GPU OR WITH_ROCM) # fusion_group if(NOT APPLE AND NOT WIN32) op_library(fusion_group_op DEPS device_code) - cc_test( - test_fusion_group_op - SRCS fusion_group_op_test.cc - DEPS fusion_group_op) endif() # fused_bn_add_activation # HIP not support bn act fuse in MIOPEN @@ -87,37 +83,6 @@ if(WITH_GPU OR WITH_ROCM) # fused_dropout # only support CUDA if(NOT WITH_ROCM) - nv_test( - test_fused_residual_dropout_bias - SRCS fused_residual_dropout_bias_test.cu - DEPS tensor - op_registry - dropout_op - layer_norm_op - device_context - generator - memory) - nv_test( - test_fused_dropout_act_bias - SRCS fused_dropout_act_bias_test.cu - DEPS tensor - op_registry - dropout_op - layer_norm_op - device_context - generator - memory) - nv_test( - test_fused_layernorm_residual_dropout_bias - SRCS fused_layernorm_residual_dropout_bias_test.cu - DEPS tensor - op_registry - dropout_op - layer_norm_op - device_context - generator - memory) - op_library(fused_feedforward_op) # fused_attention_op op_library(fused_attention_op) @@ -128,30 +93,6 @@ if(WITH_GPU OR WITH_ROCM) # resnet_unit needs cudnn 8.0 above if((NOT WITH_ROCM) AND (NOT ${CUDNN_VERSION} VERSION_LESS 8000)) op_library(resnet_unit_op) - cc_test( - test_cudnn_norm_conv - SRCS cudnn_norm_conv_test.cc - DEPS conv_op - blas - im2col - vol2col - depthwise_conv - eigen_function - tensor - op_registry - device_context - generator - memory) - cc_test( - test_cudnn_bn_add_relu - SRCS cudnn_bn_add_relu_test.cc - DEPS batch_norm_op - fused_bn_add_activation_op - tensor - op_registry - device_context - generator - memory) endif() if(CUDA_VERSION GREATER_EQUAL 11.6) diff --git a/test/cpp/fluid/CMakeLists.txt b/test/cpp/fluid/CMakeLists.txt index 872e7c71d2520c06447673213e4954fc4c1c1537..c1bf46dce291e87a0a787ee5a2d968df1c384eed 100644 --- a/test/cpp/fluid/CMakeLists.txt +++ b/test/cpp/fluid/CMakeLists.txt @@ -6,7 +6,7 @@ endif() # add_subdirectory(detection) # add_subdirectory(dlnne) add_subdirectory(elementwise) -# add_subdirectory(fused) +add_subdirectory(fused) if(WITH_LITE) add_subdirectory(lite) endif() diff --git a/test/cpp/fluid/fused/CMakeLists.txt b/test/cpp/fluid/fused/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..4bbcfbb93d2f8dfb9180db77c3e2df8ca0e749a0 --- /dev/null +++ b/test/cpp/fluid/fused/CMakeLists.txt @@ -0,0 +1,68 @@ +if(WITH_GPU OR WITH_ROCM) + # fusion_group + if(NOT APPLE AND NOT WIN32) + cc_test( + test_fusion_group_op + SRCS fusion_group_op_test.cc + DEPS fusion_group_op) + endif() + if(NOT WITH_ROCM) + nv_test( + test_fused_residual_dropout_bias + SRCS fused_residual_dropout_bias_test.cu + DEPS tensor + op_registry + dropout_op + layer_norm_op + device_context + generator + memory) + nv_test( + test_fused_dropout_act_bias + SRCS fused_dropout_act_bias_test.cu + DEPS tensor + op_registry + dropout_op + layer_norm_op + device_context + generator + memory) + nv_test( + test_fused_layernorm_residual_dropout_bias + SRCS fused_layernorm_residual_dropout_bias_test.cu + DEPS tensor + op_registry + dropout_op + layer_norm_op + device_context + generator + memory) + endif() + # resnet_unit needs cudnn 8.0 above + if((NOT WITH_ROCM) AND (NOT ${CUDNN_VERSION} VERSION_LESS 8000)) + cc_test( + test_cudnn_norm_conv + SRCS cudnn_norm_conv_test.cc + DEPS conv_op + blas + im2col + vol2col + depthwise_conv + eigen_function + tensor + op_registry + device_context + generator + memory) + cc_test( + test_cudnn_bn_add_relu + SRCS cudnn_bn_add_relu_test.cc + DEPS batch_norm_op + fused_bn_add_activation_op + tensor + op_registry + device_context + generator + memory) + endif() +endif() diff --git a/paddle/fluid/operators/fused/cudnn_bn_add_relu_test.cc b/test/cpp/fluid/fused/cudnn_bn_add_relu_test.cc similarity index 100% rename from paddle/fluid/operators/fused/cudnn_bn_add_relu_test.cc rename to test/cpp/fluid/fused/cudnn_bn_add_relu_test.cc diff --git a/paddle/fluid/operators/fused/cudnn_norm_conv_test.cc b/test/cpp/fluid/fused/cudnn_norm_conv_test.cc similarity index 100% rename from paddle/fluid/operators/fused/cudnn_norm_conv_test.cc rename to test/cpp/fluid/fused/cudnn_norm_conv_test.cc diff --git a/paddle/fluid/operators/fused/fused_dropout_act_bias_test.cu b/test/cpp/fluid/fused/fused_dropout_act_bias_test.cu similarity index 99% rename from paddle/fluid/operators/fused/fused_dropout_act_bias_test.cu rename to test/cpp/fluid/fused/fused_dropout_act_bias_test.cu index 56f150c2dce420e58f7695f83ed870140d2975f5..ddcc3f513d510e8523bbc7aff610aea5c9c67910 100644 --- a/paddle/fluid/operators/fused/fused_dropout_act_bias_test.cu +++ b/test/cpp/fluid/fused/fused_dropout_act_bias_test.cu @@ -19,9 +19,9 @@ limitations under the License. */ #include "paddle/fluid/operators/amp/fp16_type_traits.h" #include "paddle/fluid/operators/fused/fused_dropout_act_bias.h" -#include "paddle/fluid/operators/fused/fused_dropout_test.h" #include "paddle/phi/core/kernel_registry.h" #include "paddle/phi/kernels/funcs/functors.h" +#include "test/cpp/fluid/fused/fused_dropout_test.h" #if defined(PADDLE_WITH_CUDA) || defined(PADDLE_WITH_HIP) PD_DECLARE_KERNEL(dropout, GPU, ALL_LAYOUT); diff --git a/paddle/fluid/operators/fused/fused_dropout_test.h b/test/cpp/fluid/fused/fused_dropout_test.h similarity index 100% rename from paddle/fluid/operators/fused/fused_dropout_test.h rename to test/cpp/fluid/fused/fused_dropout_test.h diff --git a/paddle/fluid/operators/fused/fused_layernorm_residual_dropout_bias_test.cu b/test/cpp/fluid/fused/fused_layernorm_residual_dropout_bias_test.cu similarity index 99% rename from paddle/fluid/operators/fused/fused_layernorm_residual_dropout_bias_test.cu rename to test/cpp/fluid/fused/fused_layernorm_residual_dropout_bias_test.cu index e57f39ec01e6db624969ee515e0b7c57dc5b5945..60cb67c837a1251d847455d8a68d7f8100a3a3f1 100644 --- a/paddle/fluid/operators/fused/fused_layernorm_residual_dropout_bias_test.cu +++ b/test/cpp/fluid/fused/fused_layernorm_residual_dropout_bias_test.cu @@ -17,9 +17,9 @@ limitations under the License. */ #include #include -#include "paddle/fluid/operators/fused/fused_dropout_test.h" #include "paddle/fluid/operators/fused/fused_layernorm_residual_dropout_bias.h" #include "paddle/phi/core/kernel_registry.h" +#include "test/cpp/fluid/fused/fused_dropout_test.h" #if defined(PADDLE_WITH_CUDA) || defined(PADDLE_WITH_HIP) PD_DECLARE_KERNEL(dropout, GPU, ALL_LAYOUT); diff --git a/paddle/fluid/operators/fused/fused_residual_dropout_bias_test.cu b/test/cpp/fluid/fused/fused_residual_dropout_bias_test.cu similarity index 99% rename from paddle/fluid/operators/fused/fused_residual_dropout_bias_test.cu rename to test/cpp/fluid/fused/fused_residual_dropout_bias_test.cu index d74bd9bfe175028bd90428774cb468bff2b9300b..823eb2ce7c60719a293824e5456c51f57d150c4e 100644 --- a/paddle/fluid/operators/fused/fused_residual_dropout_bias_test.cu +++ b/test/cpp/fluid/fused/fused_residual_dropout_bias_test.cu @@ -17,9 +17,9 @@ limitations under the License. */ #include #include -#include "paddle/fluid/operators/fused/fused_dropout_test.h" #include "paddle/fluid/operators/fused/fused_residual_dropout_bias.h" #include "paddle/phi/core/kernel_registry.h" +#include "test/cpp/fluid/fused/fused_dropout_test.h" #if defined(PADDLE_WITH_CUDA) || defined(PADDLE_WITH_HIP) PD_DECLARE_KERNEL(dropout, GPU, ALL_LAYOUT); diff --git a/paddle/fluid/operators/fused/fusion_group_op_test.cc b/test/cpp/fluid/fused/fusion_group_op_test.cc similarity index 100% rename from paddle/fluid/operators/fused/fusion_group_op_test.cc rename to test/cpp/fluid/fused/fusion_group_op_test.cc