{"action":"created","comment":{"url":"https://api.github.com/repos/pytorch/pytorch/pulls/comments/287475567","pull_request_review_id":241892880,"id":287475567,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI4NzQ3NTU2Nw==","diff_hunk":"@@ -1,12 +1,28 @@\n #include \"memory_dag.h\"\n \n+#include <c10/util/flat_hash_map.h>","path":"torch/csrc/jit/passes/utils/memory_dag.cpp","position":3,"original_position":3,"commit_id":"4be1efb4e90dccc7e84ab8037b4c9601cfc0d807","original_commit_id":"4be1efb4e90dccc7e84ab8037b4c9601cfc0d807","user":{"login":"suo","id":1617424,"node_id":"MDQ6VXNlcjE2MTc0MjQ=","avatar_url":"https://avatars2.githubusercontent.com/u/1617424?v=4","gravatar_id":"","url":"https://api.github.com/users/suo","html_url":"https://github.com/suo","followers_url":"https://api.github.com/users/suo/followers","following_url":"https://api.github.com/users/suo/following{/other_user}","gists_url":"https://api.github.com/users/suo/gists{/gist_id}","starred_url":"https://api.github.com/users/suo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/suo/subscriptions","organizations_url":"https://api.github.com/users/suo/orgs","repos_url":"https://api.github.com/users/suo/repos","events_url":"https://api.github.com/users/suo/events{/privacy}","received_events_url":"https://api.github.com/users/suo/received_events","type":"User","site_admin":false},"body":"double include","created_at":"2019-05-24T18:41:26Z","updated_at":"2019-05-24T18:41:27Z","html_url":"https://github.com/pytorch/pytorch/pull/20899#discussion_r287475567","pull_request_url":"https://api.github.com/repos/pytorch/pytorch/pulls/20899","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/pytorch/pytorch/pulls/comments/287475567"},"html":{"href":"https://github.com/pytorch/pytorch/pull/20899#discussion_r287475567"},"pull_request":{"href":"https://api.github.com/repos/pytorch/pytorch/pulls/20899"}}},"pull_request":{"url":"https://api.github.com/repos/pytorch/pytorch/pulls/20899","id":281885663,"node_id":"MDExOlB1bGxSZXF1ZXN0MjgxODg1NjYz","html_url":"https://github.com/pytorch/pytorch/pull/20899","diff_url":"https://github.com/pytorch/pytorch/pull/20899.diff","patch_url":"https://github.com/pytorch/pytorch/pull/20899.patch","issue_url":"https://api.github.com/repos/pytorch/pytorch/issues/20899","number":20899,"state":"open","locked":false,"title":"[jit] Optimize alias analysis","user":{"login":"Chillee","id":6355099,"node_id":"MDQ6VXNlcjYzNTUwOTk=","avatar_url":"https://avatars1.githubusercontent.com/u/6355099?v=4","gravatar_id":"","url":"https://api.github.com/users/Chillee","html_url":"https://github.com/Chillee","followers_url":"https://api.github.com/users/Chillee/followers","following_url":"https://api.github.com/users/Chillee/following{/other_user}","gists_url":"https://api.github.com/users/Chillee/gists{/gist_id}","starred_url":"https://api.github.com/users/Chillee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Chillee/subscriptions","organizations_url":"https://api.github.com/users/Chillee/orgs","repos_url":"https://api.github.com/users/Chillee/repos","events_url":"https://api.github.com/users/Chillee/events{/privacy}","received_events_url":"https://api.github.com/users/Chillee/received_events","type":"User","site_admin":false},"body":"# Overall Improvements\r\n1. Switched from using `unordered_set` to sparse bitset.\r\n1. Prevent some excessive memory allocations (thanks to @resistor )\r\n1. Take advantage of the sparse bitset operations\r\n1. Switch to `flat_hash_map` instead of `unordered_map` in some places.\r\n\r\n# Benchmarks (somewhat approximate, best of a couple runs)\r\n1. InceptionNet (load + one forward pass): 19.8->13.3\r\n1. GoogleNet(load + one forward pass): 10.0 -> 7.24\r\n1. DenseNet (only load): 7.3 -> 5.3\r\n\r\nI use the `sparse bitset` taken from https://llvm.org/doxygen/SparseBitVector_8h_source.html. I had to make some modifications to use `__builtin_popcountl` and instructions like that instead of other transitive clang dependencies. \r\n\r\n## Some notes on our graph topologies\r\nIn general, our graphs are very sparse, and most of the components aren't connected. For GoogleNet, we have 200k nodes, we do 2k `mayAlias` queries, and the sum of magnitudes of sets at each node is 500k (ie: every node, on average, reaches 2.5 leaves).\r\n\r\nPS: Holy crap macbooks throttle an insane amount with the default fan settings.","created_at":"2019-05-24T06:39:15Z","updated_at":"2019-05-24T18:41:27Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c389def61ac6ebfd9f6f4d6775ed448a41405129","assignee":null,"assignees":[],"requested_reviewers":[{"login":"resistor","id":9796,"node_id":"MDQ6VXNlcjk3OTY=","avatar_url":"https://avatars0.githubusercontent.com/u/9796?v=4","gravatar_id":"","url":"https://api.github.com/users/resistor","html_url":"https://github.com/resistor","followers_url":"https://api.github.com/users/resistor/followers","following_url":"https://api.github.com/users/resistor/following{/other_user}","gists_url":"https://api.github.com/users/resistor/gists{/gist_id}","starred_url":"https://api.github.com/users/resistor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/resistor/subscriptions","organizations_url":"https://api.github.com/users/resistor/orgs","repos_url":"https://api.github.com/users/resistor/repos","events_url":"https://api.github.com/users/resistor/events{/privacy}","received_events_url":"https://api.github.com/users/resistor/received_events","type":"User","site_admin":false},{"login":"jamesr66a","id":4685384,"node_id":"MDQ6VXNlcjQ2ODUzODQ=","avatar_url":"https://avatars2.githubusercontent.com/u/4685384?v=4","gravatar_id":"","url":"https://api.github.com/users/jamesr66a","html_url":"https://github.com/jamesr66a","followers_url":"https://api.github.com/users/jamesr66a/followers","following_url":"https://api.github.com/users/jamesr66a/following{/other_user}","gists_url":"https://api.github.com/users/jamesr66a/gists{/gist_id}","starred_url":"https://api.github.com/users/jamesr66a/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jamesr66a/subscriptions","organizations_url":"https://api.github.com/users/jamesr66a/orgs","repos_url":"https://api.github.com/users/jamesr66a/repos","events_url":"https://api.github.com/users/jamesr66a/events{/privacy}","received_events_url":"https://api.github.com/users/jamesr66a/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[{"id":679953983,"node_id":"MDU6TGFiZWw2Nzk5NTM5ODM=","url":"https://api.github.com/repos/pytorch/pytorch/labels/jit","name":"jit","color":"c5def5","default":false},{"id":912691507,"node_id":"MDU6TGFiZWw5MTI2OTE1MDc=","url":"https://api.github.com/repos/pytorch/pytorch/labels/module:%20internals","name":"module: internals","color":"f7e101","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/pytorch/pytorch/pulls/20899/commits","review_comments_url":"https://api.github.com/repos/pytorch/pytorch/pulls/20899/comments","review_comment_url":"https://api.github.com/repos/pytorch/pytorch/pulls/comments{/number}","comments_url":"https://api.github.com/repos/pytorch/pytorch/issues/20899/comments","statuses_url":"https://api.github.com/repos/pytorch/pytorch/statuses/4be1efb4e90dccc7e84ab8037b4c9601cfc0d807","head":{"label":"Chillee:optimizeAliasAnalysis","ref":"optimizeAliasAnalysis","sha":"4be1efb4e90dccc7e84ab8037b4c9601cfc0d807","user":{"login":"Chillee","id":6355099,"node_id":"MDQ6VXNlcjYzNTUwOTk=","avatar_url":"https://avatars1.githubusercontent.com/u/6355099?v=4","gravatar_id":"","url":"https://api.github.com/users/Chillee","html_url":"https://github.com/Chillee","followers_url":"https://api.github.com/users/Chillee/followers","following_url":"https://api.github.com/users/Chillee/following{/other_user}","gists_url":"https://api.github.com/users/Chillee/gists{/gist_id}","starred_url":"https://api.github.com/users/Chillee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Chillee/subscriptions","organizations_url":"https://api.github.com/users/Chillee/orgs","repos_url":"https://api.github.com/users/Chillee/repos","events_url":"https://api.github.com/users/Chillee/events{/privacy}","received_events_url":"https://api.github.com/users/Chillee/received_events","type":"User","site_admin":false},"repo":{"id":187917761,"node_id":"MDEwOlJlcG9zaXRvcnkxODc5MTc3NjE=","name":"pytorch","full_name":"Chillee/pytorch","private":false,"owner":{"login":"Chillee","id":6355099,"node_id":"MDQ6VXNlcjYzNTUwOTk=","avatar_url":"https://avatars1.githubusercontent.com/u/6355099?v=4","gravatar_id":"","url":"https://api.github.com/users/Chillee","html_url":"https://github.com/Chillee","followers_url":"https://api.github.com/users/Chillee/followers","following_url":"https://api.github.com/users/Chillee/following{/other_user}","gists_url":"https://api.github.com/users/Chillee/gists{/gist_id}","starred_url":"https://api.github.com/users/Chillee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Chillee/subscriptions","organizations_url":"https://api.github.com/users/Chillee/orgs","repos_url":"https://api.github.com/users/Chillee/repos","events_url":"https://api.github.com/users/Chillee/events{/privacy}","received_events_url":"https://api.github.com/users/Chillee/received_events","type":"User","site_admin":false},"html_url":"https://github.com/Chillee/pytorch","description":"Tensors and Dynamic neural networks in Python  with strong GPU acceleration","fork":true,"url":"https://api.github.com/repos/Chillee/pytorch","forks_url":"https://api.github.com/repos/Chillee/pytorch/forks","keys_url":"https://api.github.com/repos/Chillee/pytorch/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Chillee/pytorch/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Chillee/pytorch/teams","hooks_url":"https://api.github.com/repos/Chillee/pytorch/hooks","issue_events_url":"https://api.github.com/repos/Chillee/pytorch/issues/events{/number}","events_url":"https://api.github.com/repos/Chillee/pytorch/events","assignees_url":"https://api.github.com/repos/Chillee/pytorch/assignees{/user}","branches_url":"https://api.github.com/repos/Chillee/pytorch/branches{/branch}","tags_url":"https://api.github.com/repos/Chillee/pytorch/tags","blobs_url":"https://api.github.com/repos/Chillee/pytorch/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Chillee/pytorch/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Chillee/pytorch/git/refs{/sha}","trees_url":"https://api.github.com/repos/Chillee/pytorch/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Chillee/pytorch/statuses/{sha}","languages_url":"https://api.github.com/repos/Chillee/pytorch/languages","stargazers_url":"https://api.github.com/repos/Chillee/pytorch/stargazers","contributors_url":"https://api.github.com/repos/Chillee/pytorch/contributors","subscribers_url":"https://api.github.com/repos/Chillee/pytorch/subscribers","subscription_url":"https://api.github.com/repos/Chillee/pytorch/subscription","commits_url":"https://api.github.com/repos/Chillee/pytorch/commits{/sha}","git_commits_url":"https://api.github.com/repos/Chillee/pytorch/git/commits{/sha}","comments_url":"https://api.github.com/repos/Chillee/pytorch/comments{/number}","issue_comment_url":"https://api.github.com/repos/Chillee/pytorch/issues/comments{/number}","contents_url":"https://api.github.com/repos/Chillee/pytorch/contents/{+path}","compare_url":"https://api.github.com/repos/Chillee/pytorch/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Chillee/pytorch/merges","archive_url":"https://api.github.com/repos/Chillee/pytorch/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Chillee/pytorch/downloads","issues_url":"https://api.github.com/repos/Chillee/pytorch/issues{/number}","pulls_url":"https://api.github.com/repos/Chillee/pytorch/pulls{/number}","milestones_url":"https://api.github.com/repos/Chillee/pytorch/milestones{/number}","notifications_url":"https://api.github.com/repos/Chillee/pytorch/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Chillee/pytorch/labels{/name}","releases_url":"https://api.github.com/repos/Chillee/pytorch/releases{/id}","deployments_url":"https://api.github.com/repos/Chillee/pytorch/deployments","created_at":"2019-05-21T21:44:03Z","updated_at":"2019-05-21T21:44:22Z","pushed_at":"2019-05-24T18:31:32Z","git_url":"git://github.com/Chillee/pytorch.git","ssh_url":"git@github.com:Chillee/pytorch.git","clone_url":"https://github.com/Chillee/pytorch.git","svn_url":"https://github.com/Chillee/pytorch","homepage":"https://pytorch.org","size":128293,"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,"disabled":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"pytorch:master","ref":"master","sha":"17941f99792d15a29c8660c306f212dd827f69bf","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":65600975,"node_id":"MDEwOlJlcG9zaXRvcnk2NTYwMDk3NQ==","name":"pytorch","full_name":"pytorch/pytorch","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/pytorch","description":"Tensors and Dynamic neural networks in Python  with strong GPU acceleration","fork":false,"url":"https://api.github.com/repos/pytorch/pytorch","forks_url":"https://api.github.com/repos/pytorch/pytorch/forks","keys_url":"https://api.github.com/repos/pytorch/pytorch/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pytorch/pytorch/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pytorch/pytorch/teams","hooks_url":"https://api.github.com/repos/pytorch/pytorch/hooks","issue_events_url":"https://api.github.com/repos/pytorch/pytorch/issues/events{/number}","events_url":"https://api.github.com/repos/pytorch/pytorch/events","assignees_url":"https://api.github.com/repos/pytorch/pytorch/assignees{/user}","branches_url":"https://api.github.com/repos/pytorch/pytorch/branches{/branch}","tags_url":"https://api.github.com/repos/pytorch/pytorch/tags","blobs_url":"https://api.github.com/repos/pytorch/pytorch/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pytorch/pytorch/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pytorch/pytorch/git/refs{/sha}","trees_url":"https://api.github.com/repos/pytorch/pytorch/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pytorch/pytorch/statuses/{sha}","languages_url":"https://api.github.com/repos/pytorch/pytorch/languages","stargazers_url":"https://api.github.com/repos/pytorch/pytorch/stargazers","contributors_url":"https://api.github.com/repos/pytorch/pytorch/contributors","subscribers_url":"https://api.github.com/repos/pytorch/pytorch/subscribers","subscription_url":"https://api.github.com/repos/pytorch/pytorch/subscription","commits_url":"https://api.github.com/repos/pytorch/pytorch/commits{/sha}","git_commits_url":"https://api.github.com/repos/pytorch/pytorch/git/commits{/sha}","comments_url":"https://api.github.com/repos/pytorch/pytorch/comments{/number}","issue_comment_url":"https://api.github.com/repos/pytorch/pytorch/issues/comments{/number}","contents_url":"https://api.github.com/repos/pytorch/pytorch/contents/{+path}","compare_url":"https://api.github.com/repos/pytorch/pytorch/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pytorch/pytorch/merges","archive_url":"https://api.github.com/repos/pytorch/pytorch/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pytorch/pytorch/downloads","issues_url":"https://api.github.com/repos/pytorch/pytorch/issues{/number}","pulls_url":"https://api.github.com/repos/pytorch/pytorch/pulls{/number}","milestones_url":"https://api.github.com/repos/pytorch/pytorch/milestones{/number}","notifications_url":"https://api.github.com/repos/pytorch/pytorch/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pytorch/pytorch/labels{/name}","releases_url":"https://api.github.com/repos/pytorch/pytorch/releases{/id}","deployments_url":"https://api.github.com/repos/pytorch/pytorch/deployments","created_at":"2016-08-13T05:26:41Z","updated_at":"2019-05-24T18:26:35Z","pushed_at":"2019-05-24T18:40:51Z","git_url":"git://github.com/pytorch/pytorch.git","ssh_url":"git@github.com:pytorch/pytorch.git","clone_url":"https://github.com/pytorch/pytorch.git","svn_url":"https://github.com/pytorch/pytorch","homepage":"https://pytorch.org","size":128985,"stargazers_count":28358,"watchers_count":28358,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":6788,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":3094,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":6788,"open_issues":3094,"watchers":28358,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/pytorch/pytorch/pulls/20899"},"html":{"href":"https://github.com/pytorch/pytorch/pull/20899"},"issue":{"href":"https://api.github.com/repos/pytorch/pytorch/issues/20899"},"comments":{"href":"https://api.github.com/repos/pytorch/pytorch/issues/20899/comments"},"review_comments":{"href":"https://api.github.com/repos/pytorch/pytorch/pulls/20899/comments"},"review_comment":{"href":"https://api.github.com/repos/pytorch/pytorch/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/pytorch/pytorch/pulls/20899/commits"},"statuses":{"href":"https://api.github.com/repos/pytorch/pytorch/statuses/4be1efb4e90dccc7e84ab8037b4c9601cfc0d807"}},"author_association":"NONE"}}
{"actor":{"display_login":"suo"}}