{"action":"created","comment":{"url":"https://api.github.com/repos/apache/spark/pulls/comments/58422643","id":58422643,"diff_hunk":"@@ -451,10 +451,10 @@ final class OnlineLDAOptimizer extends LDAOptimizer {\n       }\n       Iterator((stat, gammaPart))\n     }\n-    val statsSum: BDM[Double] = stats.map(_._1).reduce(_ += _)\n+    val statsSum: BDM[Double] = stats.map(_._1).treeReduce(_ += _)\n     expElogbetaBc.unpersist()\n     val gammat: BDM[Double] = breeze.linalg.DenseMatrix.vertcat(\n-      stats.map(_._2).reduce(_ ++ _).map(_.toDenseMatrix): _*)\n+      stats.map(_._2).treeReduce(_ ++ _).map(_.toDenseMatrix): _*)","path":"mllib/src/main/scala/org/apache/spark/mllib/clustering/LDAOptimizer.scala","position":9,"original_position":9,"commit_id":"38cf0f3cc90d09435f12ad86021469eff32985db","original_commit_id":"38cf0f3cc90d09435f12ad86021469eff32985db","user":{"login":"jkbradley","id":5084283,"avatar_url":"https://avatars.githubusercontent.com/u/5084283?v=3","gravatar_id":"","url":"https://api.github.com/users/jkbradley","html_url":"https://github.com/jkbradley","followers_url":"https://api.github.com/users/jkbradley/followers","following_url":"https://api.github.com/users/jkbradley/following{/other_user}","gists_url":"https://api.github.com/users/jkbradley/gists{/gist_id}","starred_url":"https://api.github.com/users/jkbradley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jkbradley/subscriptions","organizations_url":"https://api.github.com/users/jkbradley/orgs","repos_url":"https://api.github.com/users/jkbradley/repos","events_url":"https://api.github.com/users/jkbradley/events{/privacy}","received_events_url":"https://api.github.com/users/jkbradley/received_events","type":"User","site_admin":false},"body":"Let's just use aggregate here for now.  I made [https://issues.apache.org/jira/browse/SPARK-14371] to fix the issue with concatenating lists.","created_at":"2016-04-04T18:22:42Z","updated_at":"2016-04-04T18:22:42Z","html_url":"https://github.com/apache/spark/pull/12106#discussion_r58422643","pull_request_url":"https://api.github.com/repos/apache/spark/pulls/12106","_links":{"self":{"href":"https://api.github.com/repos/apache/spark/pulls/comments/58422643"},"html":{"href":"https://github.com/apache/spark/pull/12106#discussion_r58422643"},"pull_request":{"href":"https://api.github.com/repos/apache/spark/pulls/12106"}}},"pull_request":{"url":"https://api.github.com/repos/apache/spark/pulls/12106","id":64890824,"html_url":"https://github.com/apache/spark/pull/12106","diff_url":"https://github.com/apache/spark/pull/12106.diff","patch_url":"https://github.com/apache/spark/pull/12106.patch","issue_url":"https://api.github.com/repos/apache/spark/issues/12106","number":12106,"state":"open","locked":false,"title":"[SPARK-14322] [MLlib] Use treeReduce instead of reduce in OnlineLDAOptimizer","user":{"login":"hhbyyh","id":7981698,"avatar_url":"https://avatars.githubusercontent.com/u/7981698?v=3","gravatar_id":"","url":"https://api.github.com/users/hhbyyh","html_url":"https://github.com/hhbyyh","followers_url":"https://api.github.com/users/hhbyyh/followers","following_url":"https://api.github.com/users/hhbyyh/following{/other_user}","gists_url":"https://api.github.com/users/hhbyyh/gists{/gist_id}","starred_url":"https://api.github.com/users/hhbyyh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hhbyyh/subscriptions","organizations_url":"https://api.github.com/users/hhbyyh/orgs","repos_url":"https://api.github.com/users/hhbyyh/repos","events_url":"https://api.github.com/users/hhbyyh/events{/privacy}","received_events_url":"https://api.github.com/users/hhbyyh/received_events","type":"User","site_admin":false},"body":"## What changes were proposed in this pull request?\r\n\r\nOnlineLDAOptimizer uses RDD.reduce in two places where it could use treeReduce. This can cause scalability issues. This should be an easy fix.\r\n\r\n## How was this patch tested?\r\nunit tests\r\n\r\n","created_at":"2016-04-01T03:23:36Z","updated_at":"2016-04-04T18:22:42Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5fcac21912992664332ffe157aeabba5cb8f89e4","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/apache/spark/pulls/12106/commits","review_comments_url":"https://api.github.com/repos/apache/spark/pulls/12106/comments","review_comment_url":"https://api.github.com/repos/apache/spark/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apache/spark/issues/12106/comments","statuses_url":"https://api.github.com/repos/apache/spark/statuses/38cf0f3cc90d09435f12ad86021469eff32985db","head":{"label":"hhbyyh:ldaTreeReduce","ref":"ldaTreeReduce","sha":"38cf0f3cc90d09435f12ad86021469eff32985db","user":{"login":"hhbyyh","id":7981698,"avatar_url":"https://avatars.githubusercontent.com/u/7981698?v=3","gravatar_id":"","url":"https://api.github.com/users/hhbyyh","html_url":"https://github.com/hhbyyh","followers_url":"https://api.github.com/users/hhbyyh/followers","following_url":"https://api.github.com/users/hhbyyh/following{/other_user}","gists_url":"https://api.github.com/users/hhbyyh/gists{/gist_id}","starred_url":"https://api.github.com/users/hhbyyh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hhbyyh/subscriptions","organizations_url":"https://api.github.com/users/hhbyyh/orgs","repos_url":"https://api.github.com/users/hhbyyh/repos","events_url":"https://api.github.com/users/hhbyyh/events{/privacy}","received_events_url":"https://api.github.com/users/hhbyyh/received_events","type":"User","site_admin":false},"repo":{"id":29568485,"name":"spark","full_name":"hhbyyh/spark","owner":{"login":"hhbyyh","id":7981698,"avatar_url":"https://avatars.githubusercontent.com/u/7981698?v=3","gravatar_id":"","url":"https://api.github.com/users/hhbyyh","html_url":"https://github.com/hhbyyh","followers_url":"https://api.github.com/users/hhbyyh/followers","following_url":"https://api.github.com/users/hhbyyh/following{/other_user}","gists_url":"https://api.github.com/users/hhbyyh/gists{/gist_id}","starred_url":"https://api.github.com/users/hhbyyh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hhbyyh/subscriptions","organizations_url":"https://api.github.com/users/hhbyyh/orgs","repos_url":"https://api.github.com/users/hhbyyh/repos","events_url":"https://api.github.com/users/hhbyyh/events{/privacy}","received_events_url":"https://api.github.com/users/hhbyyh/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/hhbyyh/spark","description":"Mirror of Apache Spark","fork":true,"url":"https://api.github.com/repos/hhbyyh/spark","forks_url":"https://api.github.com/repos/hhbyyh/spark/forks","keys_url":"https://api.github.com/repos/hhbyyh/spark/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hhbyyh/spark/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hhbyyh/spark/teams","hooks_url":"https://api.github.com/repos/hhbyyh/spark/hooks","issue_events_url":"https://api.github.com/repos/hhbyyh/spark/issues/events{/number}","events_url":"https://api.github.com/repos/hhbyyh/spark/events","assignees_url":"https://api.github.com/repos/hhbyyh/spark/assignees{/user}","branches_url":"https://api.github.com/repos/hhbyyh/spark/branches{/branch}","tags_url":"https://api.github.com/repos/hhbyyh/spark/tags","blobs_url":"https://api.github.com/repos/hhbyyh/spark/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hhbyyh/spark/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hhbyyh/spark/git/refs{/sha}","trees_url":"https://api.github.com/repos/hhbyyh/spark/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hhbyyh/spark/statuses/{sha}","languages_url":"https://api.github.com/repos/hhbyyh/spark/languages","stargazers_url":"https://api.github.com/repos/hhbyyh/spark/stargazers","contributors_url":"https://api.github.com/repos/hhbyyh/spark/contributors","subscribers_url":"https://api.github.com/repos/hhbyyh/spark/subscribers","subscription_url":"https://api.github.com/repos/hhbyyh/spark/subscription","commits_url":"https://api.github.com/repos/hhbyyh/spark/commits{/sha}","git_commits_url":"https://api.github.com/repos/hhbyyh/spark/git/commits{/sha}","comments_url":"https://api.github.com/repos/hhbyyh/spark/comments{/number}","issue_comment_url":"https://api.github.com/repos/hhbyyh/spark/issues/comments{/number}","contents_url":"https://api.github.com/repos/hhbyyh/spark/contents/{+path}","compare_url":"https://api.github.com/repos/hhbyyh/spark/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hhbyyh/spark/merges","archive_url":"https://api.github.com/repos/hhbyyh/spark/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hhbyyh/spark/downloads","issues_url":"https://api.github.com/repos/hhbyyh/spark/issues{/number}","pulls_url":"https://api.github.com/repos/hhbyyh/spark/pulls{/number}","milestones_url":"https://api.github.com/repos/hhbyyh/spark/milestones{/number}","notifications_url":"https://api.github.com/repos/hhbyyh/spark/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hhbyyh/spark/labels{/name}","releases_url":"https://api.github.com/repos/hhbyyh/spark/releases{/id}","deployments_url":"https://api.github.com/repos/hhbyyh/spark/deployments","created_at":"2015-01-21T03:08:12Z","updated_at":"2016-02-04T00:47:32Z","pushed_at":"2016-04-01T03:18:06Z","git_url":"git://github.com/hhbyyh/spark.git","ssh_url":"git@github.com:hhbyyh/spark.git","clone_url":"https://github.com/hhbyyh/spark.git","svn_url":"https://github.com/hhbyyh/spark","homepage":null,"size":147667,"stargazers_count":0,"watchers_count":0,"language":"Scala","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:master","ref":"master","sha":"96941b12f8b465df21423275f3cd3ade579b4fa1","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":17165658,"name":"spark","full_name":"apache/spark","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/spark","description":"Mirror of Apache Spark","fork":false,"url":"https://api.github.com/repos/apache/spark","forks_url":"https://api.github.com/repos/apache/spark/forks","keys_url":"https://api.github.com/repos/apache/spark/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apache/spark/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apache/spark/teams","hooks_url":"https://api.github.com/repos/apache/spark/hooks","issue_events_url":"https://api.github.com/repos/apache/spark/issues/events{/number}","events_url":"https://api.github.com/repos/apache/spark/events","assignees_url":"https://api.github.com/repos/apache/spark/assignees{/user}","branches_url":"https://api.github.com/repos/apache/spark/branches{/branch}","tags_url":"https://api.github.com/repos/apache/spark/tags","blobs_url":"https://api.github.com/repos/apache/spark/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apache/spark/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apache/spark/git/refs{/sha}","trees_url":"https://api.github.com/repos/apache/spark/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apache/spark/statuses/{sha}","languages_url":"https://api.github.com/repos/apache/spark/languages","stargazers_url":"https://api.github.com/repos/apache/spark/stargazers","contributors_url":"https://api.github.com/repos/apache/spark/contributors","subscribers_url":"https://api.github.com/repos/apache/spark/subscribers","subscription_url":"https://api.github.com/repos/apache/spark/subscription","commits_url":"https://api.github.com/repos/apache/spark/commits{/sha}","git_commits_url":"https://api.github.com/repos/apache/spark/git/commits{/sha}","comments_url":"https://api.github.com/repos/apache/spark/comments{/number}","issue_comment_url":"https://api.github.com/repos/apache/spark/issues/comments{/number}","contents_url":"https://api.github.com/repos/apache/spark/contents/{+path}","compare_url":"https://api.github.com/repos/apache/spark/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apache/spark/merges","archive_url":"https://api.github.com/repos/apache/spark/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apache/spark/downloads","issues_url":"https://api.github.com/repos/apache/spark/issues{/number}","pulls_url":"https://api.github.com/repos/apache/spark/pulls{/number}","milestones_url":"https://api.github.com/repos/apache/spark/milestones{/number}","notifications_url":"https://api.github.com/repos/apache/spark/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apache/spark/labels{/name}","releases_url":"https://api.github.com/repos/apache/spark/releases{/id}","deployments_url":"https://api.github.com/repos/apache/spark/deployments","created_at":"2014-02-25T08:00:08Z","updated_at":"2016-04-04T16:19:51Z","pushed_at":"2016-04-04T18:08:17Z","git_url":"git://github.com/apache/spark.git","ssh_url":"git@github.com:apache/spark.git","clone_url":"https://github.com/apache/spark.git","svn_url":"https://github.com/apache/spark","homepage":null,"size":450945,"stargazers_count":8014,"watchers_count":8014,"language":"Scala","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":7410,"mirror_url":"git://git.apache.org/spark.git","open_issues_count":423,"forks":7410,"open_issues":423,"watchers":8014,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/apache/spark/pulls/12106"},"html":{"href":"https://github.com/apache/spark/pull/12106"},"issue":{"href":"https://api.github.com/repos/apache/spark/issues/12106"},"comments":{"href":"https://api.github.com/repos/apache/spark/issues/12106/comments"},"review_comments":{"href":"https://api.github.com/repos/apache/spark/pulls/12106/comments"},"review_comment":{"href":"https://api.github.com/repos/apache/spark/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apache/spark/pulls/12106/commits"},"statuses":{"href":"https://api.github.com/repos/apache/spark/statuses/38cf0f3cc90d09435f12ad86021469eff32985db"}}}}