sociomantic-tsunami / dmxnet

D bindings and wrapper library for the MXNet deep learning library
Boost Software License 1.0
14 stars 11 forks source link

Shutdown MXNet engine after running unittests #72

Closed jens-mueller-sociomantic closed 6 years ago

jens-mueller-sociomantic commented 6 years ago

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.

joseph-wakeling-sociomantic commented 6 years ago

LGTM, we can take in once CI passes.