Skip to content

Commit

Permalink
Reorder module import orders for dist-kvstore (apache#13742)
Browse files Browse the repository at this point in the history
* Reorder module import orders for dist-kvstore

* more code comments
  • Loading branch information
eric-haibin-lin authored and rondogency committed Jan 9, 2019
1 parent 185badc commit 11ea4b8
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion python/mxnet/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@
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
Expand Down Expand Up @@ -82,3 +81,11 @@
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

0 comments on commit 11ea4b8

Please sign in to comment.