-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
[Dy2St]Add backend for to_static API #52596
Conversation
你的PR提交成功,感谢你对开源项目的贡献! |
… add-backend-simple
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
two more comments
python/paddle/jit/dy2static/utils.py
Outdated
|
||
|
||
@signature_safe_contextmanager | ||
def dy2st_prim_guard(backend): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
backend_guard is more self explained name
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
现在这个guard只是在切换prim的状态,现在的dy2st_prim_guard是不是更具体一些?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
我是你这个部分本意是根据backend修改状态,其实不应该叫dy2st_prim_guard
,而应该叫backend_grad
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
已修改,感谢~
PrimHooker(concrete_program.main_program) | ||
) | ||
with dy2st_prim_guard(backend): | ||
if core._is_fwd_prim_enabled() and not _in_amp_guard(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove _in_amp_guard
since, AMP O1 is supported in pr PR 52598
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里已经merge develop,解决了冲突,感谢~
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Please note that Chinese documents(for official website use) should also be modified. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
已提PR修改中文文档,文档的PR链接已经在PR描述中,感谢 |
out2 = self.forward(x, None) | ||
np.testing.assert_allclose(out1, out2, rtol=1e-6) | ||
|
||
def forward(self, x, beckend=None): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
我下面提个PR再修改,感谢~
input_spec=None, | ||
build_strategy=None, | ||
backend=None, | ||
**kwargs, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
property
参数从positional/keyword arg 皆可, 改成了 keyword-only arg,是不兼容升级了。
检查过其影响吗?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
property参数目前只有语音套件会使用,已经和语音侧同步,语音侧使用方式都是通过k=v的方式传入该参数,所以对主框架以及套件不会产生其他影响。不兼容升级的邮件已经发送,评委已经通过
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
PR types
New features
PR changes
APIs
Describe
Add backend for to_static API
中文文档修改PR:PaddlePaddle/docs#5793
PCard-66972