piiswrong commented on a change in pull request #7585: Add string interface to 
updater to make it consistent with kvstore
URL: https://github.com/apache/incubator-mxnet/pull/7585#discussion_r135154045
 
 

 ##########
 File path: src/kvstore/kvstore_local.h
 ##########
 @@ -84,30 +86,7 @@ class KVStoreLocal : public KVStore {
   void Push(const std::vector<int>& keys,
             const std::vector<NDArray>& values,
             int priority) override {
-    std::vector<int> uniq_keys;
-    std::vector<std::vector<NDArray> > grouped_vals;
-    GroupKVPairsPush(keys, values, &uniq_keys, &grouped_vals);
-
-    for (size_t i = 0; i < uniq_keys.size(); ++i) {
-      int key = uniq_keys[i];
-      const NDArray& merged = comm_->Reduce(key, grouped_vals[i], priority);
-      NDArray& local = local_[key];
-      if (updater_ != nullptr) {
-        CHECK(!local.is_none()) << "key " << key << " has not been inited";
-        // if merged is on gpu, we may need copy weight from cpu to gpu
-        if (merged.ctx().dev_mask() != cpu::kDevMask &&
-            local.ctx().dev_mask() == cpu::kDevMask) {
-          local = local.Copy(merged.ctx());
-        }
-        updater_(key, merged,  &local);
-      } else {
-        if (merged.storage_type() != local.storage_type()) {
-          local = merged.Copy(local.ctx());
-        } else {
-          local = merged;
-        }
-      }
-    }
+    Push_(keys, values, priority, false);
 
 Review comment:
   Only allow int or str for one kvstore. Cannot use both. Otherwise the keys 
with conflict
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to