未验证 提交 c9d156b1 编写于 作者: R Ruibiao Chen 提交者: GitHub

[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)
上级 35ed11f3
...@@ -107,7 +107,7 @@ TEST(ManagedMemoryTest, OversubscribeGPUMemoryTest) { ...@@ -107,7 +107,7 @@ TEST(ManagedMemoryTest, OversubscribeGPUMemoryTest) {
uint64_t available_mem = platform::GpuAvailableMemToAlloc(); uint64_t available_mem = platform::GpuAvailableMemToAlloc();
uint64_t n_data = available_mem * 2 / sizeof(int) + uint64_t n_data = available_mem * 2 / sizeof(int) +
1; // requires more than 2 * available_mem bytes 1; // requires more than 2 * available_mem bytes
uint64_t step = 1024; uint64_t step = std::max(n_data / 1024, static_cast<uint64_t>(1));
AllocationPtr data_allocation = AllocationPtr data_allocation =
Alloc(platform::CUDAPlace(0), n_data * sizeof(int)); Alloc(platform::CUDAPlace(0), n_data * sizeof(int));
AllocationPtr sum_allocation = Alloc(platform::CUDAPlace(0), sizeof(int)); AllocationPtr sum_allocation = Alloc(platform::CUDAPlace(0), sizeof(int));
...@@ -115,8 +115,8 @@ TEST(ManagedMemoryTest, OversubscribeGPUMemoryTest) { ...@@ -115,8 +115,8 @@ TEST(ManagedMemoryTest, OversubscribeGPUMemoryTest) {
int* sum = static_cast<int*>(sum_allocation->ptr()); int* sum = static_cast<int*>(sum_allocation->ptr());
(*sum) = 0; (*sum) = 0;
write_kernel<<<5120, 1024>>>(data, n_data, step); write_kernel<<<1, 1024>>>(data, n_data, step);
sum_kernel<<<5120, 1024>>>(data, n_data, step, sum); sum_kernel<<<1, 1024>>>(data, n_data, step, sum);
#ifdef PADDLE_WITH_CUDA #ifdef PADDLE_WITH_CUDA
PADDLE_ENFORCE_GPU_SUCCESS(cudaDeviceSynchronize()); PADDLE_ENFORCE_GPU_SUCCESS(cudaDeviceSynchronize());
......
...@@ -1231,6 +1231,7 @@ set_tests_properties(test_inplace_addto_strategy PROPERTIES TIMEOUT 120) ...@@ -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_eigvals_op PROPERTIES TIMEOUT 400)
set_tests_properties(test_tensordot PROPERTIES TIMEOUT 1000) set_tests_properties(test_tensordot PROPERTIES TIMEOUT 1000)
set_tests_properties(test_tensordot PROPERTIES LABELS "RUN_TYPE=NIGHTLY") 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") set_tests_properties(test_cuda_memory_reserved PROPERTIES ENVIRONMENT "FLAGS_allocator_strategy=auto_growth")
if (WITH_GLOO) if (WITH_GLOO)
set_tests_properties(test_parallel_dygraph_dataparallel_cpuonly PROPERTIES TIMEOUT 30) set_tests_properties(test_parallel_dygraph_dataparallel_cpuonly PROPERTIES TIMEOUT 30)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册