Skip to content

Conversation

@lizhenyun01
Copy link
Contributor

@lizhenyun01 lizhenyun01 commented Jul 24, 2024

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

@paddle-bot
Copy link

paddle-bot bot commented Jul 24, 2024

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

var_desc.set_shape(tensor_config.shape)
with paddle.pir_utils.OldIrGuard():
main_program_desc = core.ProgramDesc()
# util_program = base.Program()
Copy link
Contributor

Choose a reason for hiding this comment

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

无效注释可以删掉

Copy link
Contributor Author

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():
Copy link
Contributor

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目录下后续废弃掉

Copy link
Contributor Author

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;至于是否需要废弃可能需要进一步进行讨论分类

Copy link
Contributor

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():
Copy link
Contributor

Choose a reason for hiding this comment

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

同下

@YuanRisheng YuanRisheng merged commit 24a0ec5 into PaddlePaddle:develop Jul 26, 2024
Dale1314 pushed a commit to Dale1314/Paddle that referenced this pull request Jul 28, 2024
…Paddle#66481)

* 【Fix PIR Unittest】fix some public API and inference UT in pir

* fix test_mkldnn_conv_gelu_fuse_pass_pir time_out
lixcli pushed a commit to lixcli/Paddle that referenced this pull request Aug 5, 2024
…Paddle#66481)

* 【Fix PIR Unittest】fix some public API and inference UT in pir

* fix test_mkldnn_conv_gelu_fuse_pass_pir time_out
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.

4 participants