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

【Fix PIR Unittest No.87,89】Fix some test cast in PIR #64487

Merged
merged 7 commits into from
May 24, 2024

Conversation

wanghuancoder
Copy link
Contributor

@wanghuancoder wanghuancoder commented May 21, 2024

PR Category

Execute Infrastructure

PR Types

Bug fixes

Description

Pcard-67164
默认开启PIR模式后,修复2个单测:
test_multiprocess_dataloader_static.py:修复框架中对need_check_feed的使用
test_layers.py:中存在大量废弃API的使用和python/paddle/incubate/layers/nn.py下纯静态图API的使用,进行了隔离。剩余发现一些问题进行了修复:

  1. Python端存在from paddle.static import default_main_program的情况,这时候,PIR的Guard虽然篡改了paddle.static.default_main_program,但是没能篡改各模块catch的default_main_program。这种情况在发版中不会遇到,只有单测切换是才会遇到。没有想到好的解决办法。暂时遇到哪儿改哪儿。
  2. 修改dropout的default_main_program后,暴露了PIR的新问题:
  • 动转静中,构造的新Program需要传递random_seed
  • 很多单测依赖了老静态图Program的global_seed特性,在构造新的Program时,random_seed默认使用global_seed。新PR也需要适配这个特性,否则估计很多单测会挂。但又考虑到其功能并非Program的核心功能,因此在Python C层做了实现。
  1. addmm没有支持pir,做了支持。

关联Issue:#63740

Copy link

paddle-bot bot commented May 21, 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.

@wanghuancoder wanghuancoder changed the title 【Fix PIR Unittest No.81,82,83】Fix some test cast in PIR 【Fix PIR Unittest No.87,89】Fix some test cast in PIR May 21, 2024
@@ -282,6 +282,7 @@ std::string GetValueName(Value value) {
}

void BindProgram(py::module *m) {
static int64_t global_prog_seed = 0;
Copy link
Contributor

Choose a reason for hiding this comment

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

这里感知paddle.seed()里设置的随机种子么?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

不感知,我阅读paddle.seed(),不需要设置这里。只有_manual_program_seed需要~

@wanghuancoder wanghuancoder merged commit 4c0de09 into PaddlePaddle:develop May 24, 2024
32 checks passed
chen2016013 pushed a commit to chen2016013/Paddle that referenced this pull request May 26, 2024
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.

None yet

3 participants