Skip to content

[buaa]【Error Message No.32 No.33】rewrite error message #66957

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

Merged
merged 7 commits into from
Aug 9, 2024

Conversation

crazyxiaoxi
Copy link
Contributor

@crazyxiaoxi crazyxiaoxi commented Aug 2, 2024

PR Category

User Experience

PR Types

others

Description

修改报错信息

Copy link

paddle-bot bot commented Aug 2, 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.

@luotao1 luotao1 added contributor External developers HappyOpenSource Pro 进阶版快乐开源活动,更具挑战性的任务 labels Aug 2, 2024
fix

fix
@@ -992,6 +992,10 @@ void HogwildWorker::CreateThreadScope(const ProgramDesc &program) {
if (stat_var_name_map_.find(name) != stat_var_name_map_.end()) {
Variable *root_var = root_scope_->FindVar(name);
CHECK(root_var != nullptr);
Copy link
Member

Choose a reason for hiding this comment

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

原来的不删一下么?

@@ -992,6 +992,10 @@ void HogwildWorker::CreateThreadScope(const ProgramDesc &program) {
if (stat_var_name_map_.find(name) != stat_var_name_map_.end()) {
Variable *root_var = root_scope_->FindVar(name);
CHECK(root_var != nullptr);
PADDLE_ENFORCE_EQ(
root_var != nullptr,
Copy link
Member

Choose a reason for hiding this comment

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

这里为啥不直接用 PADDLE_ENFORCE_NE

@crazyxiaoxi crazyxiaoxi changed the title 【Error Message No. 32 No.33 BUAA】rewrite error message 【Error Message No. 32 No.33 [BUAA]】rewrite error message Aug 5, 2024
@crazyxiaoxi crazyxiaoxi changed the title 【Error Message No. 32 No.33 [BUAA]】rewrite error message 【Error Message No.32 No.33 [BUAA]】rewrite error message Aug 5, 2024
Copy link
Member

@SigureMo SigureMo left a comment

Choose a reason for hiding this comment

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

使用合适的 PADDLE_ENFORCE 会使报错更友好

@@ -991,7 +991,10 @@ void HogwildWorker::CreateThreadScope(const ProgramDesc &program) {
++persist_total;
if (stat_var_name_map_.find(name) != stat_var_name_map_.end()) {
Variable *root_var = root_scope_->FindVar(name);
CHECK(root_var != nullptr);
PADDLE_ENFORCE_NE(
Copy link
Member

Choose a reason for hiding this comment

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

喔,这里可以直接用 PADDLE_ENFORCE_NOT_NULL

++persist_reset;
}
} else {
auto *ptr = thread_scope_->Var(name);
CHECK(proto::VarType::LOD_TENSOR == var->GetType());
PADDLE_ENFORCE_EQ(proto::VarType::LOD_TENSOR == var->GetType(),
Copy link
Member

Choose a reason for hiding this comment

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

这个 EQ 直接接收 == 两侧的就好了啊

@crazyxiaoxi crazyxiaoxi changed the title 【Error Message No.32 No.33 [BUAA]】rewrite error message [buaa]【Error Message No.32 No.33】rewrite error message Aug 5, 2024
@risemeup1 risemeup1 merged commit c8f5017 into PaddlePaddle:develop Aug 9, 2024
31 checks passed
Jeff114514 pushed a commit to Jeff114514/Paddle that referenced this pull request Aug 14, 2024
…66957)

* first try

fix

fix

* phi

* fix

* fix equal

* fix equal

* unchase test_custom_op_plugin.h

* Update test_custom_op_plugin.h
@crazyxiaoxi crazyxiaoxi deleted the error/fluid1 branch September 14, 2024 08:46
@crazyxiaoxi crazyxiaoxi restored the error/fluid1 branch September 14, 2024 08:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contributor External developers HappyOpenSource Pro 进阶版快乐开源活动,更具挑战性的任务
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants