You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by pt...@apache.org on 2019/11/21 23:49:24 UTC

[incubator-mxnet] branch v1.6.x updated: Fix test_gluon.py:test_sync_batchnorm when number of GPUS > 4 (#16835)

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

ptrendx pushed a commit to branch v1.6.x
in repository https://gitbox.apache.org/repos/asf/incubator-mxnet.git


The following commit(s) were added to refs/heads/v1.6.x by this push:
     new 33a3af9  Fix test_gluon.py:test_sync_batchnorm when number of GPUS > 4 (#16835)
33a3af9 is described below

commit 33a3af9aa5e1d41e6effb890f7d73e1302e52703
Author: Pedro Larroy <pe...@gmail.com>
AuthorDate: Thu Nov 21 15:48:41 2019 -0800

    Fix test_gluon.py:test_sync_batchnorm when number of GPUS > 4 (#16835)
---
 tests/python/unittest/test_gluon.py | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/tests/python/unittest/test_gluon.py b/tests/python/unittest/test_gluon.py
index 5d15b27..05ffb15 100644
--- a/tests/python/unittest/test_gluon.py
+++ b/tests/python/unittest/test_gluon.py
@@ -868,11 +868,13 @@ def test_sync_batchnorm():
 
     cfgs = [(1, False)]
     num_gpus = mx.context.num_gpus()
+    batch_size = 24
     for i in range(1, num_gpus + 1):
-        cfgs.append((i, True))
+        if batch_size % i == 0:
+            cfgs.append((i, True))
     for ndev, cuda in cfgs:
         # check with unsync version
-        for shape in [(24, 2), (24, 3, 4), (24, 4, 4, 4), (24, 5, 6, 4, 4)]:
+        for shape in [(batch_size, 2), (batch_size, 3, 4), (batch_size, 4, 4, 4), (batch_size, 5, 6, 4, 4)]:
             print(str((ndev, cuda, shape)))
             for i in range(10):
                 _check_batchnorm_result(mx.nd.random.uniform(shape=shape,