{"action":"created","issue":{"url":"https://api.github.com/repos/pytorch/glow/issues/1688","repository_url":"https://api.github.com/repos/pytorch/glow","labels_url":"https://api.github.com/repos/pytorch/glow/issues/1688/labels{/name}","comments_url":"https://api.github.com/repos/pytorch/glow/issues/1688/comments","events_url":"https://api.github.com/repos/pytorch/glow/issues/1688/events","html_url":"https://github.com/pytorch/glow/issues/1688","id":362411679,"node_id":"MDU6SXNzdWUzNjI0MTE2Nzk=","number":1688,"title":"[GraphOptimizer] Optimizations clobber graph with dead nodes","user":{"login":"aturetsk","id":22938838,"node_id":"MDQ6VXNlcjIyOTM4ODM4","avatar_url":"https://avatars0.githubusercontent.com/u/22938838?v=4","gravatar_id":"","url":"https://api.github.com/users/aturetsk","html_url":"https://github.com/aturetsk","followers_url":"https://api.github.com/users/aturetsk/followers","following_url":"https://api.github.com/users/aturetsk/following{/other_user}","gists_url":"https://api.github.com/users/aturetsk/gists{/gist_id}","starred_url":"https://api.github.com/users/aturetsk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aturetsk/subscriptions","organizations_url":"https://api.github.com/users/aturetsk/orgs","repos_url":"https://api.github.com/users/aturetsk/repos","events_url":"https://api.github.com/users/aturetsk/events{/privacy}","received_events_url":"https://api.github.com/users/aturetsk/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"bertmaher","id":4441820,"node_id":"MDQ6VXNlcjQ0NDE4MjA=","avatar_url":"https://avatars1.githubusercontent.com/u/4441820?v=4","gravatar_id":"","url":"https://api.github.com/users/bertmaher","html_url":"https://github.com/bertmaher","followers_url":"https://api.github.com/users/bertmaher/followers","following_url":"https://api.github.com/users/bertmaher/following{/other_user}","gists_url":"https://api.github.com/users/bertmaher/gists{/gist_id}","starred_url":"https://api.github.com/users/bertmaher/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bertmaher/subscriptions","organizations_url":"https://api.github.com/users/bertmaher/orgs","repos_url":"https://api.github.com/users/bertmaher/repos","events_url":"https://api.github.com/users/bertmaher/events{/privacy}","received_events_url":"https://api.github.com/users/bertmaher/received_events","type":"User","site_admin":false},"assignees":[{"login":"bertmaher","id":4441820,"node_id":"MDQ6VXNlcjQ0NDE4MjA=","avatar_url":"https://avatars1.githubusercontent.com/u/4441820?v=4","gravatar_id":"","url":"https://api.github.com/users/bertmaher","html_url":"https://github.com/bertmaher","followers_url":"https://api.github.com/users/bertmaher/followers","following_url":"https://api.github.com/users/bertmaher/following{/other_user}","gists_url":"https://api.github.com/users/bertmaher/gists{/gist_id}","starred_url":"https://api.github.com/users/bertmaher/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bertmaher/subscriptions","organizations_url":"https://api.github.com/users/bertmaher/orgs","repos_url":"https://api.github.com/users/bertmaher/repos","events_url":"https://api.github.com/users/bertmaher/events{/privacy}","received_events_url":"https://api.github.com/users/bertmaher/received_events","type":"User","site_admin":false}],"milestone":null,"comments":2,"created_at":"2018-09-21T00:09:05Z","updated_at":"2018-12-18T18:57:35Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"Optimizations in GLOW do not erase transformed nodes from the graph and relay on DCE to clean up. This corrupts number of node users (e.g. an optimization can't relay on node->hasOneUser() unless DCE has been done right before it).\r\n\r\nIt looks like GLOW optimizations are going to be refactored into separate classes inherited from FunctionPass (https://github.com/pytorch/glow/pull/1659). In this case one of the possible solutions is to make FunctionPass class always call DCE after the optimization is done."},"comment":{"url":"https://api.github.com/repos/pytorch/glow/issues/comments/448330899","html_url":"https://github.com/pytorch/glow/issues/1688#issuecomment-448330899","issue_url":"https://api.github.com/repos/pytorch/glow/issues/1688","id":448330899,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0ODMzMDg5OQ==","user":{"login":"bertmaher","id":4441820,"node_id":"MDQ6VXNlcjQ0NDE4MjA=","avatar_url":"https://avatars1.githubusercontent.com/u/4441820?v=4","gravatar_id":"","url":"https://api.github.com/users/bertmaher","html_url":"https://github.com/bertmaher","followers_url":"https://api.github.com/users/bertmaher/followers","following_url":"https://api.github.com/users/bertmaher/following{/other_user}","gists_url":"https://api.github.com/users/bertmaher/gists{/gist_id}","starred_url":"https://api.github.com/users/bertmaher/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bertmaher/subscriptions","organizations_url":"https://api.github.com/users/bertmaher/orgs","repos_url":"https://api.github.com/users/bertmaher/repos","events_url":"https://api.github.com/users/bertmaher/events{/privacy}","received_events_url":"https://api.github.com/users/bertmaher/received_events","type":"User","site_admin":false},"created_at":"2018-12-18T18:57:35Z","updated_at":"2018-12-18T18:57:35Z","author_association":"CONTRIBUTOR","body":"This issue is pretty interesting.  I don't think it's correct to say that RAUW \"corrupts\" the graph, because the graph is still valid after RAUW, it just contains obvious dead code (i.e. the thing that was replaced) that might prevent other optimizations from kicking in.\r\n\r\n1. We could try to make RAUW erase the replaced node from the graph.  But this approach is very dangerous, because you're usually calling RAUW inside a loop over the nodes, and erasing from a list while iterating it can easily lead to dereferencing freed things.  (I have taken this approach in other systems, though.)\r\n2. We could iterate optimizations followed by DCE to a fixed point (similar to what's suggested in the initial issue report).  This approach is pretty common, although we have to be careful not to accidentally create some quadratic-or-worse behavior."}}
{"actor":{"display_login":"bertmaher"}}