diff --git a/python/mxnet/gluon/contrib/estimator/batch_processor.py b/python/mxnet/gluon/contrib/estimator/batch_processor.py index aa5adbfdea5f..5545a7678bcf 100644 --- a/python/mxnet/gluon/contrib/estimator/batch_processor.py +++ b/python/mxnet/gluon/contrib/estimator/batch_processor.py @@ -21,6 +21,7 @@ from ...utils import split_and_load from .... import autograd +from .... import npx __all__ = ['BatchProcessor'] @@ -102,4 +103,6 @@ def fit_batch(self, estimator, for l in loss: l.backward() + npx.waitall() + return data, label, pred, loss diff --git a/tests/nightly/estimator/test_sentiment_rnn.py b/tests/nightly/estimator/test_sentiment_rnn.py index 8d1a44d71baf..311e4277179e 100644 --- a/tests/nightly/estimator/test_sentiment_rnn.py +++ b/tests/nightly/estimator/test_sentiment_rnn.py @@ -264,6 +264,7 @@ def test_estimator_gpu(): num_hiddens, num_layers = 100, 2 net = BiRNN(vocab, embed_size, num_hiddens, num_layers) net.initialize(mx.init.Xavier(), ctx=ctx) + net.hybridize() glove_embedding = text.embedding.create( 'glove', pretrained_file_name='glove.6B.100d.txt', vocabulary=vocab) diff --git a/tests/nightly/test_kvstore.py b/tests/nightly/test_kvstore.py index 54801c2fbdee..aaed7055cf91 100755 --- a/tests/nightly/test_kvstore.py +++ b/tests/nightly/test_kvstore.py @@ -100,7 +100,7 @@ def as_float32(s): def test_kvstore(kv_type, stype): print(kv_type) kv = mx.kv.create(kv_type) - kv.set_optimizer(mx.optimizer.create('test', rescale_grad=lr)) + kv.set_optimizer(mx.optimizer.create('test', learning_rate=-lr)) for k, s in zip(keys, shapes): kv.init(k, mx.nd.zeros(s)) @@ -130,7 +130,7 @@ def test_compress_kvstore(kv_type, compression='2bit', threshold=0.5): raise RuntimeError("Unknown gradient compression type!") kv = mx.kv.create(kv_type) kv.set_gradient_compression({'type':compression, 'threshold':threshold}) - kv.set_optimizer(mx.optimizer.create('test', rescale_grad=rate)) + kv.set_optimizer(mx.optimizer.create('test', learning_rate=-rate)) for k, s in zip(keys, shapes): kv.init(k, mx.nd.zeros(s)) # init one key with 1s so we can check if it was compressed during init @@ -297,7 +297,7 @@ def check_compr_random(kv, threshold): def test_group_kvstore(kv_type, stype): print(kv_type) kv = mx.kv.create(kv_type) - kv.set_optimizer(mx.optimizer.create('test', rescale_grad=lr)) + kv.set_optimizer(mx.optimizer.create('test', learning_rate=-lr)) kv.init(keys, [mx.nd.zeros(s) for s in shapes]) res = [np.zeros(s) for s in shapes] out = [[mx.nd.zeros(s, mx.gpu(g)) for g in range(nworker)] for s in shapes] diff --git a/tests/nightly/test_np_large_array.py b/tests/nightly/test_np_large_array.py index fa103fdce699..c5f2a8fe4e6e 100644 --- a/tests/nightly/test_np_large_array.py +++ b/tests/nightly/test_np_large_array.py @@ -642,6 +642,7 @@ def test_shares_memory(): assert out == False and out2 == True @use_np +@pytest.mark.skip(reason='times out (20 mins)') def test_where(): inp1 = np.zeros((2, INT_OVERFLOW)) inp1[-1, -1] = 1