This is an automated email from the ASF dual-hosted git repository.

haibin pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-mxnet.git


The following commit(s) were added to refs/heads/master by this push:
     new b264f6f  Fix flaky test test_gluon.test_hybrid_static_memory_switching 
(#11577)
b264f6f is described below

commit b264f6f51a5a34c2884e34b7f366f68627237308
Author: Da Zheng <zhengda1...@gmail.com>
AuthorDate: Wed Jul 11 09:49:23 2018 -0700

    Fix flaky test test_gluon.test_hybrid_static_memory_switching (#11577)
    
    * enable tests.
    
    * update tests.
    
    * don't invalidate in AsArray.
    
    * don't invalidate in FC.
    
    * fix.
---
 include/mxnet/ndarray.h             | 3 ---
 src/operator/nn/fully_connected.cc  | 1 -
 tests/python/unittest/test_gluon.py | 4 ++--
 3 files changed, 2 insertions(+), 6 deletions(-)

diff --git a/include/mxnet/ndarray.h b/include/mxnet/ndarray.h
index 039653c..bae3ea9 100644
--- a/include/mxnet/ndarray.h
+++ b/include/mxnet/ndarray.h
@@ -516,9 +516,6 @@ class NDArray {
     ret.shape_ = shape;
     ret.dtype_ = dtype;
     ret.reuse_ = true;
-#if MXNET_USE_MKLDNN == 1
-    ret.InvalidateMKLDNNData();
-#endif
     return ret;
   }
 
diff --git a/src/operator/nn/fully_connected.cc 
b/src/operator/nn/fully_connected.cc
index 48d479c..ed950c0 100644
--- a/src/operator/nn/fully_connected.cc
+++ b/src/operator/nn/fully_connected.cc
@@ -118,7 +118,6 @@ void FullyConnectedComputeExCPU(const nnvm::NodeAttrs& 
attrs,
       }
     }
     // output
-    if (req[0] == kWriteTo) const_cast<NDArray 
&>(outputs[0]).InvalidateMKLDNNData();
     FullyConnectedCompute<cpu>(attrs, ctx, in_blobs, req, {outputs[0].data()});
   } else {
     LogUnimplementedOp(attrs, ctx, inputs, req, outputs);
diff --git a/tests/python/unittest/test_gluon.py 
b/tests/python/unittest/test_gluon.py
index 77c6fe1..2504287 100644
--- a/tests/python/unittest/test_gluon.py
+++ b/tests/python/unittest/test_gluon.py
@@ -1175,7 +1175,7 @@ def check_hybrid_static_memory(**kwargs):
     for key in grads1:
         assert_almost_equal(grads1[key].asnumpy(), grads2[key].asnumpy(), 
rtol=1e-3, atol=1e-5)
 
-@unittest.skip("Flaky test: 
https://github.com/apache/incubator-mxnet/issues/11171";)
+@with_seed()
 def test_hybrid_static_memory():
     check_hybrid_static_memory()
     check_hybrid_static_memory(static_alloc=True)
@@ -1198,7 +1198,7 @@ def check_hybrid_static_memory_switching(**kwargs):
         y.backward()
     mx.nd.waitall()
 
-@unittest.skip("Flaky test: 
https://github.com/apache/incubator-mxnet/issues/11171";)
+@with_seed()
 def test_hybrid_static_memory_switching():
     check_hybrid_static_memory_switching()
     check_hybrid_static_memory_switching(static_alloc=True)

Reply via email to