mxnet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] ashokei commented on a change in pull request #10616: ensure same mkldnn engine is used for consistency
Date Thu, 26 Apr 2018 20:36:27 GMT
ashokei commented on a change in pull request #10616: ensure same mkldnn engine is used for
consistency
URL: https://github.com/apache/incubator-mxnet/pull/10616#discussion_r184280082
 
 

 ##########
 File path: tests/python/mkl/test_mkldnn.py
 ##########
 @@ -89,6 +91,33 @@ def get_tensors(args, shapes, ctx):
     except:  # pylint: disable=bare-except
         assert 0, "test_mkldnn_model exception in bind and execution"
 
+def test_mkldnn_engine_threading():
+    """
+    This test will trigger mkldnn engine on different thread of execution
+    """
+
+    import mxnet as mx
+    from mxnet import gluon, nd
+
+    net = gluon.nn.HybridSequential()
+    with net.name_scope():
+        net.add(gluon.nn.Conv2D(channels=32, kernel_size=3, activation=None))
+    net.collect_params().initialize(ctx=mx.cpu())
+
+    val_data = gluon.data.DataLoader(
+        gluon.data.vision.CIFAR10(train=False),
+        batch_size=32, shuffle=False, num_workers=1)
 
 Review comment:
   actually, the dataloader is the one that triggers different thread context, i tried without
a dataloader (or even if i pass num_workers = 0 to above dataloader) it runs on same thread,
so bug wont happen. Gluon DataLoader allows us to create a new thread as it iterates over
data batch.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message