Skip to content

Commit

Permalink
get gluon data loader before bps(RDMA) init
Browse files Browse the repository at this point in the history
Following #54, the default gluon data loader forks processes from the RDMA process, which may lead to unexpected errors.
  • Loading branch information
juncgu authored and ymjiang committed Jul 23, 2019
1 parent 59dbbd6 commit 72e0672
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions example/mxnet-gluon/train_mnist_byteps.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,16 +97,16 @@ def evaluate(model, data_iter, context):
return metric.get()


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

# 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()

# Build model
model = conv_nets()
model.cast(args.dtype)
Expand Down

0 comments on commit 72e0672

Please sign in to comment.