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

Refactor Dygraph Flags #40786

Merged
merged 24 commits into from
Mar 25, 2022
Merged

Conversation

JiabinYang
Copy link
Contributor

@JiabinYang JiabinYang commented Mar 21, 2022

PR types

Function optimization

PR changes

Others

Describe

为了动态图可以方便转正 这边重构了python端对于dygraph_mode和eager_mode的判断目的有两个1. 让eager在dygraph_mode下直接成为默认模式(依赖全局变量)不进行额外的二次判断 2. 修改test_eager_guard使其可以支持从eager->fluid,再从fluid->eager 这个修改较大 对于yaml迁移的同学来说 主要关注的是对于计算型api从
37c5db19023c3b02da1e1dc3329ca8c6
的调用形式变成了
cc7b9bcef05fd44914442763ef02ecfa
具体flag的关系我在fluild/framework.py最开始做了注释解释。简单来说是将执行机制在python分成static和non_static通过_non_static_mode来判断,这里_non_static_mode等同于从前in_dygraph_mode的功能。而在_non_static_mode下区分是否是_in_legacy_dygraph如果是则运行老动态图,否则运行新动态图,而原来的in_dygraph_mode将作为进入新动态图执行模式的判断等同于之前in_eager_mode的功能呢,而之前的in_eager_mode将删除。

@paddle-bot-old
Copy link

你的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.

@JiabinYang JiabinYang changed the title 【WIP】Refactor Dygraph Flags Refactor Dygraph Flags Mar 24, 2022
Copy link
Contributor

@TCChenlong TCChenlong left a comment

Choose a reason for hiding this comment

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

LGTM
TODO:Fix docs

Copy link
Contributor

@wanghuancoder wanghuancoder left a comment

Choose a reason for hiding this comment

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

LGTM

@phlrain phlrain self-requested a review March 25, 2022 02:13
Copy link
Contributor

@XieYunshen XieYunshen left a comment

Choose a reason for hiding this comment

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

LGTM
设置单测超时时间

Copy link
Contributor

@XiaoguangHu01 XiaoguangHu01 left a comment

Choose a reason for hiding this comment

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

LGTM

@wanghuancoder wanghuancoder merged commit 3085d5e into PaddlePaddle:develop Mar 25, 2022
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.

6 participants