CMakeLists.txt 2.3 KB
Newer Older
1 2
file(GLOB TEST_OPS RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "test_*.py")
string(REPLACE ".py" "" TEST_OPS "${TEST_OPS}")
Z
zn 已提交
3 4
file(GLOB TEST_DIST_OPS RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "test_collective_*.py")
string(REPLACE ".py" "" TEST_DIST_OPS "${TEST_DIST_OPS}")
5 6

if (WITH_MLU)
Z
zn 已提交
7 8 9
    foreach(TEST_OP ${TEST_DIST_OPS})
        LIST(REMOVE_ITEM TEST_OPS ${TEST_OP})
    endforeach(TEST_OP)
10
    LIST(REMOVE_ITEM TEST_OPS "test_spawn_mlu")
Z
zn 已提交
11

12 13 14
    foreach(TEST_OP ${TEST_OPS})
        py_test_modules(${TEST_OP} MODULES ${TEST_OP})
    endforeach(TEST_OP)
Z
zn 已提交
15 16

    if(WITH_CNCL)
17
	LIST(APPEND TEST_DIST_OPS "test_spawn_mlu")
18
        foreach(TEST_OP ${TEST_DIST_OPS})
Z
zn 已提交
19 20 21
            py_test_modules(${TEST_OP} MODULES ${TEST_OP})
        endforeach(TEST_OP)
        bash_test_modules(test_launch_async_mlu START_BASH test_launch_async_mlu.sh ENVS PADDLE_BINARY_DIR=${PADDLE_BINARY_DIR})
22 23 24
        bash_test_modules(test_launch_cloud_mlu START_BASH test_launch_cloud_mlu.sh ENVS PADDLE_BINARY_DIR=${PADDLE_BINARY_DIR})
        bash_test_modules(test_launch_nproc_mlu START_BASH test_launch_nproc_mlu.sh ENVS PADDLE_BINARY_DIR=${PADDLE_BINARY_DIR})
        bash_test_modules(test_c_comm_init_op_mlu START_BASH test_c_comm_init_op_mlu.sh ENVS PADDLE_BINARY_DIR=${PADDLE_BINARY_DIR})
Z
zn 已提交
25
        set_tests_properties(test_collective_broadcast PROPERTIES TIMEOUT 120)
26 27 28 29
	set_tests_properties(test_collective_allreduce_sum PROPERTIES TIMEOUT 120)
        set_tests_properties(test_collective_allreduce_max PROPERTIES TIMEOUT 120)
        set_tests_properties(test_collective_allreduce_min PROPERTIES TIMEOUT 120)
	set_tests_properties(test_collective_allreduce_prod PROPERTIES TIMEOUT 120)
Z
zn 已提交
30
	set_tests_properties(test_collective_allgather PROPERTIES TIMEOUT 120)
Z
zn 已提交
31 32 33 34
	set_tests_properties(test_collective_reduce_sum PROPERTIES TIMEOUT 120)
        set_tests_properties(test_collective_reduce_max PROPERTIES TIMEOUT 120)
        set_tests_properties(test_collective_reduce_min PROPERTIES TIMEOUT 120)
        set_tests_properties(test_collective_reduce_prod PROPERTIES TIMEOUT 120)
35 36
        set_tests_properties(test_collective_broadcast_api_mlu PROPERTIES TIMEOUT 120)
        set_tests_properties(test_collective_allreduce_api_mlu PROPERTIES TIMEOUT 120)
Z
zn 已提交
37
	set_tests_properties(test_collective_allgather_api_mlu PROPERTIES TIMEOUT 120)
38
        set_tests_properties(test_c_comm_init_op_mlu PROPERTIES TIMEOUT 120)
Z
zn 已提交
39
    endif(WITH_CNCL)
40
endif()