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

Handle horovod errors #24

Merged
merged 8 commits into from
Jan 18, 2019
Merged

Handle horovod errors #24

merged 8 commits into from
Jan 18, 2019

Conversation

yuxihu
Copy link
Collaborator

@yuxihu yuxihu commented Jan 16, 2019

This PR populates error originated in Horovod back to MXNet engine through callback. The error will be thrown in MXNet when a sync action is performed, such as wait_to_read(). This approach has no performance impact. This is dependent on a PR in MXNet.

The approaches using synchronize and C++ future library shows 80~85% performance regression.

Copy link
Collaborator

@apeforest apeforest left a comment

Choose a reason for hiding this comment

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

Left two small comments. Otherwise LGTM

#include "tensor_util.h"

namespace horovod {
namespace mxnet {

static StatusManager status_manager;
Copy link
Collaborator

@apeforest apeforest Jan 16, 2019

Choose a reason for hiding this comment

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

Do we want to move op_count into status_manager and make it a tuple with the last_error like (op_count, last_error). Would it be helpful for debugging?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is a good one. Maybe we can save the name (which contains the op_count) to make it more informative.

Copy link
Owner

@ctcyang ctcyang left a comment

Choose a reason for hiding this comment

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

LGTM. Does this mean MXNet profiler will have data for communication calls too?

@yuxihu
Copy link
Collaborator Author

yuxihu commented Jan 16, 2019

@ctcyang As we discussed offline, MX_API_BEGIN/MX_API_END was used to catch C++ errors and make it possible to throw MXNetError at Python level. It is not profiler related as far as I know.

@alsrgv
Copy link

alsrgv commented Jan 17, 2019

TBH, it seems a bit hacky. This doesn't resolve the situation when the last Horovod operation fails.

I have another idea. I see that this code can push operation in the engine, which may throw dmlc::Error from UniqueImpl.

How would that error be handled? What if our Horovod error handling will enqueue another high-priority operation which will just throw dmlc::Error?

@alsrgv
Copy link

alsrgv commented Jan 17, 2019

New API is way nicer! :-)

@yuxihu
Copy link
Collaborator Author

yuxihu commented Jan 17, 2019

@alsrgv We will trigger the Horovod CI once the dependent PR is merged.

horovod/mxnet/mpi_ops.cc Outdated Show resolved Hide resolved
@yuxihu yuxihu merged commit acd0d3f into mxnet_feature_fp16 Jan 18, 2019
@yuxihu yuxihu deleted the hvd_error branch January 18, 2019 23:15
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