{"action":"created","comment":{"url":"https://api.github.com/repos/pytorch/glow/pulls/comments/233319711","pull_request_review_id":174703945,"id":233319711,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzMzMxOTcxMQ==","diff_hunk":"@@ -205,6 +205,155 @@ static Node *simplifyNode(Node *node, Function *F) {\n   return node;\n }\n \n+// 2D vector of dimensions mapping a dimension that is reshaped into either 1\n+// or 2 dimensions by the first reshape node in a ChannelShuffle operation\n+using ChannelShuffleDimGroups =\n+    llvm::SmallVector<llvm::SmallVector<unsigned_t, 2>, max_tensor_dimensions>;\n+\n+/// fills \\p dimGroups with the groups of dimensions of the result of \\p node\n+/// that get separated. This grouping is only possible if \\p node is the first\n+/// Reshape node in a ChannelShuffle operation (Reshape->Tranpose->Reshape)\n+/// \\returns true if successfully grouped output dimensions and false otherwise","path":"lib/Optimizer/GraphOptimizer.cpp","position":12,"original_position":12,"commit_id":"fdcc8dfed7d399f6c94a49e3ff3ca0781c7dc18d","original_commit_id":"fdcc8dfed7d399f6c94a49e3ff3ca0781c7dc18d","user":{"login":"nadavrot","id":8635342,"node_id":"MDQ6VXNlcjg2MzUzNDI=","avatar_url":"https://avatars3.githubusercontent.com/u/8635342?v=4","gravatar_id":"","url":"https://api.github.com/users/nadavrot","html_url":"https://github.com/nadavrot","followers_url":"https://api.github.com/users/nadavrot/followers","following_url":"https://api.github.com/users/nadavrot/following{/other_user}","gists_url":"https://api.github.com/users/nadavrot/gists{/gist_id}","starred_url":"https://api.github.com/users/nadavrot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nadavrot/subscriptions","organizations_url":"https://api.github.com/users/nadavrot/orgs","repos_url":"https://api.github.com/users/nadavrot/repos","events_url":"https://api.github.com/users/nadavrot/events{/privacy}","received_events_url":"https://api.github.com/users/nadavrot/received_events","type":"User","site_admin":false},"body":"Period.","created_at":"2018-11-14T05:40:17Z","updated_at":"2018-11-14T05:40:17Z","html_url":"https://github.com/pytorch/glow/pull/2012#discussion_r233319711","pull_request_url":"https://api.github.com/repos/pytorch/glow/pulls/2012","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/pytorch/glow/pulls/comments/233319711"},"html":{"href":"https://github.com/pytorch/glow/pull/2012#discussion_r233319711"},"pull_request":{"href":"https://api.github.com/repos/pytorch/glow/pulls/2012"}}},"pull_request":{"url":"https://api.github.com/repos/pytorch/glow/pulls/2012","id":230589294,"node_id":"MDExOlB1bGxSZXF1ZXN0MjMwNTg5Mjk0","html_url":"https://github.com/pytorch/glow/pull/2012","diff_url":"https://github.com/pytorch/glow/pull/2012.diff","patch_url":"https://github.com/pytorch/glow/pull/2012.patch","issue_url":"https://api.github.com/repos/pytorch/glow/issues/2012","number":2012,"state":"open","locked":false,"title":"[GraphOptimizer] sink transpose below ChannelShuffle","user":{"login":"jackm321","id":1740091,"node_id":"MDQ6VXNlcjE3NDAwOTE=","avatar_url":"https://avatars2.githubusercontent.com/u/1740091?v=4","gravatar_id":"","url":"https://api.github.com/users/jackm321","html_url":"https://github.com/jackm321","followers_url":"https://api.github.com/users/jackm321/followers","following_url":"https://api.github.com/users/jackm321/following{/other_user}","gists_url":"https://api.github.com/users/jackm321/gists{/gist_id}","starred_url":"https://api.github.com/users/jackm321/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jackm321/subscriptions","organizations_url":"https://api.github.com/users/jackm321/orgs","repos_url":"https://api.github.com/users/jackm321/repos","events_url":"https://api.github.com/users/jackm321/events{/privacy}","received_events_url":"https://api.github.com/users/jackm321/received_events","type":"User","site_admin":false},"body":"*Description*:\r\nSink Tranposes below nodes from ChannelShuffle (Reshape->Tranpose->Reshape) in GraphOptimizer. See more details in #1640.\r\n\r\n*Testing*:\r\nAdded a new unit test, ran `ninja all && ninja test`\r\nAlso ran on `shufflenet/model.onnx` network before and after the optimization to see that transposes are correctly sunk and then eliminated by the identity transpose optimization.\r\n\r\nDAGS for shufflenet before and after optimization\r\nbefore: [shufflenetDAG_before.pdf]\r\nafter:(https://github.com/pytorch/glow/files/2577623/shufflenetDAG_before.pdf)\r\n[shufflenetDAG_after.pdf](https://github.com/pytorch/glow/files/2577624/shufflenetDAG_after.pdf)\r\n\r\nhighlight of change in DAGS\r\nbefore:  \r\n<img width=\"315\" alt=\"screen shot 2018-11-13 at 10 59 49 am\" src=\"https://user-images.githubusercontent.com/1740091/48436338-4e6e4d00-e733-11e8-867e-92617612223f.png\">\r\n\r\nafter:  \r\n<img width=\"218\" alt=\"screen shot 2018-11-13 at 11 00 04 am\" src=\"https://user-images.githubusercontent.com/1740091/48436345-529a6a80-e733-11e8-9b37-3a8a02c9f193.png\">\r\n\r\n\r\n\r\n*Documentation*:\r\ncomments in code\r\nFixes #1640 \r\n","created_at":"2018-11-13T19:01:00Z","updated_at":"2018-11-14T05:40:17Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3c9e96c7d16a0c73d8f76ac7a07b4cebe9974979","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":706497924,"node_id":"MDU6TGFiZWw3MDY0OTc5MjQ=","url":"https://api.github.com/repos/pytorch/glow/labels/CLA%20Signed","name":"CLA Signed","color":"009900","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/pytorch/glow/pulls/2012/commits","review_comments_url":"https://api.github.com/repos/pytorch/glow/pulls/2012/comments","review_comment_url":"https://api.github.com/repos/pytorch/glow/pulls/comments{/number}","comments_url":"https://api.github.com/repos/pytorch/glow/issues/2012/comments","statuses_url":"https://api.github.com/repos/pytorch/glow/statuses/fdcc8dfed7d399f6c94a49e3ff3ca0781c7dc18d","head":{"label":"jackm321:remove_unnecessary_transposes","ref":"remove_unnecessary_transposes","sha":"fdcc8dfed7d399f6c94a49e3ff3ca0781c7dc18d","user":{"login":"jackm321","id":1740091,"node_id":"MDQ6VXNlcjE3NDAwOTE=","avatar_url":"https://avatars2.githubusercontent.com/u/1740091?v=4","gravatar_id":"","url":"https://api.github.com/users/jackm321","html_url":"https://github.com/jackm321","followers_url":"https://api.github.com/users/jackm321/followers","following_url":"https://api.github.com/users/jackm321/following{/other_user}","gists_url":"https://api.github.com/users/jackm321/gists{/gist_id}","starred_url":"https://api.github.com/users/jackm321/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jackm321/subscriptions","organizations_url":"https://api.github.com/users/jackm321/orgs","repos_url":"https://api.github.com/users/jackm321/repos","events_url":"https://api.github.com/users/jackm321/events{/privacy}","received_events_url":"https://api.github.com/users/jackm321/received_events","type":"User","site_admin":false},"repo":{"id":156290406,"node_id":"MDEwOlJlcG9zaXRvcnkxNTYyOTA0MDY=","name":"glow","full_name":"jackm321/glow","private":false,"owner":{"login":"jackm321","id":1740091,"node_id":"MDQ6VXNlcjE3NDAwOTE=","avatar_url":"https://avatars2.githubusercontent.com/u/1740091?v=4","gravatar_id":"","url":"https://api.github.com/users/jackm321","html_url":"https://github.com/jackm321","followers_url":"https://api.github.com/users/jackm321/followers","following_url":"https://api.github.com/users/jackm321/following{/other_user}","gists_url":"https://api.github.com/users/jackm321/gists{/gist_id}","starred_url":"https://api.github.com/users/jackm321/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jackm321/subscriptions","organizations_url":"https://api.github.com/users/jackm321/orgs","repos_url":"https://api.github.com/users/jackm321/repos","events_url":"https://api.github.com/users/jackm321/events{/privacy}","received_events_url":"https://api.github.com/users/jackm321/received_events","type":"User","site_admin":false},"html_url":"https://github.com/jackm321/glow","description":"Compiler for Neural Network hardware accelerators","fork":true,"url":"https://api.github.com/repos/jackm321/glow","forks_url":"https://api.github.com/repos/jackm321/glow/forks","keys_url":"https://api.github.com/repos/jackm321/glow/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jackm321/glow/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jackm321/glow/teams","hooks_url":"https://api.github.com/repos/jackm321/glow/hooks","issue_events_url":"https://api.github.com/repos/jackm321/glow/issues/events{/number}","events_url":"https://api.github.com/repos/jackm321/glow/events","assignees_url":"https://api.github.com/repos/jackm321/glow/assignees{/user}","branches_url":"https://api.github.com/repos/jackm321/glow/branches{/branch}","tags_url":"https://api.github.com/repos/jackm321/glow/tags","blobs_url":"https://api.github.com/repos/jackm321/glow/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jackm321/glow/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jackm321/glow/git/refs{/sha}","trees_url":"https://api.github.com/repos/jackm321/glow/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jackm321/glow/statuses/{sha}","languages_url":"https://api.github.com/repos/jackm321/glow/languages","stargazers_url":"https://api.github.com/repos/jackm321/glow/stargazers","contributors_url":"https://api.github.com/repos/jackm321/glow/contributors","subscribers_url":"https://api.github.com/repos/jackm321/glow/subscribers","subscription_url":"https://api.github.com/repos/jackm321/glow/subscription","commits_url":"https://api.github.com/repos/jackm321/glow/commits{/sha}","git_commits_url":"https://api.github.com/repos/jackm321/glow/git/commits{/sha}","comments_url":"https://api.github.com/repos/jackm321/glow/comments{/number}","issue_comment_url":"https://api.github.com/repos/jackm321/glow/issues/comments{/number}","contents_url":"https://api.github.com/repos/jackm321/glow/contents/{+path}","compare_url":"https://api.github.com/repos/jackm321/glow/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jackm321/glow/merges","archive_url":"https://api.github.com/repos/jackm321/glow/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jackm321/glow/downloads","issues_url":"https://api.github.com/repos/jackm321/glow/issues{/number}","pulls_url":"https://api.github.com/repos/jackm321/glow/pulls{/number}","milestones_url":"https://api.github.com/repos/jackm321/glow/milestones{/number}","notifications_url":"https://api.github.com/repos/jackm321/glow/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jackm321/glow/labels{/name}","releases_url":"https://api.github.com/repos/jackm321/glow/releases{/id}","deployments_url":"https://api.github.com/repos/jackm321/glow/deployments","created_at":"2018-11-05T22:14:00Z","updated_at":"2018-11-08T00:49:51Z","pushed_at":"2018-11-13T23:19:08Z","git_url":"git://github.com/jackm321/glow.git","ssh_url":"git@github.com:jackm321/glow.git","clone_url":"https://github.com/jackm321/glow.git","svn_url":"https://github.com/jackm321/glow","homepage":null,"size":9973,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"pytorch:master","ref":"master","sha":"6ffee6dc965e80b58cfe525a8fec25edfec2d9d9","user":{"login":"pytorch","id":21003710,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIxMDAzNzEw","avatar_url":"https://avatars3.githubusercontent.com/u/21003710?v=4","gravatar_id":"","url":"https://api.github.com/users/pytorch","html_url":"https://github.com/pytorch","followers_url":"https://api.github.com/users/pytorch/followers","following_url":"https://api.github.com/users/pytorch/following{/other_user}","gists_url":"https://api.github.com/users/pytorch/gists{/gist_id}","starred_url":"https://api.github.com/users/pytorch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pytorch/subscriptions","organizations_url":"https://api.github.com/users/pytorch/orgs","repos_url":"https://api.github.com/users/pytorch/repos","events_url":"https://api.github.com/users/pytorch/events{/privacy}","received_events_url":"https://api.github.com/users/pytorch/received_events","type":"Organization","site_admin":false},"repo":{"id":105281531,"node_id":"MDEwOlJlcG9zaXRvcnkxMDUyODE1MzE=","name":"glow","full_name":"pytorch/glow","private":false,"owner":{"login":"pytorch","id":21003710,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIxMDAzNzEw","avatar_url":"https://avatars3.githubusercontent.com/u/21003710?v=4","gravatar_id":"","url":"https://api.github.com/users/pytorch","html_url":"https://github.com/pytorch","followers_url":"https://api.github.com/users/pytorch/followers","following_url":"https://api.github.com/users/pytorch/following{/other_user}","gists_url":"https://api.github.com/users/pytorch/gists{/gist_id}","starred_url":"https://api.github.com/users/pytorch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pytorch/subscriptions","organizations_url":"https://api.github.com/users/pytorch/orgs","repos_url":"https://api.github.com/users/pytorch/repos","events_url":"https://api.github.com/users/pytorch/events{/privacy}","received_events_url":"https://api.github.com/users/pytorch/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/pytorch/glow","description":"Compiler for Neural Network hardware accelerators","fork":false,"url":"https://api.github.com/repos/pytorch/glow","forks_url":"https://api.github.com/repos/pytorch/glow/forks","keys_url":"https://api.github.com/repos/pytorch/glow/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pytorch/glow/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pytorch/glow/teams","hooks_url":"https://api.github.com/repos/pytorch/glow/hooks","issue_events_url":"https://api.github.com/repos/pytorch/glow/issues/events{/number}","events_url":"https://api.github.com/repos/pytorch/glow/events","assignees_url":"https://api.github.com/repos/pytorch/glow/assignees{/user}","branches_url":"https://api.github.com/repos/pytorch/glow/branches{/branch}","tags_url":"https://api.github.com/repos/pytorch/glow/tags","blobs_url":"https://api.github.com/repos/pytorch/glow/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pytorch/glow/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pytorch/glow/git/refs{/sha}","trees_url":"https://api.github.com/repos/pytorch/glow/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pytorch/glow/statuses/{sha}","languages_url":"https://api.github.com/repos/pytorch/glow/languages","stargazers_url":"https://api.github.com/repos/pytorch/glow/stargazers","contributors_url":"https://api.github.com/repos/pytorch/glow/contributors","subscribers_url":"https://api.github.com/repos/pytorch/glow/subscribers","subscription_url":"https://api.github.com/repos/pytorch/glow/subscription","commits_url":"https://api.github.com/repos/pytorch/glow/commits{/sha}","git_commits_url":"https://api.github.com/repos/pytorch/glow/git/commits{/sha}","comments_url":"https://api.github.com/repos/pytorch/glow/comments{/number}","issue_comment_url":"https://api.github.com/repos/pytorch/glow/issues/comments{/number}","contents_url":"https://api.github.com/repos/pytorch/glow/contents/{+path}","compare_url":"https://api.github.com/repos/pytorch/glow/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pytorch/glow/merges","archive_url":"https://api.github.com/repos/pytorch/glow/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pytorch/glow/downloads","issues_url":"https://api.github.com/repos/pytorch/glow/issues{/number}","pulls_url":"https://api.github.com/repos/pytorch/glow/pulls{/number}","milestones_url":"https://api.github.com/repos/pytorch/glow/milestones{/number}","notifications_url":"https://api.github.com/repos/pytorch/glow/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pytorch/glow/labels{/name}","releases_url":"https://api.github.com/repos/pytorch/glow/releases{/id}","deployments_url":"https://api.github.com/repos/pytorch/glow/deployments","created_at":"2017-09-29T14:28:18Z","updated_at":"2018-11-14T05:30:28Z","pushed_at":"2018-11-14T05:30:25Z","git_url":"git://github.com/pytorch/glow.git","ssh_url":"git@github.com:pytorch/glow.git","clone_url":"https://github.com/pytorch/glow.git","svn_url":"https://github.com/pytorch/glow","homepage":null,"size":9983,"stargazers_count":1018,"watchers_count":1018,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":132,"mirror_url":null,"archived":false,"open_issues_count":77,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":132,"open_issues":77,"watchers":1018,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/pytorch/glow/pulls/2012"},"html":{"href":"https://github.com/pytorch/glow/pull/2012"},"issue":{"href":"https://api.github.com/repos/pytorch/glow/issues/2012"},"comments":{"href":"https://api.github.com/repos/pytorch/glow/issues/2012/comments"},"review_comments":{"href":"https://api.github.com/repos/pytorch/glow/pulls/2012/comments"},"review_comment":{"href":"https://api.github.com/repos/pytorch/glow/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/pytorch/glow/pulls/2012/commits"},"statuses":{"href":"https://api.github.com/repos/pytorch/glow/statuses/fdcc8dfed7d399f6c94a49e3ff3ca0781c7dc18d"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"nadavrot"}}