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

[CodeStyle] Add CI for checking enable_to_static in related test files #60037

Merged
merged 14 commits into from
Dec 15, 2023
Merged

[CodeStyle] Add CI for checking enable_to_static in related test files #60037

merged 14 commits into from
Dec 15, 2023

Conversation

DrRyanHuang
Copy link
Member

@DrRyanHuang DrRyanHuang commented Dec 15, 2023

PR types

Others

PR changes

Others

Description

添加阻止在单测中使用 paddle.jit.enable_to_static 的 CI。

Copy link

paddle-bot bot commented Dec 15, 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.

@paddle-bot paddle-bot bot added the contributor External developers label Dec 15, 2023
@SigureMo
Copy link
Member

可以在 CI 上测一下:

  • 使用 enable_to_static 会报错
  • 不使用不报错

@DrRyanHuang
Copy link
Member Author

✅验证单测中有 enable_to_static 会报错

2023-12-15 17:22:33 +++ b/test/legacy_test/test_data.py + paddle.jit.enable_to_static(True) + paddle.jit.enable_to_static(False) +
2023-12-15 17:22:33 + paddle.jit.enable_to_static(True) + paddle.jit.enable_to_static(False)
2023-12-15 17:22:33 /home/Paddle/tools/check_file_diff_approvals.sh: line 398: paddle.jit.enable_to_static: command not found
2023-12-15 17:22:33 /home/Paddle/tools/check_file_diff_approvals.sh: line 398: enable_to_static_guard: command not found
2023-12-15 17:22:41 ****************
2023-12-15 17:22:41 0. You must have one RD (SigureMo, Aurelius84 or 2742195759) approval for using , we recommend using  in the related test files.
2023-12-15 17:22:41 There are 1 approved errors.
2023-12-15 17:22:41 ****************

image

@SigureMo
Copy link
Member

image

Comment on lines 6225 to 6228
"""
paddle.jit.enable_to_static(True)
paddle.jit.enable_to_static(False)
if x.dtype not in [
Copy link
Member Author

Choose a reason for hiding this comment

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

✅验证非单测中有 enable_to_static 不会报错

2023-12-15 17:38:01 DEPS_PHI_IN_IR:
2023-12-15 17:38:02 ****************-----------------
2023-12-15 17:38:02 ****************-----------------
2023-12-15 17:38:03 Requirement already satisfied: PyGithub in /home/v_duchun/anaconda3/lib/python3.8/site-packages (1.57)

image

Comment on lines 75 to 80

paddle.jit.enable_to_static(True)
paddle.jit.enable_to_static(False)


if __name__ == "__main__":
Copy link
Member Author

Choose a reason for hiding this comment

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

✅验证单测中有 enable_to_static 会报错

2023-12-15 17:52:52 ****************-----------------
2023-12-15 17:52:52 +++ b/test/legacy_test/test_data.py + paddle.jit.enable_to_static(True) + paddle.jit.enable_to_static(False) +
2023-12-15 17:52:52 + paddle.jit.enable_to_static(True) + paddle.jit.enable_to_static(False)
2023-12-15 17:52:52 ****************-----------------
2023-12-15 17:53:25 ****************
2023-12-15 17:53:25 0. You must have one RD (SigureMo, Aurelius84 or 2742195759) approval for using 'paddle.jit.enable_to_static', we recommend using 'enable_to_static_guard' in the related test files.
2023-12-15 17:53:25 There are 1 approved errors.
2023-12-15 17:53:25 ****************

image
image

Copy link
Member

@SigureMo SigureMo left a comment

Choose a reason for hiding this comment

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

LGTMeow

@SigureMo SigureMo merged commit e9be89f into PaddlePaddle:develop Dec 15, 2023
29 checks passed
@DrRyanHuang DrRyanHuang deleted the ryan/codestyle branch December 15, 2023 19:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contributor External developers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants