From c9d156b163c6ab533b84c6eda7827f3267300a93 Mon Sep 17 00:00:00 2001 From: Ruibiao Chen Date: Sat, 7 May 2022 10:07:32 +0800 Subject: [PATCH] [cherry-pick] Fix UT timeout problem for cuda_managed_memory_test and test_tensordot (#42492) * Reduce time variation for cuda_managed_memory_test (#42458) * Disable standalone executor for test_tensordot (#42476) --- paddle/fluid/memory/cuda_managed_memory_test.cu | 6 +++--- python/paddle/fluid/tests/unittests/CMakeLists.txt | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/paddle/fluid/memory/cuda_managed_memory_test.cu b/paddle/fluid/memory/cuda_managed_memory_test.cu index f8c9ff82f57..f4b4294b5bd 100644 --- a/paddle/fluid/memory/cuda_managed_memory_test.cu +++ b/paddle/fluid/memory/cuda_managed_memory_test.cu @@ -107,7 +107,7 @@ TEST(ManagedMemoryTest, OversubscribeGPUMemoryTest) { uint64_t available_mem = platform::GpuAvailableMemToAlloc(); uint64_t n_data = available_mem * 2 / sizeof(int) + 1; // requires more than 2 * available_mem bytes - uint64_t step = 1024; + uint64_t step = std::max(n_data / 1024, static_cast(1)); AllocationPtr data_allocation = Alloc(platform::CUDAPlace(0), n_data * sizeof(int)); AllocationPtr sum_allocation = Alloc(platform::CUDAPlace(0), sizeof(int)); @@ -115,8 +115,8 @@ TEST(ManagedMemoryTest, OversubscribeGPUMemoryTest) { int* sum = static_cast(sum_allocation->ptr()); (*sum) = 0; - write_kernel<<<5120, 1024>>>(data, n_data, step); - sum_kernel<<<5120, 1024>>>(data, n_data, step, sum); + write_kernel<<<1, 1024>>>(data, n_data, step); + sum_kernel<<<1, 1024>>>(data, n_data, step, sum); #ifdef PADDLE_WITH_CUDA PADDLE_ENFORCE_GPU_SUCCESS(cudaDeviceSynchronize()); diff --git a/python/paddle/fluid/tests/unittests/CMakeLists.txt b/python/paddle/fluid/tests/unittests/CMakeLists.txt index 4aff486e707..e19374387c0 100755 --- a/python/paddle/fluid/tests/unittests/CMakeLists.txt +++ b/python/paddle/fluid/tests/unittests/CMakeLists.txt @@ -1231,6 +1231,7 @@ set_tests_properties(test_inplace_addto_strategy PROPERTIES TIMEOUT 120) set_tests_properties(test_eigvals_op PROPERTIES TIMEOUT 400) set_tests_properties(test_tensordot PROPERTIES TIMEOUT 1000) set_tests_properties(test_tensordot PROPERTIES LABELS "RUN_TYPE=NIGHTLY") +set_tests_properties(test_tensordot PROPERTIES ENVIRONMENT "FLAGS_USE_STANDALONE_EXECUTOR=False") set_tests_properties(test_cuda_memory_reserved PROPERTIES ENVIRONMENT "FLAGS_allocator_strategy=auto_growth") if (WITH_GLOO) set_tests_properties(test_parallel_dygraph_dataparallel_cpuonly PROPERTIES TIMEOUT 30) -- GitLab