-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Use std::exception as the param in engine complete callback #14911
base: master
Are you sure you want to change the base?
Conversation
@mxnet-label-bot add [pr-work-in-progress] |
@@ -74,15 +74,15 @@ class CallbackOnComplete { | |||
public: | |||
// use implicit copy and assign | |||
/*! \brief involve the callback */ | |||
inline void operator()(const dmlc::Error* error = nullptr) const { | |||
inline void operator()(const std::exception* error = nullptr) const { |
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.
Is this to support horovod to handle non dmlc exceptions ?
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.
No, there is no need for this in Horovod at this moment. dmlc exception is a subclass of std::exception. I feel it is better to be more generic on the interface. Additionally, your recent improvements on exception handling also started to catch a broader range of exceptions using std::exception instead of dmlc::Error.
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.
okay sure.
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.
Is it possible to add a unit test? For example, purposely performing nd.ones((1,) + extremely_small_number
to cause std::stof
to fail?
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.
I changed this place to use this new interface. A lot existing negative test cases have already covered it.
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.
The link was broken. Do you mind sending the link again?
ee563d0
to
48601d8
Compare
@yuxihu Can you please address comments? |
Description
This PR replaces
dmlc::Error
withstd::exception
for the param in engine complete callback functions.Checklist
Essentials
Please feel free to remove inapplicable items for your PR.
Changes
Comments