{"action":"created","comment":{"url":"https://api.github.com/repos/uber/pyro/pulls/comments/173611777","pull_request_review_id":102840252,"id":173611777,"diff_hunk":"@@ -1,44 +1,40 @@\n #!/usr/bin/env bash\n-set -x\n+\n+set -xe\n+\n+function _cleanup() {\n+    [[ ${#DIRSTACK[@]} -gt 1 ]] && popd\n+    [[ -d ${REF_TMP_DIR} ]] && rm -rf ${REF_TMP_DIR}\n+}\n+\n+trap _cleanup EXIT\n+\n+# Reference is with respect to the `dev` branch, by default.\n+REF_HEAD=${1:-dev}\n+REF_COMMIT=$(git rev-parse --short HEAD)\n+BENCHMARK_FILE=tests/perf/test_benchmark.py\n+BENCHMARK_DIR=$( cd $(dirname \"$0\")/../.benchmarks ; pwd -P )\n+REF_TMP_DIR=.tmp_test_dir\n \n CURRENT_HEAD=$(git rev-parse --abbrev-ref HEAD)\n CURRENT_COMMIT=$(git rev-parse --short HEAD)\n # If the current state is detached head, store current commit info instead.\n if [ ${CURRENT_HEAD} = 'HEAD' ]; then\n-    git checkout -b tmp\n     CURRENT_HEAD=$(git rev-parse HEAD)\n fi\n-# Reference is with respect to the `dev` branch.\n-REF_HEAD=${1:-dev}\n-REF_COMMIT=$(git rev-parse --short HEAD)\n-BENCHMARK_FILE=tests/perf/test_benchmark.py\n-IS_BENCHMARK_FILE_IN_DEV=1\n-REF_EXIT_CODE=0\n-IS_DIRTY=0\n \n-# If uncommitted changes exist, stash these and set a flag.\n-git diff-index --quiet HEAD -- || IS_DIRTY=1\n-git stash\n-git checkout ${REF_HEAD}\n+# clone the repo into the temporary directory and run benchmark tests\n+git clone -b ${REF_HEAD} --single-branch https://github.com/uber/pyro.git ${REF_TMP_DIR}","path":"scripts/profile_model.sh","position":40,"original_position":40,"commit_id":"4cc296b5ce0dc2072ac50c68621232520dbb72b4","original_commit_id":"4cc296b5ce0dc2072ac50c68621232520dbb72b4","user":{"login":"neerajprad","id":1762463,"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},"body":"Good idea. Let me modify this for travis vs. local runs a bit.","created_at":"2018-03-10T04:48:07Z","updated_at":"2018-03-10T04:48:08Z","html_url":"https://github.com/uber/pyro/pull/873#discussion_r173611777","pull_request_url":"https://api.github.com/repos/uber/pyro/pulls/873","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/uber/pyro/pulls/comments/173611777"},"html":{"href":"https://github.com/uber/pyro/pull/873#discussion_r173611777"},"pull_request":{"href":"https://api.github.com/repos/uber/pyro/pulls/873"}},"in_reply_to_id":173608030},"pull_request":{"url":"https://api.github.com/repos/uber/pyro/pulls/873","id":174121055,"html_url":"https://github.com/uber/pyro/pull/873","diff_url":"https://github.com/uber/pyro/pull/873.diff","patch_url":"https://github.com/uber/pyro/pull/873.patch","issue_url":"https://api.github.com/repos/uber/pyro/issues/873","number":873,"state":"open","locked":false,"title":"Fix brittleness in profiling scripts","user":{"login":"neerajprad","id":1762463,"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},"body":"This makes the perf regression and profiling utils from #858 more robust as follows:\r\n - Instead of checking out some reference branch, we create a `tmp` directory pulling in the single branch from github, based on @fritzo's suggestion. This has the benefit that we do not need to worry about any interactions in the current working directory.\r\n - A `_cleanup` function is used as an exit trap to ensure that any temporary directory created is removed when the script exits.\r\n - Increased number of replications.\r\n\r\n~NOTE: If the script runs, I will make changes to run it as a cron job instead.~","created_at":"2018-03-09T22:09:46Z","updated_at":"2018-03-10T04:48:08Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2766b3102d86407037f468a6df74b671d93f3288","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":704871691,"url":"https://api.github.com/repos/uber/pyro/labels/awaiting%20review","name":"awaiting review","color":"fbca04","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/uber/pyro/pulls/873/commits","review_comments_url":"https://api.github.com/repos/uber/pyro/pulls/873/comments","review_comment_url":"https://api.github.com/repos/uber/pyro/pulls/comments{/number}","comments_url":"https://api.github.com/repos/uber/pyro/issues/873/comments","statuses_url":"https://api.github.com/repos/uber/pyro/statuses/4cc296b5ce0dc2072ac50c68621232520dbb72b4","head":{"label":"neerajprad:regtest","ref":"regtest","sha":"4cc296b5ce0dc2072ac50c68621232520dbb72b4","user":{"login":"neerajprad","id":1762463,"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},"repo":{"id":109438492,"name":"pyro","full_name":"neerajprad/pyro","owner":{"login":"neerajprad","id":1762463,"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},"private":false,"html_url":"https://github.com/neerajprad/pyro","description":"Deep universal probabilistic programming with Python and PyTorch","fork":true,"url":"https://api.github.com/repos/neerajprad/pyro","forks_url":"https://api.github.com/repos/neerajprad/pyro/forks","keys_url":"https://api.github.com/repos/neerajprad/pyro/keys{/key_id}","collaborators_url":"https://api.github.com/repos/neerajprad/pyro/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/neerajprad/pyro/teams","hooks_url":"https://api.github.com/repos/neerajprad/pyro/hooks","issue_events_url":"https://api.github.com/repos/neerajprad/pyro/issues/events{/number}","events_url":"https://api.github.com/repos/neerajprad/pyro/events","assignees_url":"https://api.github.com/repos/neerajprad/pyro/assignees{/user}","branches_url":"https://api.github.com/repos/neerajprad/pyro/branches{/branch}","tags_url":"https://api.github.com/repos/neerajprad/pyro/tags","blobs_url":"https://api.github.com/repos/neerajprad/pyro/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/neerajprad/pyro/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/neerajprad/pyro/git/refs{/sha}","trees_url":"https://api.github.com/repos/neerajprad/pyro/git/trees{/sha}","statuses_url":"https://api.github.com/repos/neerajprad/pyro/statuses/{sha}","languages_url":"https://api.github.com/repos/neerajprad/pyro/languages","stargazers_url":"https://api.github.com/repos/neerajprad/pyro/stargazers","contributors_url":"https://api.github.com/repos/neerajprad/pyro/contributors","subscribers_url":"https://api.github.com/repos/neerajprad/pyro/subscribers","subscription_url":"https://api.github.com/repos/neerajprad/pyro/subscription","commits_url":"https://api.github.com/repos/neerajprad/pyro/commits{/sha}","git_commits_url":"https://api.github.com/repos/neerajprad/pyro/git/commits{/sha}","comments_url":"https://api.github.com/repos/neerajprad/pyro/comments{/number}","issue_comment_url":"https://api.github.com/repos/neerajprad/pyro/issues/comments{/number}","contents_url":"https://api.github.com/repos/neerajprad/pyro/contents/{+path}","compare_url":"https://api.github.com/repos/neerajprad/pyro/compare/{base}...{head}","merges_url":"https://api.github.com/repos/neerajprad/pyro/merges","archive_url":"https://api.github.com/repos/neerajprad/pyro/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/neerajprad/pyro/downloads","issues_url":"https://api.github.com/repos/neerajprad/pyro/issues{/number}","pulls_url":"https://api.github.com/repos/neerajprad/pyro/pulls{/number}","milestones_url":"https://api.github.com/repos/neerajprad/pyro/milestones{/number}","notifications_url":"https://api.github.com/repos/neerajprad/pyro/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/neerajprad/pyro/labels{/name}","releases_url":"https://api.github.com/repos/neerajprad/pyro/releases{/id}","deployments_url":"https://api.github.com/repos/neerajprad/pyro/deployments","created_at":"2017-11-03T20:11:21Z","updated_at":"2017-11-03T20:11:23Z","pushed_at":"2018-03-10T01:18:41Z","git_url":"git://github.com/neerajprad/pyro.git","ssh_url":"git@github.com:neerajprad/pyro.git","clone_url":"https://github.com/neerajprad/pyro.git","svn_url":"https://github.com/neerajprad/pyro","homepage":"http://pyro.ai","size":26710,"stargazers_count":0,"watchers_count":0,"language":"Python","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":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"dev"}},"base":{"label":"uber:dev","ref":"dev","sha":"8debb81531cfea65102be9001c46c08e70689f8e","user":{"login":"uber","id":538264,"avatar_url":"https://avatars3.githubusercontent.com/u/538264?v=4","gravatar_id":"","url":"https://api.github.com/users/uber","html_url":"https://github.com/uber","followers_url":"https://api.github.com/users/uber/followers","following_url":"https://api.github.com/users/uber/following{/other_user}","gists_url":"https://api.github.com/users/uber/gists{/gist_id}","starred_url":"https://api.github.com/users/uber/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/uber/subscriptions","organizations_url":"https://api.github.com/users/uber/orgs","repos_url":"https://api.github.com/users/uber/repos","events_url":"https://api.github.com/users/uber/events{/privacy}","received_events_url":"https://api.github.com/users/uber/received_events","type":"Organization","site_admin":false},"repo":{"id":94506832,"name":"pyro","full_name":"uber/pyro","owner":{"login":"uber","id":538264,"avatar_url":"https://avatars3.githubusercontent.com/u/538264?v=4","gravatar_id":"","url":"https://api.github.com/users/uber","html_url":"https://github.com/uber","followers_url":"https://api.github.com/users/uber/followers","following_url":"https://api.github.com/users/uber/following{/other_user}","gists_url":"https://api.github.com/users/uber/gists{/gist_id}","starred_url":"https://api.github.com/users/uber/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/uber/subscriptions","organizations_url":"https://api.github.com/users/uber/orgs","repos_url":"https://api.github.com/users/uber/repos","events_url":"https://api.github.com/users/uber/events{/privacy}","received_events_url":"https://api.github.com/users/uber/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/uber/pyro","description":"Deep universal probabilistic programming with Python and PyTorch","fork":false,"url":"https://api.github.com/repos/uber/pyro","forks_url":"https://api.github.com/repos/uber/pyro/forks","keys_url":"https://api.github.com/repos/uber/pyro/keys{/key_id}","collaborators_url":"https://api.github.com/repos/uber/pyro/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/uber/pyro/teams","hooks_url":"https://api.github.com/repos/uber/pyro/hooks","issue_events_url":"https://api.github.com/repos/uber/pyro/issues/events{/number}","events_url":"https://api.github.com/repos/uber/pyro/events","assignees_url":"https://api.github.com/repos/uber/pyro/assignees{/user}","branches_url":"https://api.github.com/repos/uber/pyro/branches{/branch}","tags_url":"https://api.github.com/repos/uber/pyro/tags","blobs_url":"https://api.github.com/repos/uber/pyro/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/uber/pyro/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/uber/pyro/git/refs{/sha}","trees_url":"https://api.github.com/repos/uber/pyro/git/trees{/sha}","statuses_url":"https://api.github.com/repos/uber/pyro/statuses/{sha}","languages_url":"https://api.github.com/repos/uber/pyro/languages","stargazers_url":"https://api.github.com/repos/uber/pyro/stargazers","contributors_url":"https://api.github.com/repos/uber/pyro/contributors","subscribers_url":"https://api.github.com/repos/uber/pyro/subscribers","subscription_url":"https://api.github.com/repos/uber/pyro/subscription","commits_url":"https://api.github.com/repos/uber/pyro/commits{/sha}","git_commits_url":"https://api.github.com/repos/uber/pyro/git/commits{/sha}","comments_url":"https://api.github.com/repos/uber/pyro/comments{/number}","issue_comment_url":"https://api.github.com/repos/uber/pyro/issues/comments{/number}","contents_url":"https://api.github.com/repos/uber/pyro/contents/{+path}","compare_url":"https://api.github.com/repos/uber/pyro/compare/{base}...{head}","merges_url":"https://api.github.com/repos/uber/pyro/merges","archive_url":"https://api.github.com/repos/uber/pyro/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/uber/pyro/downloads","issues_url":"https://api.github.com/repos/uber/pyro/issues{/number}","pulls_url":"https://api.github.com/repos/uber/pyro/pulls{/number}","milestones_url":"https://api.github.com/repos/uber/pyro/milestones{/number}","notifications_url":"https://api.github.com/repos/uber/pyro/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/uber/pyro/labels{/name}","releases_url":"https://api.github.com/repos/uber/pyro/releases{/id}","deployments_url":"https://api.github.com/repos/uber/pyro/deployments","created_at":"2017-06-16T05:03:47Z","updated_at":"2018-03-09T19:51:43Z","pushed_at":"2018-03-10T02:18:37Z","git_url":"git://github.com/uber/pyro.git","ssh_url":"git@github.com:uber/pyro.git","clone_url":"https://github.com/uber/pyro.git","svn_url":"https://github.com/uber/pyro","homepage":"http://pyro.ai","size":50297,"stargazers_count":3014,"watchers_count":3014,"language":"Jupyter Notebook","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":301,"mirror_url":null,"archived":false,"open_issues_count":65,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":301,"open_issues":65,"watchers":3014,"default_branch":"dev"}},"_links":{"self":{"href":"https://api.github.com/repos/uber/pyro/pulls/873"},"html":{"href":"https://github.com/uber/pyro/pull/873"},"issue":{"href":"https://api.github.com/repos/uber/pyro/issues/873"},"comments":{"href":"https://api.github.com/repos/uber/pyro/issues/873/comments"},"review_comments":{"href":"https://api.github.com/repos/uber/pyro/pulls/873/comments"},"review_comment":{"href":"https://api.github.com/repos/uber/pyro/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/uber/pyro/pulls/873/commits"},"statuses":{"href":"https://api.github.com/repos/uber/pyro/statuses/4cc296b5ce0dc2072ac50c68621232520dbb72b4"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"neerajprad"}}