Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ def generate_trt_nodes_num(attrs, dynamic_shape):
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)
Expand All @@ -158,7 +158,7 @@ def generate_trt_nodes_num(attrs, dynamic_shape):
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
Expand Down Expand Up @@ -251,7 +251,7 @@ def clear_dynamic_shape():
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
Expand Down Expand Up @@ -402,7 +402,7 @@ def clear_dynamic_shape():
self.trt_param.precision = paddle_infer.PrecisionType.Float32
yield self.create_inference_config(), (4, 3), 1e-5
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):
pass
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ def generate_trt_nodes_num(attrs, dynamic_shape):
attrs, False), (1e-5, 1e-5)
self.trt_param.precision = paddle_infer.PrecisionType.Half
yield self.create_inference_config(), generate_trt_nodes_num(
attrs, False), (1e-4, 1e-4)
attrs, False), (1e-3, 1e-3)

# for dynamic_shape
generate_dynamic_shape(attrs)
Expand All @@ -132,7 +132,7 @@ def generate_trt_nodes_num(attrs, dynamic_shape):
attrs, True), (1e-5, 1e-5)
self.trt_param.precision = paddle_infer.PrecisionType.Half
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):
pass
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ def generate_trt_nodes_num(attrs, dynamic_shape):
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)
Expand All @@ -173,7 +173,7 @@ def generate_trt_nodes_num(attrs, dynamic_shape):
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
Expand Down Expand Up @@ -297,7 +297,7 @@ def 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
yield self.create_inference_config(), (1, 2), 1e-3

def add_skip_trt_case(self):
pass
Expand Down Expand Up @@ -409,7 +409,7 @@ def 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
yield self.create_inference_config(), (1, 2), 1e-3

def add_skip_trt_case(self):
pass
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def generate_trt_nodes_num(attrs, dynamic_shape):
attrs, False), 1e-5
self.trt_param.precision = paddle_infer.PrecisionType.Half
yield self.create_inference_config(), generate_trt_nodes_num(
attrs, False), 1e-4
attrs, False), 1e-3

# for dynamic_shape
generate_dynamic_shape(attrs)
Expand All @@ -115,7 +115,7 @@ def generate_trt_nodes_num(attrs, dynamic_shape):
attrs, True), 1e-5
self.trt_param.precision = paddle_infer.PrecisionType.Half
yield self.create_inference_config(), generate_trt_nodes_num(
attrs, True), 1e-4
attrs, True), 1e-3

def test(self):
self.run_test()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ def generate_trt_nodes_num(attrs, dynamic_shape):
attrs, False), 1e-5
self.trt_param.precision = paddle_infer.PrecisionType.Half
yield self.create_inference_config(), generate_trt_nodes_num(
attrs, False), 1e-4
attrs, False), 1e-3

# for dynamic_shape
generate_dynamic_shape(attrs)
Expand All @@ -137,7 +137,7 @@ def generate_trt_nodes_num(attrs, dynamic_shape):
attrs, True), 1e-5
self.trt_param.precision = paddle_infer.PrecisionType.Half
yield self.create_inference_config(), generate_trt_nodes_num(
attrs, True), 1e-4
attrs, True), 1e-3

def test(self):
# TODO(inference): fix.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ def generate_trt_nodes_num(attrs, dynamic_shape):
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)
Expand All @@ -228,7 +228,7 @@ def generate_trt_nodes_num(attrs, dynamic_shape):
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):

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ def generate_trt_nodes_num(attrs, dynamic_shape):
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)
Expand All @@ -124,7 +124,7 @@ def generate_trt_nodes_num(attrs, dynamic_shape):
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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ def generate_trt_nodes_num(attrs, dynamic_shape):
attrs, False), 1e-5
self.trt_param.precision = paddle_infer.PrecisionType.Half
yield self.create_inference_config(), generate_trt_nodes_num(
attrs, False), 1e-4
attrs, False), 1e-3

# for dynamic_shape
generate_dynamic_shape(attrs)
Expand All @@ -110,7 +110,7 @@ def generate_trt_nodes_num(attrs, dynamic_shape):
attrs, True), 1e-5
self.trt_param.precision = paddle_infer.PrecisionType.Half
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]]))
def test(self, *args, **kwargs):
Expand Down