This change notifies MXNet to shutdown in the module destructor of
mxnet.Handle. This reduces the likelihood of crashes due to a race
happening after executing unittests. The race is likely to be caused by
dmxnet interacting with MXNet while MXNet is cleaning up at process exit
(see sociomantic-tsunami/dmxnet#66 for more details).
Note, that it does not seem to eliminate those crashes. It only seems to
reduce it because there still seems to be the possibility of a race
happening until MXNet actually shuts down. In so far, this is only a
measure to reduce the number of these crashes since after all they
happen at process exit anyway. In future, one should look into making
dmxnet always exit properly when running the unittests.
This change notifies MXNet to shutdown in the module destructor of
mxnet.Handle
. This reduces the likelihood of crashes due to a race happening after executing unittests. The race is likely to be caused by dmxnet interacting with MXNet while MXNet is cleaning up at process exit (see sociomantic-tsunami/dmxnet#66 for more details).Note, that it does not seem to eliminate those crashes. It only seems to reduce it because there still seems to be the possibility of a race happening until MXNet actually shuts down. In so far, this is only a measure to reduce the number of these crashes since after all they happen at process exit anyway. In future, one should look into making dmxnet always exit properly when running the unittests.
Part of sociomantic-tsunami/dmxnet#66.