未验证 提交 ea4b56f2 编写于 作者: 0 0x45f 提交者: GitHub

Switch dy2st UT to eager mode by cmake (#41317)

* Switch dy2st UT to eager mode by cmake

* Rename ENVS

* Remove invalid UT

* Remove error UT

* Remove test_bert
上级 3f57ef7a
file(GLOB TEST_OPS RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "test_*.py")
string(REPLACE ".py" "" TEST_OPS "${TEST_OPS}")
set(GC_ENVS FLAGS_eager_delete_tensor_gb=0.0)
set(DY2ST_EAGER_TEST_ENVS ${GC_ENVS} FLAGS_enable_eager_mode=1)
set(TEST_EAGER_OPS test_bmn test_break_continue test_ifelse test_loop test_mnist_amp
test_mnist_pure_fp16 test_mobile_net test_program_translator test_ptb_lm test_reinforcement_learning
test_resnet test_resnet_amp test_resnet_pure_fp16 test_se_resnet test_sentiment test_seq2seq
test_tsm test_word2vec test_yolov3)
list(REMOVE_ITEM TEST_OPS test_lac)
# NOTE(Aurelius84): In case of Windows CI, if open ON_INFER, RWLOCK of Scope will
# be removed and will cause some random failed in multi-thread.
if(NOT ON_INFER)
py_test_modules(test_lac MODULES test_lac)
py_test_modules(test_lac MODULES test_lac ENVS FLAGS_enable_eager_mode=1)
set_tests_properties(test_lac PROPERTIES TIMEOUT 120)
endif()
......@@ -15,7 +20,12 @@ if(WIN32 AND NOT WITH_GPU)
endif()
foreach(TEST_OP ${TEST_OPS})
list(FIND TEST_EAGER_OPS ${TEST_OP} WAS_FOUND)
if (NOT WAS_FOUND EQUAL -1)
py_test_modules(${TEST_OP} MODULES ${TEST_OP} ENVS ${DY2ST_EAGER_TEST_ENVS})
else()
py_test_modules(${TEST_OP} MODULES ${TEST_OP} ENVS ${GC_ENVS})
endif()
endforeach(TEST_OP)
set_tests_properties(test_se_resnet PROPERTIES TIMEOUT 900)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册