-
Notifications
You must be signed in to change notification settings - Fork 5.9k
【Fix PIR Unittest】fix some public API and inference UT in pir #66481
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
Conversation
|
你的PR提交成功,感谢你对开源项目的贡献! |
| var_desc.set_shape(tensor_config.shape) | ||
| with paddle.pir_utils.OldIrGuard(): | ||
| main_program_desc = core.ProgramDesc() | ||
| # util_program = base.Program() |
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.
done
| var_desc.set_type(core.VarDesc.VarType.LOD_TENSOR) | ||
| var_desc.set_dtype(convert_np_dtype_to_proto_type(tensor_config.dtype)) | ||
| var_desc.set_shape(tensor_config.shape) | ||
| with paddle.pir_utils.OldIrGuard(): |
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.
我们需要修复PIR模式下的问题单测,但使用OldIrGuard的方式相当于切换回了旧IR运行,自然不会报错,未来OldIr会下线,那这个时候这个单测该怎么处理呢?所以我觉得需要搞清楚问题单测是否真正需要在PIR模式下运行,如果测试内容不需要的话,可以将单测迁移至deprecated目录下后续废弃掉
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.
目前讨论的方式是对于未来新加入的pir API及pass建议使用新的inference 单测API和开发方式,目前针对于推全中用于旧IR的pass和API暂时以OldIrGuard的方式支持,后续可以考虑再迁移到新的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.
我们需要修复PIR模式下的问题单测,但使用OldIrGuard的方式相当于切换回了旧IR运行,自然不会报错,未来OldIr会下线,那这个时候这个单测该怎么处理呢?所以我觉得需要搞清楚问题单测是否真正需要在PIR模式下运行,如果测试内容不需要的话,可以将单测迁移至deprecated目录下后续废弃掉
这些单测目前不需要在PIR下运行,但仍暂时保留这些单测
| if feed_data[name]["lod"] is not None: | ||
| input_tensor.set_lod(feed_data[name]["lod"]) | ||
| predictor.run() | ||
| with paddle.pir_utils.OldIrGuard(): |
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.
同下
…Paddle#66481) * 【Fix PIR Unittest】fix some public API and inference UT in pir * fix test_mkldnn_conv_gelu_fuse_pass_pir time_out
…Paddle#66481) * 【Fix PIR Unittest】fix some public API and inference UT in pir * fix test_mkldnn_conv_gelu_fuse_pass_pir time_out
PR Category
Inference
PR Types
Bug fixes
Description
test/ir/inference/ 下大部分单测依赖于create_fake_model()和run_test_config()等公共API来构建,公共API使用了PIR不支持的旧IR接口导致PIR模式下大量单测运行失败。
pr使用with paddle.pir_utils.OldIrGuard():使得API能够在PIR模式下运行。
PIR模式下已验证修复10个单测,其余inference下单测可基于修改进行验证。
card-71500