eric-haibin-lin closed pull request #11577: Fix flaky test 
test_gluon.test_hybrid_static_memory_switching
URL: https://github.com/apache/incubator-mxnet/pull/11577
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/include/mxnet/ndarray.h b/include/mxnet/ndarray.h
index d3f44404fd8..b3ea99cb7f7 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 48d479ccf60..ed950c016dd 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 43777bb8032..eb283440de9 100644
--- a/tests/python/unittest/test_gluon.py
+++ b/tests/python/unittest/test_gluon.py
@@ -1174,7 +1174,7 @@ def test(net, x):
     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)
@@ -1197,7 +1197,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)


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to