You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by ha...@apache.org on 2018/12/29 23:26:39 UTC

[incubator-mxnet] branch master updated: Reorder module import orders for dist-kvstore (#13742)

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 812b06a  Reorder module import orders for dist-kvstore (#13742)
812b06a is described below

commit 812b06a4f29e84a068767b56afdbfd0e1408fcaf
Author: Haibin Lin <li...@gmail.com>
AuthorDate: Sat Dec 29 15:26:22 2018 -0800

    Reorder module import orders for dist-kvstore (#13742)
    
    * Reorder module import orders for dist-kvstore
    
    * more code comments
---
 python/mxnet/__init__.py | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/python/mxnet/__init__.py b/python/mxnet/__init__.py
index e960829..374a3b5 100644
--- a/python/mxnet/__init__.py
+++ b/python/mxnet/__init__.py
@@ -54,7 +54,6 @@ from . import callback
 from . import lr_scheduler
 # use mx.kv as short for kvstore
 from . import kvstore as kv
-from . import kvstore_server
 # Runtime compile module
 from . import rtc
 # Attribute scope to add attributes to symbolic graphs
@@ -82,3 +81,11 @@ from . import rnn
 from . import gluon
 
 __version__ = base.__version__
+
+# Dist kvstore module which launches a separate process when role is set to "server".
+# This should be done after other modules are initialized.
+# Otherwise this may result in errors when unpickling custom LR scheduler/optimizers.
+# For example, the LRScheduler in gluoncv depends on a specific version of MXNet, and
+# checks the __version__ attr of MXNet, which is not set on kvstore server due to the
+# fact that kvstore-server module is imported before the __version__ attr is set.
+from . import kvstore_server