-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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] pir dy2st unittest verification - Part 2 #58686
Conversation
你的PR提交成功,感谢你对开源项目的贡献! |
def to_pir_api_test(fn): | ||
@wraps(fn) | ||
def impl(*args, **kwargs): | ||
logger.info("[PIR][AST] running pir api") | ||
logger.info("[PIR] running pir api") | ||
ir_outs = None | ||
try: | ||
with paddle.pir_utils.IrGuard(): | ||
paddle.disable_static() | ||
ir_outs = fn(*args, **kwargs) | ||
finally: | ||
paddle.enable_static() | ||
with paddle.pir_utils.IrGuard(): | ||
paddle.disable_static() | ||
ir_outs = fn(*args, **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.
挪到 to_pir_exe_test
下面,相关代码都按照「老 IR」、「中间态」、「最终态」的顺序作为规范
@wraps(fn) | ||
def impl(*args, **kwargs): | ||
logger.info("[PIR] running pir") | ||
logger.info("[PIR] running pir exe") |
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.
logger.info("[PIR] running pir exe") | |
logger.info("[PIR_EXE] running pir exe") |
@wraps(fn) | ||
def impl(*args, **kwargs): | ||
logger.info("[PIR][AST] running pir api") | ||
logger.info("[PIR] running pir api") |
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.
logger.info("[PIR] running pir api") | |
logger.info("[PIR_API] running pir api") |
@@ -284,12 +281,12 @@ def test_legacy_and_pir(fn): | |||
|
|||
|
|||
def test_legacy_and_pir_api(fn): | |||
fn = set_ir_mode(IrMode.LEGACY_IR | IrMode.PIR_API) | |||
fn = set_ir_mode(IrMode.LEGACY_IR | IrMode.PIR_API)(fn) | |||
return fn | |||
|
|||
|
|||
def test_legacy_and_pir_api_and_pir_exe(fn): |
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.
def test_legacy_and_pir_api_and_pir_exe(fn): | |
def test_legacy_and_pir_exe_and_pir_api(fn): |
@@ -360,7 +359,7 @@ def test_to_static(self): | |||
net = ListWithCondNet() |
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.
这个单测为啥没有加任何装饰器?是因为还不能跑通是么
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.
是的这个还不能跑
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.
这个单测……应该有控制流吧,按理说最终态的控制流是还不支持的,这个单测为啥过了呢?我稍后看看
test/dygraph_to_static/test_utils.py
Outdated
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.
这个单测看起来只是测试 utils 功能函数的,所以与 IR 是无关的
但为了保险,我们测一下 legacy 和最终态吧,中间态没必要测
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.
Done
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.
--------- Co-authored-by: SigureMo <[email protected]>
--------- Co-authored-by: SigureMo <[email protected]>
--------- Co-authored-by: SigureMo <[email protected]>
--------- Co-authored-by: SigureMo <[email protected]>
PR types
Others
PR changes
Others
Description
开放部分单测测试
PIR_API
修复
test_legacy_and_pir_api_and_pir_exe
不生成单测的问题修改方法名称:
to_pir_ast_test
->to_pir_api_test
to_pir_test
->to_pir_exe_test
相关链接: