{"action":"closed","issue":{"url":"https://api.github.com/repos/uber/pyro/issues/1456","repository_url":"https://api.github.com/repos/uber/pyro","labels_url":"https://api.github.com/repos/uber/pyro/issues/1456/labels{/name}","comments_url":"https://api.github.com/repos/uber/pyro/issues/1456/comments","events_url":"https://api.github.com/repos/uber/pyro/issues/1456/events","html_url":"https://github.com/uber/pyro/issues/1456","id":370829946,"node_id":"MDU6SXNzdWUzNzA4Mjk5NDY=","number":1456,"title":"Make dynamic distribution mixin wrappers in torch.py picklable","user":{"login":"neerajprad","id":1762463,"node_id":"MDQ6VXNlcjE3NjI0NjM=","avatar_url":"https://avatars3.githubusercontent.com/u/1762463?v=4","gravatar_id":"","url":"https://api.github.com/users/neerajprad","html_url":"https://github.com/neerajprad","followers_url":"https://api.github.com/users/neerajprad/followers","following_url":"https://api.github.com/users/neerajprad/following{/other_user}","gists_url":"https://api.github.com/users/neerajprad/gists{/gist_id}","starred_url":"https://api.github.com/users/neerajprad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/neerajprad/subscriptions","organizations_url":"https://api.github.com/users/neerajprad/orgs","repos_url":"https://api.github.com/users/neerajprad/repos","events_url":"https://api.github.com/users/neerajprad/events{/privacy}","received_events_url":"https://api.github.com/users/neerajprad/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":{"login":"neerajprad","id":1762463,"node_id":"MDQ6VXNlcjE3NjI0NjM=","avatar_url":"https://avatars3.githubusercontent.com/u/1762463?v=4","gravatar_id":"","url":"https://api.github.com/users/neerajprad","html_url":"https://github.com/neerajprad","followers_url":"https://api.github.com/users/neerajprad/followers","following_url":"https://api.github.com/users/neerajprad/following{/other_user}","gists_url":"https://api.github.com/users/neerajprad/gists{/gist_id}","starred_url":"https://api.github.com/users/neerajprad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/neerajprad/subscriptions","organizations_url":"https://api.github.com/users/neerajprad/orgs","repos_url":"https://api.github.com/users/neerajprad/repos","events_url":"https://api.github.com/users/neerajprad/events{/privacy}","received_events_url":"https://api.github.com/users/neerajprad/received_events","type":"User","site_admin":false},"assignees":[{"login":"neerajprad","id":1762463,"node_id":"MDQ6VXNlcjE3NjI0NjM=","avatar_url":"https://avatars3.githubusercontent.com/u/1762463?v=4","gravatar_id":"","url":"https://api.github.com/users/neerajprad","html_url":"https://github.com/neerajprad","followers_url":"https://api.github.com/users/neerajprad/followers","following_url":"https://api.github.com/users/neerajprad/following{/other_user}","gists_url":"https://api.github.com/users/neerajprad/gists{/gist_id}","starred_url":"https://api.github.com/users/neerajprad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/neerajprad/subscriptions","organizations_url":"https://api.github.com/users/neerajprad/orgs","repos_url":"https://api.github.com/users/neerajprad/repos","events_url":"https://api.github.com/users/neerajprad/events{/privacy}","received_events_url":"https://api.github.com/users/neerajprad/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/uber/pyro/milestones/5","html_url":"https://github.com/uber/pyro/milestone/5","labels_url":"https://api.github.com/repos/uber/pyro/milestones/5/labels","id":3287038,"node_id":"MDk6TWlsZXN0b25lMzI4NzAzOA==","number":5,"title":"0.3.0 release","description":"Follows PyTorch 1.0 release","creator":{"login":"fritzo","id":648532,"node_id":"MDQ6VXNlcjY0ODUzMg==","avatar_url":"https://avatars0.githubusercontent.com/u/648532?v=4","gravatar_id":"","url":"https://api.github.com/users/fritzo","html_url":"https://github.com/fritzo","followers_url":"https://api.github.com/users/fritzo/followers","following_url":"https://api.github.com/users/fritzo/following{/other_user}","gists_url":"https://api.github.com/users/fritzo/gists{/gist_id}","starred_url":"https://api.github.com/users/fritzo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fritzo/subscriptions","organizations_url":"https://api.github.com/users/fritzo/orgs","repos_url":"https://api.github.com/users/fritzo/repos","events_url":"https://api.github.com/users/fritzo/events{/privacy}","received_events_url":"https://api.github.com/users/fritzo/received_events","type":"User","site_admin":false},"open_issues":28,"closed_issues":18,"state":"open","created_at":"2018-04-22T18:24:15Z","updated_at":"2018-10-18T00:33:57Z","due_on":"2018-12-04T08:00:00Z","closed_at":null},"comments":2,"created_at":"2018-10-16T22:47:06Z","updated_at":"2018-10-18T00:33:57Z","closed_at":"2018-10-18T00:33:57Z","author_association":"COLLABORATOR","body":"We load torch distributions and create distribution mixin classes dynamically in `torch.py`. These distribution instances are not picklable however.\r\n\r\n```python\r\n>>> pickle.dumps(Pareto(1., 1.))\r\nTraceback (most recent call last):\r\n  File \"<stdin>\", line 1, in <module>\r\n_pickle.PicklingError: Can't pickle <class 'pyro.distributions.torch._PyroDist'>: it's not the same object as pyro.distributions.torch._PyroDist\r\n```\r\nWe may need to provide more help to `pickle` to be able pickle / unpickle these instances. Note that this is not currently an issue with most distribution classes since they have a small wrapper in Pyro (containing `.expand` method), but will be in `pyro==0.3` where we are constructing these wrappers automatically.\r\n\r\n### Why do we need this?\r\n\r\nThis will be useful in the multiprocessing context where workers send back traces to the main process. All elements in the trace (inc. distribution instances) should be picklable in that case. An alternative design would be to not send back the full trace, but only the empirical distribution itself, but this is worth exploring only if the overhead of trace serialization/deserialization is considerable."}}
{"actor":{"display_login":"neerajprad"}}