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

add replace enforce with glog switch for debug #11244

Merged
merged 3 commits into from
Jun 30, 2018

Conversation

Superjomn
Copy link
Contributor

@Superjomn Superjomn commented Jun 6, 2018

the PADDLE_ENFORCE's exception

image

GLOG error:

image

with gdb, there is

image

The more clear error stack with line number is provided, easier for debugging.

@Superjomn Superjomn changed the title add replace enforce with glog switch for debug WIP add replace enforce with glog switch for debug Jun 7, 2018
@jacquesqiao
Copy link
Member

Please run with gdb and enforce and see if we can also see the message with line number.

@tensor-tang
Copy link
Contributor

We can get the line message if we have the core dump file.

Only we use root or docker to generate this file.

@Superjomn
Copy link
Contributor Author

Superjomn commented Jun 7, 2018

Run the program in gdb with exception cannot get any call stack calling bt command. @jacquesqiao

@Superjomn Superjomn changed the title WIP add replace enforce with glog switch for debug add replace enforce with glog switch for debug Jun 30, 2018
Copy link
Contributor

@luotao1 luotao1 left a comment

Choose a reason for hiding this comment

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

LGTM!

@@ -131,6 +132,10 @@ if (NOT DEFINED WITH_MKLDNN)
set(WITH_MKLDNN OFF)
endif()
endif()

if (REPLACE_ENFORCE_GLOG)
Copy link
Contributor

Choose a reason for hiding this comment

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

put into configure.cmake?

@@ -212,6 +238,9 @@ inline void throw_on_error(T e) {
__FILE__, __LINE__); \
} \
} while (false)
#else
#define PADDLE_ENFORCE(...) ::paddle::platform::throw_on_error(__VA_ARGS__);
Copy link
Contributor

Choose a reason for hiding this comment

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

这个地方为何去掉了try, catch部分?

@@ -84,7 +84,7 @@ void Fprintf(std::ostream& out, const char* fmt, const Args&... args) {
}

template <typename... Args>
std::string Sprintf(const char* fmt, const Args&... args) {
std::string Sprintf(const char* fmt = "", const Args&... args) {
Copy link
Contributor

Choose a reason for hiding this comment

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

默认参数一般是最后一个吧?

@Superjomn Superjomn merged commit 28172bb into PaddlePaddle:develop Jun 30, 2018
@Superjomn Superjomn deleted the feature/glog branch June 30, 2018 12:34
kuke pushed a commit to kuke/Paddle that referenced this pull request Aug 25, 2018
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.

5 participants