未验证 提交 d53bd8c1 编写于 作者: Z zlsh80826 提交者: GitHub

Loose TRT half test tolerance to 1e-3 (#47106)

上级 3f40cdfb
...@@ -149,7 +149,7 @@ class TrtConvertExpandV2Test(TrtLayerAutoScanTest): ...@@ -149,7 +149,7 @@ class TrtConvertExpandV2Test(TrtLayerAutoScanTest):
attrs, False), 1e-5 attrs, False), 1e-5
self.trt_param.precision = paddle_infer.PrecisionType.Half self.trt_param.precision = paddle_infer.PrecisionType.Half
yield self.create_inference_config(), generate_trt_nodes_num( yield self.create_inference_config(), generate_trt_nodes_num(
attrs, False), 1e-5 attrs, False), 1e-3
# for dynamic_shape # for dynamic_shape
generate_dynamic_shape(attrs) generate_dynamic_shape(attrs)
...@@ -158,7 +158,7 @@ class TrtConvertExpandV2Test(TrtLayerAutoScanTest): ...@@ -158,7 +158,7 @@ class TrtConvertExpandV2Test(TrtLayerAutoScanTest):
attrs, True), 1e-5 attrs, True), 1e-5
self.trt_param.precision = paddle_infer.PrecisionType.Half self.trt_param.precision = paddle_infer.PrecisionType.Half
yield self.create_inference_config(), generate_trt_nodes_num( yield self.create_inference_config(), generate_trt_nodes_num(
attrs, True), 1e-5 attrs, True), 1e-3
def add_skip_trt_case(self): def add_skip_trt_case(self):
pass pass
...@@ -251,7 +251,7 @@ class TrtConvertExpandV2Test2(TrtLayerAutoScanTest): ...@@ -251,7 +251,7 @@ class TrtConvertExpandV2Test2(TrtLayerAutoScanTest):
self.trt_param.precision = paddle_infer.PrecisionType.Float32 self.trt_param.precision = paddle_infer.PrecisionType.Float32
yield self.create_inference_config(), (1, 3), 1e-5 yield self.create_inference_config(), (1, 3), 1e-5
self.trt_param.precision = paddle_infer.PrecisionType.Half self.trt_param.precision = paddle_infer.PrecisionType.Half
yield self.create_inference_config(), (1, 3), 1e-5 yield self.create_inference_config(), (1, 3), 1e-3
def add_skip_trt_case(self): def add_skip_trt_case(self):
pass pass
...@@ -402,7 +402,7 @@ class TrtConvertExpandV2Test3(TrtLayerAutoScanTest): ...@@ -402,7 +402,7 @@ class TrtConvertExpandV2Test3(TrtLayerAutoScanTest):
self.trt_param.precision = paddle_infer.PrecisionType.Float32 self.trt_param.precision = paddle_infer.PrecisionType.Float32
yield self.create_inference_config(), (4, 3), 1e-5 yield self.create_inference_config(), (4, 3), 1e-5
self.trt_param.precision = paddle_infer.PrecisionType.Half self.trt_param.precision = paddle_infer.PrecisionType.Half
yield self.create_inference_config(), (4, 3), 1e-5 yield self.create_inference_config(), (4, 3), 1e-3
def add_skip_trt_case(self): def add_skip_trt_case(self):
pass pass
......
...@@ -123,7 +123,7 @@ class TrtConvertReduceSumTest(TrtLayerAutoScanTest): ...@@ -123,7 +123,7 @@ class TrtConvertReduceSumTest(TrtLayerAutoScanTest):
attrs, False), (1e-5, 1e-5) attrs, False), (1e-5, 1e-5)
self.trt_param.precision = paddle_infer.PrecisionType.Half self.trt_param.precision = paddle_infer.PrecisionType.Half
yield self.create_inference_config(), generate_trt_nodes_num( yield self.create_inference_config(), generate_trt_nodes_num(
attrs, False), (1e-4, 1e-4) attrs, False), (1e-3, 1e-3)
# for dynamic_shape # for dynamic_shape
generate_dynamic_shape(attrs) generate_dynamic_shape(attrs)
...@@ -132,7 +132,7 @@ class TrtConvertReduceSumTest(TrtLayerAutoScanTest): ...@@ -132,7 +132,7 @@ class TrtConvertReduceSumTest(TrtLayerAutoScanTest):
attrs, True), (1e-5, 1e-5) attrs, True), (1e-5, 1e-5)
self.trt_param.precision = paddle_infer.PrecisionType.Half self.trt_param.precision = paddle_infer.PrecisionType.Half
yield self.create_inference_config(), generate_trt_nodes_num( yield self.create_inference_config(), generate_trt_nodes_num(
attrs, True), (1e-4, 1e-4) attrs, True), (1e-3, 1e-3)
def add_skip_trt_case(self): def add_skip_trt_case(self):
pass pass
......
...@@ -164,7 +164,7 @@ class TrtConvertReshapeTest(TrtLayerAutoScanTest): ...@@ -164,7 +164,7 @@ class TrtConvertReshapeTest(TrtLayerAutoScanTest):
attrs, False), 1e-5 attrs, False), 1e-5
self.trt_param.precision = paddle_infer.PrecisionType.Half self.trt_param.precision = paddle_infer.PrecisionType.Half
yield self.create_inference_config(), generate_trt_nodes_num( yield self.create_inference_config(), generate_trt_nodes_num(
attrs, False), 1e-5 attrs, False), 1e-3
# for dynamic_shape # for dynamic_shape
generate_dynamic_shape(attrs) generate_dynamic_shape(attrs)
...@@ -173,7 +173,7 @@ class TrtConvertReshapeTest(TrtLayerAutoScanTest): ...@@ -173,7 +173,7 @@ class TrtConvertReshapeTest(TrtLayerAutoScanTest):
attrs, True), 1e-5 attrs, True), 1e-5
self.trt_param.precision = paddle_infer.PrecisionType.Half self.trt_param.precision = paddle_infer.PrecisionType.Half
yield self.create_inference_config(), generate_trt_nodes_num( yield self.create_inference_config(), generate_trt_nodes_num(
attrs, True), 1e-5 attrs, True), 1e-3
def add_skip_trt_case(self): def add_skip_trt_case(self):
pass pass
...@@ -297,7 +297,7 @@ class TrtConvertReshapeTest2(TrtLayerAutoScanTest): ...@@ -297,7 +297,7 @@ class TrtConvertReshapeTest2(TrtLayerAutoScanTest):
self.trt_param.precision = paddle_infer.PrecisionType.Float32 self.trt_param.precision = paddle_infer.PrecisionType.Float32
yield self.create_inference_config(), (1, 2), 1e-5 yield self.create_inference_config(), (1, 2), 1e-5
self.trt_param.precision = paddle_infer.PrecisionType.Half self.trt_param.precision = paddle_infer.PrecisionType.Half
yield self.create_inference_config(), (1, 2), 1e-5 yield self.create_inference_config(), (1, 2), 1e-3
def add_skip_trt_case(self): def add_skip_trt_case(self):
pass pass
...@@ -409,7 +409,7 @@ class TrtConvertReshapeTest3(TrtLayerAutoScanTest): ...@@ -409,7 +409,7 @@ class TrtConvertReshapeTest3(TrtLayerAutoScanTest):
self.trt_param.precision = paddle_infer.PrecisionType.Float32 self.trt_param.precision = paddle_infer.PrecisionType.Float32
yield self.create_inference_config(), (1, 2), 1e-5 yield self.create_inference_config(), (1, 2), 1e-5
self.trt_param.precision = paddle_infer.PrecisionType.Half self.trt_param.precision = paddle_infer.PrecisionType.Half
yield self.create_inference_config(), (1, 2), 1e-5 yield self.create_inference_config(), (1, 2), 1e-3
def add_skip_trt_case(self): def add_skip_trt_case(self):
pass pass
......
...@@ -106,7 +106,7 @@ class TrtConvertRollTest(TrtLayerAutoScanTest): ...@@ -106,7 +106,7 @@ class TrtConvertRollTest(TrtLayerAutoScanTest):
attrs, False), 1e-5 attrs, False), 1e-5
self.trt_param.precision = paddle_infer.PrecisionType.Half self.trt_param.precision = paddle_infer.PrecisionType.Half
yield self.create_inference_config(), generate_trt_nodes_num( yield self.create_inference_config(), generate_trt_nodes_num(
attrs, False), 1e-4 attrs, False), 1e-3
# for dynamic_shape # for dynamic_shape
generate_dynamic_shape(attrs) generate_dynamic_shape(attrs)
...@@ -115,7 +115,7 @@ class TrtConvertRollTest(TrtLayerAutoScanTest): ...@@ -115,7 +115,7 @@ class TrtConvertRollTest(TrtLayerAutoScanTest):
attrs, True), 1e-5 attrs, True), 1e-5
self.trt_param.precision = paddle_infer.PrecisionType.Half self.trt_param.precision = paddle_infer.PrecisionType.Half
yield self.create_inference_config(), generate_trt_nodes_num( yield self.create_inference_config(), generate_trt_nodes_num(
attrs, True), 1e-4 attrs, True), 1e-3
def test(self): def test(self):
self.run_test() self.run_test()
......
...@@ -128,7 +128,7 @@ class TrtConvertSliceTest(TrtLayerAutoScanTest): ...@@ -128,7 +128,7 @@ class TrtConvertSliceTest(TrtLayerAutoScanTest):
attrs, False), 1e-5 attrs, False), 1e-5
self.trt_param.precision = paddle_infer.PrecisionType.Half self.trt_param.precision = paddle_infer.PrecisionType.Half
yield self.create_inference_config(), generate_trt_nodes_num( yield self.create_inference_config(), generate_trt_nodes_num(
attrs, False), 1e-4 attrs, False), 1e-3
# for dynamic_shape # for dynamic_shape
generate_dynamic_shape(attrs) generate_dynamic_shape(attrs)
...@@ -137,7 +137,7 @@ class TrtConvertSliceTest(TrtLayerAutoScanTest): ...@@ -137,7 +137,7 @@ class TrtConvertSliceTest(TrtLayerAutoScanTest):
attrs, True), 1e-5 attrs, True), 1e-5
self.trt_param.precision = paddle_infer.PrecisionType.Half self.trt_param.precision = paddle_infer.PrecisionType.Half
yield self.create_inference_config(), generate_trt_nodes_num( yield self.create_inference_config(), generate_trt_nodes_num(
attrs, True), 1e-4 attrs, True), 1e-3
def test(self): def test(self):
# TODO(inference): fix. # TODO(inference): fix.
......
...@@ -219,7 +219,7 @@ class TrtConvertSplitTest(TrtLayerAutoScanTest): ...@@ -219,7 +219,7 @@ class TrtConvertSplitTest(TrtLayerAutoScanTest):
attrs, False), 1e-5 attrs, False), 1e-5
self.trt_param.precision = paddle_infer.PrecisionType.Half self.trt_param.precision = paddle_infer.PrecisionType.Half
yield self.create_inference_config(), generate_trt_nodes_num( yield self.create_inference_config(), generate_trt_nodes_num(
attrs, False), 1e-5 attrs, False), 1e-3
# for dynamic_shape # for dynamic_shape
generate_dynamic_shape(attrs) generate_dynamic_shape(attrs)
...@@ -228,7 +228,7 @@ class TrtConvertSplitTest(TrtLayerAutoScanTest): ...@@ -228,7 +228,7 @@ class TrtConvertSplitTest(TrtLayerAutoScanTest):
attrs, True), 1e-5 attrs, True), 1e-5
self.trt_param.precision = paddle_infer.PrecisionType.Half self.trt_param.precision = paddle_infer.PrecisionType.Half
yield self.create_inference_config(), generate_trt_nodes_num( yield self.create_inference_config(), generate_trt_nodes_num(
attrs, True), 1e-5 attrs, True), 1e-3
def add_skip_trt_case(self): def add_skip_trt_case(self):
......
...@@ -115,7 +115,7 @@ class TrtConvertSplitTest(TrtLayerAutoScanTest): ...@@ -115,7 +115,7 @@ class TrtConvertSplitTest(TrtLayerAutoScanTest):
attrs, False), 1e-5 attrs, False), 1e-5
self.trt_param.precision = paddle_infer.PrecisionType.Half self.trt_param.precision = paddle_infer.PrecisionType.Half
yield self.create_inference_config(), generate_trt_nodes_num( yield self.create_inference_config(), generate_trt_nodes_num(
attrs, False), 1e-5 attrs, False), 1e-3
# for dynamic_shape # for dynamic_shape
generate_dynamic_shape(attrs) generate_dynamic_shape(attrs)
...@@ -124,7 +124,7 @@ class TrtConvertSplitTest(TrtLayerAutoScanTest): ...@@ -124,7 +124,7 @@ class TrtConvertSplitTest(TrtLayerAutoScanTest):
attrs, True), 1e-5 attrs, True), 1e-5
self.trt_param.precision = paddle_infer.PrecisionType.Half self.trt_param.precision = paddle_infer.PrecisionType.Half
yield self.create_inference_config(), generate_trt_nodes_num( yield self.create_inference_config(), generate_trt_nodes_num(
attrs, True), 1e-5 attrs, True), 1e-3
def add_skip_trt_case(self): def add_skip_trt_case(self):
pass pass
......
...@@ -101,7 +101,7 @@ class TrtConvertTileTest(TrtLayerAutoScanTest): ...@@ -101,7 +101,7 @@ class TrtConvertTileTest(TrtLayerAutoScanTest):
attrs, False), 1e-5 attrs, False), 1e-5
self.trt_param.precision = paddle_infer.PrecisionType.Half self.trt_param.precision = paddle_infer.PrecisionType.Half
yield self.create_inference_config(), generate_trt_nodes_num( yield self.create_inference_config(), generate_trt_nodes_num(
attrs, False), 1e-4 attrs, False), 1e-3
# for dynamic_shape # for dynamic_shape
generate_dynamic_shape(attrs) generate_dynamic_shape(attrs)
...@@ -110,7 +110,7 @@ class TrtConvertTileTest(TrtLayerAutoScanTest): ...@@ -110,7 +110,7 @@ class TrtConvertTileTest(TrtLayerAutoScanTest):
attrs, True), 1e-5 attrs, True), 1e-5
self.trt_param.precision = paddle_infer.PrecisionType.Half self.trt_param.precision = paddle_infer.PrecisionType.Half
yield self.create_inference_config(), generate_trt_nodes_num( yield self.create_inference_config(), generate_trt_nodes_num(
attrs, True), 1e-4 attrs, True), 1e-3
@given(repeat_times=st.sampled_from([[100], [1, 2], [0, 3], [1, 2, 100]])) @given(repeat_times=st.sampled_from([[100], [1, 2], [0, 3], [1, 2, 100]]))
def test(self, *args, **kwargs): def test(self, *args, **kwargs):
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册