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

Loose TRT fp16 tests tolerance (#47100)

上级 3c39475d
......@@ -103,7 +103,7 @@ class TrtConvertAnchorGeneratorTest(TrtLayerAutoScanTest):
attrs, False), 1e-5
self.trt_param.precision = paddle_infer.PrecisionType.Half
yield self.create_inference_config(), generate_trt_nodes_num(
attrs, False), 1e-5
attrs, False), 1e-3
# for dynamic_shape
generate_dynamic_shape(attrs)
......@@ -112,7 +112,7 @@ class TrtConvertAnchorGeneratorTest(TrtLayerAutoScanTest):
attrs, True), 1e-5
self.trt_param.precision = paddle_infer.PrecisionType.Half
yield self.create_inference_config(), generate_trt_nodes_num(
attrs, True), 1e-5
attrs, True), 1e-3
def test(self):
self.run_test()
......
......@@ -124,7 +124,7 @@ class TrtConvertFcTest(TrtLayerAutoScanTest):
attrs, False), 1e-5
self.trt_param.precision = paddle_infer.PrecisionType.Half
yield self.create_inference_config(), generate_trt_nodes_num(
attrs, False), (1e-5, 1e-5)
attrs, False), (1e-3, 1e-3)
# for dynamic_shape
generate_dynamic_shape(attrs)
......@@ -133,7 +133,7 @@ class TrtConvertFcTest(TrtLayerAutoScanTest):
attrs, True), 1e-5
self.trt_param.precision = paddle_infer.PrecisionType.Half
yield self.create_inference_config(), generate_trt_nodes_num(
attrs, True), (1e-5, 1e-5)
attrs, True), (1e-3, 1e-3)
def test(self):
self.run_test()
......@@ -234,14 +234,14 @@ class TrtConvertFcTest2(TrtLayerAutoScanTest):
self.trt_param.precision = paddle_infer.PrecisionType.Float32
yield self.create_inference_config(), (1, 2), 1e-5
self.trt_param.precision = paddle_infer.PrecisionType.Half
yield self.create_inference_config(), (1, 2), (1e-5, 1e-5)
yield self.create_inference_config(), (1, 2), (1e-3, 1e-3)
# for dynamic_shape
generate_dynamic_shape()
self.trt_param.precision = paddle_infer.PrecisionType.Float32
yield self.create_inference_config(), (1, 2), 1e-5
self.trt_param.precision = paddle_infer.PrecisionType.Half
yield self.create_inference_config(), (1, 2), (1e-5, 1e-5)
yield self.create_inference_config(), (1, 2), (1e-3, 1e-3)
def test(self):
self.run_test()
......@@ -339,16 +339,16 @@ class TrtConvertFcTest3(TrtLayerAutoScanTest):
self.trt_param.precision = paddle_infer.PrecisionType.Float32
yield self.create_inference_config(), (1, 2), 1e-5
self.trt_param.precision = paddle_infer.PrecisionType.Half
yield self.create_inference_config(), (1, 2), (1e-5, 1e-5)
yield self.create_inference_config(), (1, 2), (1e-3, 1e-3)
# for dynamic_shape
generate_dynamic_shape()
self.trt_param.precision = paddle_infer.PrecisionType.Float32
yield self.create_inference_config(), (1, 2), 1e-5
self.trt_param.precision = paddle_infer.PrecisionType.Half
yield self.create_inference_config(), (1, 2), (1e-5, 1e-5)
yield self.create_inference_config(), (1, 2), (1e-3, 1e-3)
self.trt_param.precision = paddle_infer.PrecisionType.Int8
yield self.create_inference_config(), (1, 2), (1e-5, 1e-5)
yield self.create_inference_config(), (1, 2), (1e-3, 1e-3)
def test(self):
self.run_test()
......
......@@ -134,7 +134,7 @@ class TrtConvertSplitTest(TrtLayerAutoScanTest):
attrs, True), 1e-5
self.trt_param.precision = paddle_infer.PrecisionType.Half
yield self.create_inference_config(), generate_trt_nodes_num(
attrs, True), 1e-5
attrs, True), 1e-3
def add_skip_trt_case(self):
pass
......
......@@ -92,14 +92,14 @@ class TrtConvertGridSampler(TrtLayerAutoScanTest):
self.trt_param.precision = paddle_infer.PrecisionType.Float32
yield self.create_inference_config(), (0, 4), 1e-5
self.trt_param.precision = paddle_infer.PrecisionType.Half
yield self.create_inference_config(), (0, 4), 1e-5
yield self.create_inference_config(), (0, 4), 1e-3
# for dynamic_shape
generate_dynamic_shape(attrs)
self.trt_param.precision = paddle_infer.PrecisionType.Float32
yield self.create_inference_config(), (1, 3), 1e-5
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 test(self):
self.run_test()
......
......@@ -82,14 +82,14 @@ class TrtConvertInverse(TrtLayerAutoScanTest):
self.trt_param.precision = paddle_infer.PrecisionType.Float32
yield self.create_inference_config(), (0, 3), 1e-5
self.trt_param.precision = paddle_infer.PrecisionType.Half
yield self.create_inference_config(), (0, 3), 1e-5
yield self.create_inference_config(), (0, 3), 1e-3
# for dynamic_shape
generate_dynamic_shape(attrs)
self.trt_param.precision = paddle_infer.PrecisionType.Float32
yield self.create_inference_config(), (1, 2), 1e-5
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 test(self):
self.run_test()
......
......@@ -305,7 +305,7 @@ class TrtConvertMatmulTest_dynamic3(TrtLayerAutoScanTest):
self.trt_param.precision = paddle_infer.PrecisionType.Float32
yield self.create_inference_config(), (1, 3), 1e-5
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):
pass
......
......@@ -88,14 +88,14 @@ class TrtConvertPad3d(TrtLayerAutoScanTest):
self.trt_param.precision = paddle_infer.PrecisionType.Float32
yield self.create_inference_config(), (0, 3), 1e-5
self.trt_param.precision = paddle_infer.PrecisionType.Half
yield self.create_inference_config(), (0, 3), 1e-5
yield self.create_inference_config(), (0, 3), 1e-3
# for dynamic_shape
generate_dynamic_shape(attrs)
self.trt_param.precision = paddle_infer.PrecisionType.Float32
yield self.create_inference_config(), (1, 2), 1e-5
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 test(self):
self.run_test()
......
......@@ -162,7 +162,7 @@ class TrtConvertRoiAlignTest(TrtLayerAutoScanTest):
attrs, False), 1e-5
self.trt_param.precision = paddle_infer.PrecisionType.Half
yield self.create_inference_config(), generate_trt_nodes_num(
attrs, False), 1e-5
attrs, False), 1e-3
# for dynamic_shape
generate_dynamic_shape(attrs)
......@@ -171,7 +171,7 @@ class TrtConvertRoiAlignTest(TrtLayerAutoScanTest):
attrs, True), 1e-5
self.trt_param.precision = paddle_infer.PrecisionType.Half
yield self.create_inference_config(), generate_trt_nodes_num(
attrs, True), 1e-5
attrs, True), 1e-3
def add_skip_trt_case(self):
......
......@@ -100,14 +100,14 @@ class TrtConvertScatterNd(TrtLayerAutoScanTest):
self.trt_param.precision = paddle_infer.PrecisionType.Float32
yield self.create_inference_config(), (0, 5), 1e-5
self.trt_param.precision = paddle_infer.PrecisionType.Half
yield self.create_inference_config(), (0, 5), 1e-5
yield self.create_inference_config(), (0, 5), 1e-3
# for dynamic_shape
generate_dynamic_shape(attrs)
self.trt_param.precision = paddle_infer.PrecisionType.Float32
yield self.create_inference_config(), (1, 4), 1e-5
self.trt_param.precision = paddle_infer.PrecisionType.Half
yield self.create_inference_config(), (1, 4), 1e-5
yield self.create_inference_config(), (1, 4), 1e-3
def test(self):
self.run_test()
......
......@@ -103,14 +103,14 @@ class TrtConvertSumTest(TrtLayerAutoScanTest):
False), 1e-5
self.trt_param.precision = paddle_infer.PrecisionType.Half
yield self.create_inference_config(), generate_trt_nodes_num(
False), 1e-5
False), 1e-3
# for dynamic_shape
generate_dynamic_shape()
self.trt_param.precision = paddle_infer.PrecisionType.Float32
yield self.create_inference_config(), generate_trt_nodes_num(True), 1e-5
self.trt_param.precision = paddle_infer.PrecisionType.Half
yield self.create_inference_config(), generate_trt_nodes_num(True), 1e-5
yield self.create_inference_config(), generate_trt_nodes_num(True), 1e-3
def test(self):
self.run_test()
......
......@@ -95,7 +95,7 @@ class TrtConvertShuffleChannelTest(TrtLayerAutoScanTest):
attrs, False), 1e-5
self.trt_param.precision = paddle_infer.PrecisionType.Half
yield self.create_inference_config(), generate_trt_nodes_num(
attrs, False), 1e-5
attrs, False), 1e-3
# for dynamic_shape
generate_dynamic_shape(attrs)
......@@ -104,7 +104,7 @@ class TrtConvertShuffleChannelTest(TrtLayerAutoScanTest):
attrs, True), 1e-5
self.trt_param.precision = paddle_infer.PrecisionType.Half
yield self.create_inference_config(), generate_trt_nodes_num(
attrs, True), 1e-5
attrs, True), 1e-3
def add_skip_trt_case(self):
pass
......
......@@ -194,7 +194,7 @@ class TrtConvertStackTest(TrtLayerAutoScanTest):
attrs, False), 1e-5
self.trt_param.precision = paddle_infer.PrecisionType.Half
yield self.create_inference_config(), generate_trt_nodes_num(
attrs, False), 1e-5
attrs, False), 1e-3
# for dynamic_shape
generate_dynamic_shape(attrs)
......@@ -203,7 +203,7 @@ class TrtConvertStackTest(TrtLayerAutoScanTest):
attrs, True), 1e-5
self.trt_param.precision = paddle_infer.PrecisionType.Half
yield self.create_inference_config(), generate_trt_nodes_num(
attrs, True), 1e-5
attrs, True), 1e-3
def add_skip_trt_case(self):
pass
......
......@@ -173,14 +173,14 @@ class TrtConvertSumTest(TrtLayerAutoScanTest):
False), 1e-5
self.trt_param.precision = paddle_infer.PrecisionType.Half
yield self.create_inference_config(), generate_trt_nodes_num(
False), 1e-5
False), 1e-3
# for dynamic_shape
generate_dynamic_shape()
self.trt_param.precision = paddle_infer.PrecisionType.Float32
yield self.create_inference_config(), generate_trt_nodes_num(True), 1e-5
self.trt_param.precision = paddle_infer.PrecisionType.Half
yield self.create_inference_config(), generate_trt_nodes_num(True), 1e-5
yield self.create_inference_config(), generate_trt_nodes_num(True), 1e-3
def test(self):
self.run_test()
......@@ -279,14 +279,14 @@ class TrtConvertSumTest1(TrtLayerAutoScanTest):
False), 1e-5
self.trt_param.precision = paddle_infer.PrecisionType.Half
yield self.create_inference_config(), generate_trt_nodes_num(
False), 1e-5
False), 1e-3
# for dynamic_shape
generate_dynamic_shape()
self.trt_param.precision = paddle_infer.PrecisionType.Float32
yield self.create_inference_config(), generate_trt_nodes_num(True), 1e-5
self.trt_param.precision = paddle_infer.PrecisionType.Half
yield self.create_inference_config(), generate_trt_nodes_num(True), 1e-5
yield self.create_inference_config(), generate_trt_nodes_num(True), 1e-3
def test(self):
self.run_test()
......
......@@ -117,7 +117,7 @@ class TrtConvertActivationTest(TrtLayerAutoScanTest):
attrs, False), 1e-5
self.trt_param.precision = paddle_infer.PrecisionType.Half
yield self.create_inference_config(), generate_trt_nodes_num(
attrs, False), 1e-5
attrs, False), 1e-3
## for dynamic_shape
generate_dynamic_shape(attrs)
......@@ -126,7 +126,7 @@ class TrtConvertActivationTest(TrtLayerAutoScanTest):
attrs, True), 1e-5
self.trt_param.precision = paddle_infer.PrecisionType.Half
yield self.create_inference_config(), generate_trt_nodes_num(
attrs, True), 1e-5
attrs, True), 1e-3
def test(self):
self.run_test()
......
......@@ -134,7 +134,7 @@ class TrtConvertActivationTest(TrtLayerAutoScanTest):
attrs, False), 1e-5
self.trt_param.precision = paddle_infer.PrecisionType.Half
yield self.create_inference_config(), generate_trt_nodes_num(
attrs, False), 1e-5
attrs, False), 1e-3
# for dynamic_shape
generate_dynamic_shape(attrs)
......@@ -143,7 +143,7 @@ class TrtConvertActivationTest(TrtLayerAutoScanTest):
attrs, True), 1e-5
self.trt_param.precision = paddle_infer.PrecisionType.Half
yield self.create_inference_config(), generate_trt_nodes_num(
attrs, True), 1e-5
attrs, True), 1e-3
def test(self):
self.run_test()
......
......@@ -137,7 +137,7 @@ class TrtConvertTransposeTest(TrtLayerAutoScanTest):
attrs, False), 1e-5
self.trt_param.precision = paddle_infer.PrecisionType.Half
yield self.create_inference_config(), generate_trt_nodes_num(
attrs, False), 1e-5
attrs, False), 1e-3
# for dynamic_shape
generate_dynamic_shape(attrs)
......@@ -146,7 +146,7 @@ class TrtConvertTransposeTest(TrtLayerAutoScanTest):
attrs, True), 1e-5
self.trt_param.precision = paddle_infer.PrecisionType.Half
yield self.create_inference_config(), generate_trt_nodes_num(
attrs, True), 1e-5
attrs, True), 1e-3
def test(self):
self.run_test()
......
......@@ -121,7 +121,7 @@ class TrtConvertActivationTest(TrtLayerAutoScanTest):
attrs, False), 1e-5
self.trt_param.precision = paddle_infer.PrecisionType.Half
yield self.create_inference_config(), generate_trt_nodes_num(
attrs, False), 1e-5
attrs, False), 1e-3
# for dynamic_shape
generate_dynamic_shape(attrs)
......@@ -130,7 +130,7 @@ class TrtConvertActivationTest(TrtLayerAutoScanTest):
attrs, True), 1e-5
self.trt_param.precision = paddle_infer.PrecisionType.Half
yield self.create_inference_config(), generate_trt_nodes_num(
attrs, True), 1e-5
attrs, True), 1e-3
def test(self):
self.run_test()
......
......@@ -87,14 +87,14 @@ class TrtConvertUnfold(TrtLayerAutoScanTest):
self.trt_param.precision = paddle_infer.PrecisionType.Float32
yield self.create_inference_config(), (0, 3), 1e-5
self.trt_param.precision = paddle_infer.PrecisionType.Half
yield self.create_inference_config(), (0, 3), 1e-5
yield self.create_inference_config(), (0, 3), 1e-3
# for dynamic_shape
generate_dynamic_shape(attrs)
self.trt_param.precision = paddle_infer.PrecisionType.Float32
yield self.create_inference_config(), (1, 2), 1e-5
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 test(self):
self.run_test()
......
......@@ -101,7 +101,7 @@ class TrtConvertSplitTest(TrtLayerAutoScanTest):
attrs, False), 1e-5
self.trt_param.precision = paddle_infer.PrecisionType.Half
yield self.create_inference_config(), generate_trt_nodes_num(
attrs, False), 1e-5
attrs, False), 1e-3
# for dynamic_shape
generate_dynamic_shape(attrs)
......@@ -110,7 +110,7 @@ class TrtConvertSplitTest(TrtLayerAutoScanTest):
attrs, True), 1e-5
self.trt_param.precision = paddle_infer.PrecisionType.Half
yield self.create_inference_config(), generate_trt_nodes_num(
attrs, True), 1e-5
attrs, True), 1e-3
def add_skip_trt_case(self):
pass
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册