CMakeLists.txt 1.4 KB
Newer Older
1 2 3 4
file(
  GLOB TEST_OPS
  RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}"
  "test_*.py")
5 6
string(REPLACE ".py" "" TEST_OPS "${TEST_OPS}")

张春乔 已提交
7
if((NOT WITH_GPU) AND (NOT WITH_XPU))
8 9 10 11 12 13 14 15 16 17 18 19
  list(REMOVE_ITEM TEST_OPS "test_dist_fuse_adam_pass")
  list(REMOVE_ITEM TEST_OPS "test_dist_fuse_all_reduce_pass")
  list(REMOVE_ITEM TEST_OPS "test_dist_fuse_bn_act_pass")
  list(REMOVE_ITEM TEST_OPS "test_dist_fuse_bn_add_act_pass")
  list(REMOVE_ITEM TEST_OPS "test_dist_fuse_momentum_pass")
  list(REMOVE_ITEM TEST_OPS "test_dist_fuse_relu_depthwise_conv_pass")
  list(REMOVE_ITEM TEST_OPS "test_dist_fuse_sgd_pass")
  list(REMOVE_ITEM TEST_OPS "test_dist_inplace_addto_pass")
  list(REMOVE_ITEM TEST_OPS "test_auto_parallel_amp_pass")
  list(REMOVE_ITEM TEST_OPS "test_auto_parallel_recompute_pass")
  list(REMOVE_ITEM TEST_OPS "test_auto_parallel_sharding_pass")
  list(REMOVE_ITEM TEST_OPS "test_auto_parallel_fp16_pass")
20
  list(REMOVE_ITEM TEST_OPS "test_auto_parallel_gradient_merge_pass")
21 22
  list(REMOVE_ITEM TEST_OPS
       "test_auto_parallel_data_parallel_optimization_pass")
23 24
endif()

S
Shijie 已提交
25 26 27 28
if(NOT ((WITH_GPU) AND (CUDA_VERSION GREATER_EQUAL 11.6)))
  list(REMOVE_ITEM TEST_OPS test_dist_fuse_gemm_epilogue_pass)
endif()

29
foreach(TEST_OP ${TEST_OPS})
30 31
  py_test_modules(${TEST_OP} MODULES ${TEST_OP})
  list(APPEND DIST_TEST_OPS ${TEST_OP})
32
  set_tests_properties(${TEST_OP} PROPERTIES TIMEOUT 200)
33
  set_tests_properties(${TEST_OP} PROPERTIES LABELS "RUN_TYPE=DIST")
W
Wilber 已提交
34
endforeach()