|
1 | 1 | file(GLOB TEST_OPS RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "test_*.py")
|
2 | 2 | string(REPLACE ".py" "" TEST_OPS "${TEST_OPS}")
|
| 3 | +set(GC_ENVS FLAGS_eager_delete_tensor_gb=0.0 FLAGS_fast_eager_deletion_mode=1 FLAGS_memory_fraction_of_eager_deletion=1.0) |
3 | 4 |
|
4 | 5 | if(NOT WITH_DISTRIBUTE)
|
5 | 6 | list(REMOVE_ITEM TEST_OPS test_recv_op)
|
@@ -80,13 +81,49 @@ list(REMOVE_ITEM TEST_OPS test_imperative_se_resnext)
|
80 | 81 | list(REMOVE_ITEM TEST_OPS test_imperative_mnist)
|
81 | 82 | list(REMOVE_ITEM TEST_OPS test_ir_memory_optimize_transformer)
|
82 | 83 | list(REMOVE_ITEM TEST_OPS test_layers)
|
| 84 | + |
| 85 | +# Some ops need to check results when gc is enabled |
| 86 | +# Currently, only ops that register NoNeedBufferVarsInference need to do this test |
| 87 | +set(TEST_OPS_WITH_GC |
| 88 | + test_concat_op |
| 89 | + test_elementwise_add_op |
| 90 | + test_elementwise_sub_op |
| 91 | + test_fill_constant_batch_size_like_op |
| 92 | + test_fill_zeros_like2_op |
| 93 | + test_gather_op |
| 94 | + test_gaussian_random_batch_size_like_op |
| 95 | + test_linear_chain_crf_op |
| 96 | + test_lod_reset_op |
| 97 | + test_lookup_table_op |
| 98 | + test_mean_op |
| 99 | + test_pad2d_op |
| 100 | + test_scatter_op |
| 101 | + test_sequence_concat |
| 102 | + test_seq_conv |
| 103 | + test_seq_pool |
| 104 | + test_sequence_expand_as |
| 105 | + test_sequence_expand |
| 106 | + test_sequence_pad_op |
| 107 | + test_sequence_unpad_op |
| 108 | + test_sequence_scatter_op |
| 109 | + test_sequence_slice_op |
| 110 | + test_slice_op |
| 111 | + test_space_to_depth_op |
| 112 | + test_squared_l2_distance_op |
| 113 | + test_uniform_random_batch_size_like_op) |
| 114 | + |
| 115 | +foreach(TEST_OP ${TEST_OPS_WITH_GC}) |
| 116 | + list(REMOVE_ITEM TEST_OPS ${TEST_OP}) |
| 117 | + py_test_modules(${TEST_OP} MODULES ${TEST_OP} ENVS ${GC_ENVS}) |
| 118 | +endforeach() |
| 119 | + |
83 | 120 | foreach(TEST_OP ${TEST_OPS})
|
84 | 121 | py_test_modules(${TEST_OP} MODULES ${TEST_OP})
|
85 | 122 | endforeach(TEST_OP)
|
86 | 123 | py_test_modules(test_adam_op_multi_thread MODULES test_adam_op ENVS FLAGS_inner_op_parallelism=4)
|
87 | 124 | py_test_modules(test_warpctc_op MODULES test_warpctc_op ENVS FLAGS_warpctc_dir=${WARPCTC_LIB_DIR} SERIAL)
|
88 |
| -py_test_modules(test_bilinear_interp_op MODULES test_bilinear_interp_op SERIAL) |
89 |
| -py_test_modules(test_nearest_interp_op MODULES test_nearest_interp_op SERIAL) |
| 125 | +py_test_modules(test_bilinear_interp_op MODULES test_bilinear_interp_op ENVS ${GC_ENVS} SERIAL) |
| 126 | +py_test_modules(test_nearest_interp_op MODULES test_nearest_interp_op ENVS ${GC_ENVS} SERIAL) |
90 | 127 | py_test_modules(test_imperative_resnet MODULES test_imperative_resnet ENVS
|
91 | 128 | FLAGS_cudnn_deterministic=1 SERIAL)
|
92 | 129 | py_test_modules(test_imperative_mnist MODULES test_imperative_mnist ENVS
|
|
0 commit comments