{"action":"created","comment":{"url":"https://api.github.com/repos/apache/incubator-singa/pulls/comments/71874589","id":71874589,"diff_hunk":"@@ -0,0 +1,74 @@\n+/**\n+ * Licensed to the Apache Software Foundation (ASF) under one\n+ * or more contributor license agreements.  See the NOTICE file\n+ * distributed with this work for additional information\n+ * regarding copyright ownership.  The ASF licenses this file\n+ * to you under the Apache License, Version 2.0 (the\n+ * \"License\"); you may not use this file except in compliance\n+ * with the License.  You may obtain a copy of the License at\n+ *\n+ *     http://www.apache.org/licenses/LICENSE-2.0\n+ *\n+ * Unless required by applicable law or agreed to in writing, software\n+ * distributed under the License is distributed on an \"AS IS\" BASIS,\n+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+ * See the License for the specific language governing permissions and\n+ * limitations under the License.\n+ */\n+\n+#include \"singa/model/updater.h\"\n+#include <vector>\n+\n+namespace singa {\n+\n+void LocalUpdater::Register(const string& name, const ParamSpec& specs) {\n+  opt_->Register(name, specs);\n+  param_buffer_[name];\n+  param_buffer_[name].ToDevice(dev_);\n+  sum_[name];\n+  sum_[name].ToDevice(dev_);\n+  for (int i = 0; i < total_num_; ++i) {\n+    grad_buffer_[std::make_pair(i, name)];\n+    grad_buffer_[std::make_pair(i, name)].ToDevice(dev_);\n+  }\n+  dev_index_[name] = 0;","path":"src/model/updater/local_updater.cc","position":34,"original_position":34,"commit_id":"4dee27fa602defa97692fb70f0f22fe172657b7b","original_commit_id":"4dee27fa602defa97692fb70f0f22fe172657b7b","user":{"login":"nudles","id":3797447,"avatar_url":"https://avatars.githubusercontent.com/u/3797447?v=3","gravatar_id":"","url":"https://api.github.com/users/nudles","html_url":"https://github.com/nudles","followers_url":"https://api.github.com/users/nudles/followers","following_url":"https://api.github.com/users/nudles/following{/other_user}","gists_url":"https://api.github.com/users/nudles/gists{/gist_id}","starred_url":"https://api.github.com/users/nudles/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nudles/subscriptions","organizations_url":"https://api.github.com/users/nudles/orgs","repos_url":"https://api.github.com/users/nudles/repos","events_url":"https://api.github.com/users/nudles/events{/privacy}","received_events_url":"https://api.github.com/users/nudles/received_events","type":"User","site_admin":false},"body":"add\r\n```\r\nto_updater_finished_[name] = 0;\r\n```\r\ncould avoid the dead-clock.","created_at":"2016-07-22T13:02:48Z","updated_at":"2016-07-22T13:02:48Z","html_url":"https://github.com/apache/incubator-singa/pull/216#discussion_r71874589","pull_request_url":"https://api.github.com/repos/apache/incubator-singa/pulls/216","_links":{"self":{"href":"https://api.github.com/repos/apache/incubator-singa/pulls/comments/71874589"},"html":{"href":"https://github.com/apache/incubator-singa/pull/216#discussion_r71874589"},"pull_request":{"href":"https://api.github.com/repos/apache/incubator-singa/pulls/216"}}},"pull_request":{"url":"https://api.github.com/repos/apache/incubator-singa/pulls/216","id":77922822,"html_url":"https://github.com/apache/incubator-singa/pull/216","diff_url":"https://github.com/apache/incubator-singa/pull/216.diff","patch_url":"https://github.com/apache/incubator-singa/pull/216.patch","issue_url":"https://api.github.com/repos/apache/incubator-singa/issues/216","number":216,"state":"open","locked":false,"title":"SINGA-226 Add parallel training on a single machine for singa v1.0","user":{"login":"ijingo","id":1220005,"avatar_url":"https://avatars.githubusercontent.com/u/1220005?v=3","gravatar_id":"","url":"https://api.github.com/users/ijingo","html_url":"https://github.com/ijingo","followers_url":"https://api.github.com/users/ijingo/followers","following_url":"https://api.github.com/users/ijingo/following{/other_user}","gists_url":"https://api.github.com/users/ijingo/gists{/gist_id}","starred_url":"https://api.github.com/users/ijingo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ijingo/subscriptions","organizations_url":"https://api.github.com/users/ijingo/orgs","repos_url":"https://api.github.com/users/ijingo/repos","events_url":"https://api.github.com/users/ijingo/events{/privacy}","received_events_url":"https://api.github.com/users/ijingo/received_events","type":"User","site_admin":false},"body":"This commit implements a updater class for parallel training\r\nin local-cpu and local-gpu mode. (The mode specification described\r\nin https://issues.apache.org/jira/browse/SINGA-226)\r\n\r\nUpdater class is a wrapper of Optimizer class. It controls the\r\ncommunication pattern among workers. When initializing Updater,\r\nthe user needs to provide the total number of workers and where\r\nthe Updater does aggregation and computation.\r\n\r\nFile changed descibed as follows:\r\n* Put a new folder named cifar-parallel under example, containing\r\n  the single machine multi-gpu parallel training example.\r\n* Replace Optimizer pointer in feed_forward_net class with Updater\r\n  pointer, since Updater is a wrapper of Optimizer. So the compile()\r\n  method is changed accordingly.\r\n* Add a helper function TrainThread() method in feed_forward_net to\r\n  launch a training thread.\r\n* Adapt alexnet.cc original cifar10 example to support the new compile()\r\n* Fixed a bug in memory.cc which happens during initialzing cnmem\r\n  memory pool","created_at":"2016-07-19T06:15:58Z","updated_at":"2016-07-22T13:02:48Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c74f4e8e54e3073280c606d0013cf0eacd87bc5c","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/apache/incubator-singa/pulls/216/commits","review_comments_url":"https://api.github.com/repos/apache/incubator-singa/pulls/216/comments","review_comment_url":"https://api.github.com/repos/apache/incubator-singa/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apache/incubator-singa/issues/216/comments","statuses_url":"https://api.github.com/repos/apache/incubator-singa/statuses/4dee27fa602defa97692fb70f0f22fe172657b7b","head":{"label":"ijingo:dev-parallel","ref":"dev-parallel","sha":"4dee27fa602defa97692fb70f0f22fe172657b7b","user":{"login":"ijingo","id":1220005,"avatar_url":"https://avatars.githubusercontent.com/u/1220005?v=3","gravatar_id":"","url":"https://api.github.com/users/ijingo","html_url":"https://github.com/ijingo","followers_url":"https://api.github.com/users/ijingo/followers","following_url":"https://api.github.com/users/ijingo/following{/other_user}","gists_url":"https://api.github.com/users/ijingo/gists{/gist_id}","starred_url":"https://api.github.com/users/ijingo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ijingo/subscriptions","organizations_url":"https://api.github.com/users/ijingo/orgs","repos_url":"https://api.github.com/users/ijingo/repos","events_url":"https://api.github.com/users/ijingo/events{/privacy}","received_events_url":"https://api.github.com/users/ijingo/received_events","type":"User","site_admin":false},"repo":{"id":40753066,"name":"incubator-singa","full_name":"ijingo/incubator-singa","owner":{"login":"ijingo","id":1220005,"avatar_url":"https://avatars.githubusercontent.com/u/1220005?v=3","gravatar_id":"","url":"https://api.github.com/users/ijingo","html_url":"https://github.com/ijingo","followers_url":"https://api.github.com/users/ijingo/followers","following_url":"https://api.github.com/users/ijingo/following{/other_user}","gists_url":"https://api.github.com/users/ijingo/gists{/gist_id}","starred_url":"https://api.github.com/users/ijingo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ijingo/subscriptions","organizations_url":"https://api.github.com/users/ijingo/orgs","repos_url":"https://api.github.com/users/ijingo/repos","events_url":"https://api.github.com/users/ijingo/events{/privacy}","received_events_url":"https://api.github.com/users/ijingo/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ijingo/incubator-singa","description":"Mirror of Apache Singa (Incubating)","fork":true,"url":"https://api.github.com/repos/ijingo/incubator-singa","forks_url":"https://api.github.com/repos/ijingo/incubator-singa/forks","keys_url":"https://api.github.com/repos/ijingo/incubator-singa/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ijingo/incubator-singa/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ijingo/incubator-singa/teams","hooks_url":"https://api.github.com/repos/ijingo/incubator-singa/hooks","issue_events_url":"https://api.github.com/repos/ijingo/incubator-singa/issues/events{/number}","events_url":"https://api.github.com/repos/ijingo/incubator-singa/events","assignees_url":"https://api.github.com/repos/ijingo/incubator-singa/assignees{/user}","branches_url":"https://api.github.com/repos/ijingo/incubator-singa/branches{/branch}","tags_url":"https://api.github.com/repos/ijingo/incubator-singa/tags","blobs_url":"https://api.github.com/repos/ijingo/incubator-singa/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ijingo/incubator-singa/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ijingo/incubator-singa/git/refs{/sha}","trees_url":"https://api.github.com/repos/ijingo/incubator-singa/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ijingo/incubator-singa/statuses/{sha}","languages_url":"https://api.github.com/repos/ijingo/incubator-singa/languages","stargazers_url":"https://api.github.com/repos/ijingo/incubator-singa/stargazers","contributors_url":"https://api.github.com/repos/ijingo/incubator-singa/contributors","subscribers_url":"https://api.github.com/repos/ijingo/incubator-singa/subscribers","subscription_url":"https://api.github.com/repos/ijingo/incubator-singa/subscription","commits_url":"https://api.github.com/repos/ijingo/incubator-singa/commits{/sha}","git_commits_url":"https://api.github.com/repos/ijingo/incubator-singa/git/commits{/sha}","comments_url":"https://api.github.com/repos/ijingo/incubator-singa/comments{/number}","issue_comment_url":"https://api.github.com/repos/ijingo/incubator-singa/issues/comments{/number}","contents_url":"https://api.github.com/repos/ijingo/incubator-singa/contents/{+path}","compare_url":"https://api.github.com/repos/ijingo/incubator-singa/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ijingo/incubator-singa/merges","archive_url":"https://api.github.com/repos/ijingo/incubator-singa/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ijingo/incubator-singa/downloads","issues_url":"https://api.github.com/repos/ijingo/incubator-singa/issues{/number}","pulls_url":"https://api.github.com/repos/ijingo/incubator-singa/pulls{/number}","milestones_url":"https://api.github.com/repos/ijingo/incubator-singa/milestones{/number}","notifications_url":"https://api.github.com/repos/ijingo/incubator-singa/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ijingo/incubator-singa/labels{/name}","releases_url":"https://api.github.com/repos/ijingo/incubator-singa/releases{/id}","deployments_url":"https://api.github.com/repos/ijingo/incubator-singa/deployments","created_at":"2015-08-15T09:10:14Z","updated_at":"2016-03-07T13:54:27Z","pushed_at":"2016-07-22T12:38:31Z","git_url":"git://github.com/ijingo/incubator-singa.git","ssh_url":"git@github.com:ijingo/incubator-singa.git","clone_url":"https://github.com/ijingo/incubator-singa.git","svn_url":"https://github.com/ijingo/incubator-singa","homepage":null,"size":6135,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"apache:dev","ref":"dev","sha":"8e3d3df61ef88efbe73813e3b46d4a1652242637","user":{"login":"apache","id":47359,"avatar_url":"https://avatars.githubusercontent.com/u/47359?v=3","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"repo":{"id":33294317,"name":"incubator-singa","full_name":"apache/incubator-singa","owner":{"login":"apache","id":47359,"avatar_url":"https://avatars.githubusercontent.com/u/47359?v=3","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/apache/incubator-singa","description":"Mirror of Apache Singa (Incubating)","fork":false,"url":"https://api.github.com/repos/apache/incubator-singa","forks_url":"https://api.github.com/repos/apache/incubator-singa/forks","keys_url":"https://api.github.com/repos/apache/incubator-singa/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apache/incubator-singa/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apache/incubator-singa/teams","hooks_url":"https://api.github.com/repos/apache/incubator-singa/hooks","issue_events_url":"https://api.github.com/repos/apache/incubator-singa/issues/events{/number}","events_url":"https://api.github.com/repos/apache/incubator-singa/events","assignees_url":"https://api.github.com/repos/apache/incubator-singa/assignees{/user}","branches_url":"https://api.github.com/repos/apache/incubator-singa/branches{/branch}","tags_url":"https://api.github.com/repos/apache/incubator-singa/tags","blobs_url":"https://api.github.com/repos/apache/incubator-singa/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apache/incubator-singa/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apache/incubator-singa/git/refs{/sha}","trees_url":"https://api.github.com/repos/apache/incubator-singa/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apache/incubator-singa/statuses/{sha}","languages_url":"https://api.github.com/repos/apache/incubator-singa/languages","stargazers_url":"https://api.github.com/repos/apache/incubator-singa/stargazers","contributors_url":"https://api.github.com/repos/apache/incubator-singa/contributors","subscribers_url":"https://api.github.com/repos/apache/incubator-singa/subscribers","subscription_url":"https://api.github.com/repos/apache/incubator-singa/subscription","commits_url":"https://api.github.com/repos/apache/incubator-singa/commits{/sha}","git_commits_url":"https://api.github.com/repos/apache/incubator-singa/git/commits{/sha}","comments_url":"https://api.github.com/repos/apache/incubator-singa/comments{/number}","issue_comment_url":"https://api.github.com/repos/apache/incubator-singa/issues/comments{/number}","contents_url":"https://api.github.com/repos/apache/incubator-singa/contents/{+path}","compare_url":"https://api.github.com/repos/apache/incubator-singa/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apache/incubator-singa/merges","archive_url":"https://api.github.com/repos/apache/incubator-singa/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apache/incubator-singa/downloads","issues_url":"https://api.github.com/repos/apache/incubator-singa/issues{/number}","pulls_url":"https://api.github.com/repos/apache/incubator-singa/pulls{/number}","milestones_url":"https://api.github.com/repos/apache/incubator-singa/milestones{/number}","notifications_url":"https://api.github.com/repos/apache/incubator-singa/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apache/incubator-singa/labels{/name}","releases_url":"https://api.github.com/repos/apache/incubator-singa/releases{/id}","deployments_url":"https://api.github.com/repos/apache/incubator-singa/deployments","created_at":"2015-04-02T07:00:05Z","updated_at":"2016-07-20T08:42:28Z","pushed_at":"2016-07-22T12:38:32Z","git_url":"git://github.com/apache/incubator-singa.git","ssh_url":"git@github.com:apache/incubator-singa.git","clone_url":"https://github.com/apache/incubator-singa.git","svn_url":"https://github.com/apache/incubator-singa","homepage":null,"size":9872,"stargazers_count":612,"watchers_count":612,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":214,"mirror_url":"git://git.apache.org/incubator-singa.git","open_issues_count":13,"forks":214,"open_issues":13,"watchers":612,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/apache/incubator-singa/pulls/216"},"html":{"href":"https://github.com/apache/incubator-singa/pull/216"},"issue":{"href":"https://api.github.com/repos/apache/incubator-singa/issues/216"},"comments":{"href":"https://api.github.com/repos/apache/incubator-singa/issues/216/comments"},"review_comments":{"href":"https://api.github.com/repos/apache/incubator-singa/pulls/216/comments"},"review_comment":{"href":"https://api.github.com/repos/apache/incubator-singa/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apache/incubator-singa/pulls/216/commits"},"statuses":{"href":"https://api.github.com/repos/apache/incubator-singa/statuses/4dee27fa602defa97692fb70f0f22fe172657b7b"}}}}
{"actor":{"display_login":"nudles"}}