anandj91 commented on a change in pull request #15124: [MXNET-1294]
Priority-based parameter propagation for improved data parallel training
throughput
URL: https://github.com/apache/incubator-mxnet/pull/15124#discussion_r370455732
##########
File path: python/mxnet/kvstore/kvstore.py
##########
@@ -104,8 +104,22 @@ def broadcast(self, key, value, out, priority=0):
[ 2. 2. 2.]]
"""
- self.init(key, value)
- self.pull(key, out=out, priority=priority)
+ cvkeys, cvals, use_str_keys = _ctype_key_value(key, value)
+ if out is not None:
+ cokeys, couts, _ = _ctype_key_value(key, out)
+ else:
+ cokeys = cvkeys
+ couts = cvals
+
+ if use_str_keys:
+ check_call(_LIB.MXKVStoreBroadcastEx(
+ self.handle, mx_uint(len(cvkeys)), cvkeys,
mx_uint(len(cokeys)), cokeys,
+ cvals, couts, ctypes.c_int(priority)))
+ else:
+ check_call(_LIB.MXKVStoreBroadcast(
+ self.handle, mx_uint(len(cvkeys)), cvkeys,
mx_uint(len(cokeys)), cokeys,
+ cvals, couts, ctypes.c_int(priority)))
+
Review comment:
the register(klass) function uses klass.__name__ as the name of the kvstore.
So I guess we need to register multiple classes for dist_p3, dist_device_p3. On
the other hand, if we are going with my suggestion in the previous comment, we
won't even be having a name for the new kvstore.
I'll get back to this once we finalize what to do with the previous issue.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services