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

[AMP OP&Test] add bf16 fp16 test case for interpolate #51160

Merged
merged 12 commits into from Mar 29, 2023

Conversation

Courtesy-Xs
Copy link
Contributor

PR types

Others

PR changes

OPs

Describe

add bf16 fp16 test case for interpolate

@paddle-bot
Copy link

paddle-bot bot commented Mar 3, 2023

你的PR提交成功,感谢你对开源项目的贡献!
请关注后续CI自动化测试结果,详情请参考Paddle-CI手册
Your PR has been submitted. Thanks for your contribution!
Please wait for the result of CI firstly. See Paddle CI Manual for details.

@Courtesy-Xs Courtesy-Xs marked this pull request as draft March 6, 2023 09:03
@Courtesy-Xs Courtesy-Xs marked this pull request as ready for review March 6, 2023 09:03
@@ -329,6 +331,356 @@ def init_test_case(self):
self.align_corners = False


class TestBicubicInterpOpFP16(OpTest):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

将TestBicubicInterpOp 中的dtype单独拿出来设置,FP16可以直接继承TestBicubicInterpOp,避免过多重复代码

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

self.outputs = {'Out': output_np}

def test_check_output(self):
if platform.system() == "Linux":
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个分支不用写吧,默认值也不用显式设置

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

'Out',
in_place=True,
check_eager=True,
max_relative_error=1e-2,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

同上

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@Courtesy-Xs Courtesy-Xs marked this pull request as draft March 10, 2023 02:28
@Courtesy-Xs Courtesy-Xs marked this pull request as ready for review March 10, 2023 02:29
@Courtesy-Xs Courtesy-Xs marked this pull request as draft March 10, 2023 04:54
@Courtesy-Xs Courtesy-Xs marked this pull request as ready for review March 10, 2023 04:54
@Courtesy-Xs Courtesy-Xs marked this pull request as draft March 10, 2023 06:14
@Courtesy-Xs Courtesy-Xs marked this pull request as ready for review March 10, 2023 06:15
@Courtesy-Xs Courtesy-Xs marked this pull request as draft March 20, 2023 11:49
@Courtesy-Xs Courtesy-Xs marked this pull request as ready for review March 20, 2023 11:49
@ZzSean ZzSean changed the title add bf16 fp16 test case for interpolate [AMP OP&Test] add bf16 fp16 test case for interpolate Mar 27, 2023


class TestBicubicInterpOpFP16(TestBicubicInterpOp):
def test_check_output(self):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fp16默认为1e-3,无需设置

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

self.outputs = {'Out': convert_float_to_uint16(output_np)}

def test_check_output(self):
self.check_output(check_dygraph=self.check_dygraph, atol=1e-2)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bf16 的atol默认为1e-2,无需设置

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

'Out',
in_place=True,
check_dygraph=self.check_dygraph,
max_relative_error=1e-2,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

同上

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

['X'],
'Out',
in_place=True,
max_relative_error=1e-2,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

可以尝试默认值是否可以通过

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Copy link
Contributor

@ZzSean ZzSean left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@zkh2016 zkh2016 merged commit df42355 into PaddlePaddle:develop Mar 29, 2023
24 of 25 checks passed
@Courtesy-Xs Courtesy-Xs deleted the interp_test branch July 7, 2023 03:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants