From 14a089c49d80a17a5e0342699a5406cc263e4b56 Mon Sep 17 00:00:00 2001 From: Megvii Engine Team Date: Tue, 6 Apr 2021 14:00:36 +0800 Subject: [PATCH] fix(dnn): change ci to cudnn804, reopen testcase GitOrigin-RevId: 90713a801b4d70df0d1da2e00fda5c2b62df6dcd --- src/gopt/test/inference.cpp | 18 ------------------ src/tensorrt/test/opr_replace.cpp | 2 +- src/tensorrt/test/tensorrt.cpp | 4 ++-- src/tensorrt/test/tensorrt_runtime.cpp | 8 ++++---- 4 files changed, 7 insertions(+), 25 deletions(-) diff --git a/src/gopt/test/inference.cpp b/src/gopt/test/inference.cpp index 842584b50..c18e774ff 100644 --- a/src/gopt/test/inference.cpp +++ b/src/gopt/test/inference.cpp @@ -1959,8 +1959,6 @@ TEST(TestEnableTensorCore, Nchw4Nchw) { } #endif -//! close for cu111 ci, reopen it when bug fixed -#if CUDA_VERSION < 11000 TEST(TestEnableTensorCore, ConvBiasWithZ) { REQUIRE_GPU(1); auto cn = CompNode::load("gpu0"); @@ -2023,10 +2021,7 @@ TEST(TestEnableTensorCore, ConvBiasWithZ) { func->execute(); MGB_ASSERT_TENSOR_EQ(host_y, host_y_opt); } -#endif -//! close for cu111 ci, reopen it when bug fixed -#if CUDA_VERSION < 11000 TEST(TestEnableTensorCore, Pooling) { REQUIRE_GPU(1); auto cn = CompNode::load("gpu0"); @@ -2094,7 +2089,6 @@ TEST(TestEnableTensorCore, Pooling) { func->execute(); MGB_ASSERT_TENSOR_EQ(host_y, host_y_opt); } -#endif TEST(TestGoptInference, EnableTensorCore) { REQUIRE_GPU(1); @@ -2296,8 +2290,6 @@ TEST(FuseConvBiasZPass, BlockFuse) { } #endif -//! close for cu111 ci, reopen it when bug fixed -#if CUDA_VERSION < 11000 TEST(TestEnableTensorCore, ShuffleMerge) { REQUIRE_GPU(1); auto cn = CompNode::load("gpu0"); @@ -2391,7 +2383,6 @@ TEST(TestEnableTensorCore, ShuffleMerge) { func->execute(); MGB_ASSERT_TENSOR_EQ(host_y, host_y_opt); } -#endif #endif @@ -2575,8 +2566,6 @@ TEST(TestGoptInference, EnableCHWN4) { } #endif -//! close for cu111 ci, reopen it when bug fixed -#if CUDA_VERSION < 11000 TEST(TestGoptInference, EnableCHWN4WarpPespective) { REQUIRE_GPU(1); auto cn = CompNode::load("gpu0"); @@ -2664,7 +2653,6 @@ TEST(TestGoptInference, EnableCHWN4WarpPespective) { func->execute(); MGB_ASSERT_TENSOR_EQ(host_y, host_y_opt); } -#endif TEST(TestGoptInference, EnableCHWN4Pooling) { REQUIRE_GPU(1); @@ -2754,8 +2742,6 @@ TEST(TestGoptInference, EnableCHWN4Pooling) { MGB_ASSERT_TENSOR_EQ(host_y, host_y_opt); } -//! close for cu111 ci, reopen it when bug fixed -#if CUDA_VERSION < 11000 TEST(TestGoptInference, EnableCHWN4ShuffleRemove) { REQUIRE_GPU(1); auto cn = CompNode::load("gpu0"); @@ -2878,7 +2864,6 @@ TEST(TestGoptInference, EnableCHWN4ShuffleRemove) { func->execute(); MGB_ASSERT_TENSOR_EQ(host_y, host_y_opt); } -#endif TEST(TestGoptInference, ConvertFormatNCHW4GPU) { REQUIRE_GPU(1); @@ -3977,8 +3962,6 @@ TEST(TestGoptInference, FoldingConvDimshuffle) { func->execute(); } -//! close for cu111 ci, reopen it when bug fixed -#if CUDA_VERSION < 11000 TEST(TestGoptInference, FoldingConvDimshuffleNCHW4NCHW32) { REQUIRE_GPU(1); auto cn = CompNode::load("gpu0"); @@ -4063,7 +4046,6 @@ TEST(TestGoptInference, FoldingConvDimshuffleNCHW4NCHW32) { func->execute(); MGB_ASSERT_TENSOR_EQ(host_y_fuse, host_y_non_fuse); } -#endif #if CUDA_VERSION >= 10020 TEST(TestGoptInference, FoldingConvDimshuffleNCHW32NCHW4) { diff --git a/src/tensorrt/test/opr_replace.cpp b/src/tensorrt/test/opr_replace.cpp index e38183757..699d304d5 100644 --- a/src/tensorrt/test/opr_replace.cpp +++ b/src/tensorrt/test/opr_replace.cpp @@ -223,7 +223,7 @@ TEST(TestTensorRTReplace, ElemAddFusion) { ASSERT_EQ(3u, trt_opr->cast_final_safe() .trt_manager() .iobuf_size()); - MGB_ASSERT_TENSOR_NEAR(host_z1, host_z2, 1e-4); + MGB_ASSERT_TENSOR_NEAR(host_z1, host_z2, 5e-4); } TEST(TestTensorRTReplace, BatchedMatrixMulBasic) { diff --git a/src/tensorrt/test/tensorrt.cpp b/src/tensorrt/test/tensorrt.cpp index 31ca8dc85..d782699d2 100644 --- a/src/tensorrt/test/tensorrt.cpp +++ b/src/tensorrt/test/tensorrt.cpp @@ -44,14 +44,14 @@ TEST(TestOprTensorRT, Basic) { auto func = net.graph->compile({make_callback_copy(net.y, host_z1), make_callback_copy(y2, host_z2)}); func->execute(); - MGB_ASSERT_TENSOR_NEAR(host_z1, host_z2, 1e-4); + MGB_ASSERT_TENSOR_NEAR(host_z1, host_z2, 2e-4); auto&& host_x = net.host_x; auto&& gen = net.gen; *host_x = *gen({1, 23, 43, 43}); func->execute(); - MGB_ASSERT_TENSOR_NEAR(host_z1, host_z2, 1e-4); + MGB_ASSERT_TENSOR_NEAR(host_z1, host_z2, 2e-4); *host_x = *gen({10, 23, 12, 12}); func->execute(); MGB_ASSERT_TENSOR_NEAR(host_z1, host_z2, 1e-3); diff --git a/src/tensorrt/test/tensorrt_runtime.cpp b/src/tensorrt/test/tensorrt_runtime.cpp index bc1132f36..4cd9b1ef4 100644 --- a/src/tensorrt/test/tensorrt_runtime.cpp +++ b/src/tensorrt/test/tensorrt_runtime.cpp @@ -58,7 +58,7 @@ TEST(TestOprTensorRT, RuntimeBasic) { auto func = net.graph->compile({make_callback_copy(net.y, host_z1), make_callback_copy(y2, host_z2)}); func->execute(); - MGB_ASSERT_TENSOR_NEAR(host_z1, host_z2, 1e-4); + MGB_ASSERT_TENSOR_NEAR(host_z1, host_z2, 5e-4); } @@ -128,13 +128,13 @@ TEST(TestOprTensorRT, RuntimeChangeBatchSize) { auto func = net.graph->compile({make_callback_copy(net.y, host_z1), make_callback_copy(y2, host_z2)}); func->execute(); - MGB_ASSERT_TENSOR_NEAR(host_z1, host_z2, 1e-4); + MGB_ASSERT_TENSOR_NEAR(host_z1, host_z2, 5e-4); *net.host_x = *net.gen({1, 23, 28, 28}); func->execute(); - MGB_ASSERT_TENSOR_NEAR(host_z1, host_z2, 1e-4); + MGB_ASSERT_TENSOR_NEAR(host_z1, host_z2, 5e-4); *net.host_x = *net.gen({10, 23, 28, 28}); func->execute(); - MGB_ASSERT_TENSOR_NEAR(host_z1, host_z2, 1e-4); + MGB_ASSERT_TENSOR_NEAR(host_z1, host_z2, 5e-4); } #endif // MGB_ENABLE_TENSOR_RT -- GitLab