Skip to content

mxnet-gluon example (with RDMA): create gluon data loader before initializing byteps #56

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 1 commit into from
Jul 11, 2019

Conversation

juncgu
Copy link
Contributor

@juncgu juncgu commented Jul 11, 2019

Following #54, the mxnet-gluon example will crash (server crashes in RDMA layer) when byteps uses RDMA (DMLC_ENABLE_RDMA=1).

The example initializes byteps (with RDMA), and then creates gluon data loader (code).

# Initialize BytePS
bps.init()

# BytePS: pin context to local rank
context = mx.cpu(bps.local_rank()) if args.no_cuda else mx.gpu(bps.local_rank())
num_workers = bps.size()

# Load training and validation data
train_data, val_data, train_size = get_mnist_iterator()

As explained by @ymjiang in #54, the default (multi-process) gluon data loader forks from the RDMA process which may lead to unexpected errors (reason). Therefore, one very simple solution is to create gluon data loader before bps.init(), which is included in this PR.

Thank you.

Following bytedance#54, the default gluon data loader forks processes from the RDMA process, which may lead to unexpected errors.
Copy link
Member

@ymjiang ymjiang left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks!

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.

3 participants