{"action":"created","comment":{"url":"https://api.github.com/repos/dmlc/tvm/pulls/comments/174936555","pull_request_review_id":104385200,"id":174936555,"diff_hunk":"@@ -307,6 +289,14 @@ class ThreadPool {\n     return res;\n   }\n \n+  void Shutdown() {\n+    for (std::unique_ptr<SpscTaskQueue>& q : queues_) {","path":"src/runtime/thread_pool.cc","position":118,"original_position":95,"commit_id":"ad61f0fa35b568d2132960304a518ac22fc74cc7","original_commit_id":"12e03b186ce3110c55bca14cbd465f686985c073","user":{"login":"nhynes","id":2353785,"avatar_url":"https://avatars2.githubusercontent.com/u/2353785?v=4","gravatar_id":"","url":"https://api.github.com/users/nhynes","html_url":"https://github.com/nhynes","followers_url":"https://api.github.com/users/nhynes/followers","following_url":"https://api.github.com/users/nhynes/following{/other_user}","gists_url":"https://api.github.com/users/nhynes/gists{/gist_id}","starred_url":"https://api.github.com/users/nhynes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nhynes/subscriptions","organizations_url":"https://api.github.com/users/nhynes/orgs","repos_url":"https://api.github.com/users/nhynes/repos","events_url":"https://api.github.com/users/nhynes/events{/privacy}","received_events_url":"https://api.github.com/users/nhynes/received_events","type":"User","site_admin":false},"body":"The queues can't be cleared on the SGX side since the untrusted world needs to join the threads. Instead, I made it so that further events can't be Enqueued.","created_at":"2018-03-15T21:21:24Z","updated_at":"2018-03-15T21:21:24Z","html_url":"https://github.com/dmlc/tvm/pull/991#discussion_r174936555","pull_request_url":"https://api.github.com/repos/dmlc/tvm/pulls/991","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/dmlc/tvm/pulls/comments/174936555"},"html":{"href":"https://github.com/dmlc/tvm/pull/991#discussion_r174936555"},"pull_request":{"href":"https://api.github.com/repos/dmlc/tvm/pulls/991"}},"in_reply_to_id":174646421},"pull_request":{"url":"https://api.github.com/repos/dmlc/tvm/pulls/991","id":174204730,"html_url":"https://github.com/dmlc/tvm/pull/991","diff_url":"https://github.com/dmlc/tvm/pull/991.diff","patch_url":"https://github.com/dmlc/tvm/pull/991.patch","issue_url":"https://api.github.com/repos/dmlc/tvm/issues/991","number":991,"state":"open","locked":false,"title":"Pluggable Thread Launching Mechanism","user":{"login":"nhynes","id":2353785,"avatar_url":"https://avatars2.githubusercontent.com/u/2353785?v=4","gravatar_id":"","url":"https://api.github.com/users/nhynes","html_url":"https://github.com/nhynes","followers_url":"https://api.github.com/users/nhynes/followers","following_url":"https://api.github.com/users/nhynes/following{/other_user}","gists_url":"https://api.github.com/users/nhynes/gists{/gist_id}","starred_url":"https://api.github.com/users/nhynes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nhynes/subscriptions","organizations_url":"https://api.github.com/users/nhynes/orgs","repos_url":"https://api.github.com/users/nhynes/repos","events_url":"https://api.github.com/users/nhynes/events{/privacy}","received_events_url":"https://api.github.com/users/nhynes/received_events","type":"User","site_admin":false},"body":"Multi-threaded TVM in SGX.\r\n\r\nBasically the idea is:\r\n1. configure a thread pool in the untrusted environment w/ `num_threads` and target `enclave_id`\r\n2. when a job is launched, place the tasks in the trusted thread queues\r\n3. start the untrusted thread pool, which has threads enter the enclave and start popping tasks off their respective queues\r\n4. join the tasks in the enclave\r\n5. join the untrusted thread pool\r\n\r\nThe WIP is because I haven't yet tested this with NNVM workloads.","created_at":"2018-03-11T05:03:09Z","updated_at":"2018-03-15T21:21:24Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c56ca09f28884cae1dfb4311ca943de04e009b3b","assignee":null,"assignees":[],"requested_reviewers":[{"login":"yidawang","id":4458509,"avatar_url":"https://avatars3.githubusercontent.com/u/4458509?v=4","gravatar_id":"","url":"https://api.github.com/users/yidawang","html_url":"https://github.com/yidawang","followers_url":"https://api.github.com/users/yidawang/followers","following_url":"https://api.github.com/users/yidawang/following{/other_user}","gists_url":"https://api.github.com/users/yidawang/gists{/gist_id}","starred_url":"https://api.github.com/users/yidawang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yidawang/subscriptions","organizations_url":"https://api.github.com/users/yidawang/orgs","repos_url":"https://api.github.com/users/yidawang/repos","events_url":"https://api.github.com/users/yidawang/events{/privacy}","received_events_url":"https://api.github.com/users/yidawang/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[{"id":858776288,"url":"https://api.github.com/repos/dmlc/tvm/labels/status:%20review%20in%20progress","name":"status: review in progress","color":"a9c2e8","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/dmlc/tvm/pulls/991/commits","review_comments_url":"https://api.github.com/repos/dmlc/tvm/pulls/991/comments","review_comment_url":"https://api.github.com/repos/dmlc/tvm/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dmlc/tvm/issues/991/comments","statuses_url":"https://api.github.com/repos/dmlc/tvm/statuses/ad61f0fa35b568d2132960304a518ac22fc74cc7","head":{"label":"nhynes:sgx-mp","ref":"sgx-mp","sha":"ad61f0fa35b568d2132960304a518ac22fc74cc7","user":{"login":"nhynes","id":2353785,"avatar_url":"https://avatars2.githubusercontent.com/u/2353785?v=4","gravatar_id":"","url":"https://api.github.com/users/nhynes","html_url":"https://github.com/nhynes","followers_url":"https://api.github.com/users/nhynes/followers","following_url":"https://api.github.com/users/nhynes/following{/other_user}","gists_url":"https://api.github.com/users/nhynes/gists{/gist_id}","starred_url":"https://api.github.com/users/nhynes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nhynes/subscriptions","organizations_url":"https://api.github.com/users/nhynes/orgs","repos_url":"https://api.github.com/users/nhynes/repos","events_url":"https://api.github.com/users/nhynes/events{/privacy}","received_events_url":"https://api.github.com/users/nhynes/received_events","type":"User","site_admin":false},"repo":{"id":122412898,"name":"tvm","full_name":"nhynes/tvm","owner":{"login":"nhynes","id":2353785,"avatar_url":"https://avatars2.githubusercontent.com/u/2353785?v=4","gravatar_id":"","url":"https://api.github.com/users/nhynes","html_url":"https://github.com/nhynes","followers_url":"https://api.github.com/users/nhynes/followers","following_url":"https://api.github.com/users/nhynes/following{/other_user}","gists_url":"https://api.github.com/users/nhynes/gists{/gist_id}","starred_url":"https://api.github.com/users/nhynes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nhynes/subscriptions","organizations_url":"https://api.github.com/users/nhynes/orgs","repos_url":"https://api.github.com/users/nhynes/repos","events_url":"https://api.github.com/users/nhynes/events{/privacy}","received_events_url":"https://api.github.com/users/nhynes/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/nhynes/tvm","description":"bring deep learning workloads to bare metal","fork":true,"url":"https://api.github.com/repos/nhynes/tvm","forks_url":"https://api.github.com/repos/nhynes/tvm/forks","keys_url":"https://api.github.com/repos/nhynes/tvm/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nhynes/tvm/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nhynes/tvm/teams","hooks_url":"https://api.github.com/repos/nhynes/tvm/hooks","issue_events_url":"https://api.github.com/repos/nhynes/tvm/issues/events{/number}","events_url":"https://api.github.com/repos/nhynes/tvm/events","assignees_url":"https://api.github.com/repos/nhynes/tvm/assignees{/user}","branches_url":"https://api.github.com/repos/nhynes/tvm/branches{/branch}","tags_url":"https://api.github.com/repos/nhynes/tvm/tags","blobs_url":"https://api.github.com/repos/nhynes/tvm/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nhynes/tvm/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nhynes/tvm/git/refs{/sha}","trees_url":"https://api.github.com/repos/nhynes/tvm/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nhynes/tvm/statuses/{sha}","languages_url":"https://api.github.com/repos/nhynes/tvm/languages","stargazers_url":"https://api.github.com/repos/nhynes/tvm/stargazers","contributors_url":"https://api.github.com/repos/nhynes/tvm/contributors","subscribers_url":"https://api.github.com/repos/nhynes/tvm/subscribers","subscription_url":"https://api.github.com/repos/nhynes/tvm/subscription","commits_url":"https://api.github.com/repos/nhynes/tvm/commits{/sha}","git_commits_url":"https://api.github.com/repos/nhynes/tvm/git/commits{/sha}","comments_url":"https://api.github.com/repos/nhynes/tvm/comments{/number}","issue_comment_url":"https://api.github.com/repos/nhynes/tvm/issues/comments{/number}","contents_url":"https://api.github.com/repos/nhynes/tvm/contents/{+path}","compare_url":"https://api.github.com/repos/nhynes/tvm/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nhynes/tvm/merges","archive_url":"https://api.github.com/repos/nhynes/tvm/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nhynes/tvm/downloads","issues_url":"https://api.github.com/repos/nhynes/tvm/issues{/number}","pulls_url":"https://api.github.com/repos/nhynes/tvm/pulls{/number}","milestones_url":"https://api.github.com/repos/nhynes/tvm/milestones{/number}","notifications_url":"https://api.github.com/repos/nhynes/tvm/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nhynes/tvm/labels{/name}","releases_url":"https://api.github.com/repos/nhynes/tvm/releases{/id}","deployments_url":"https://api.github.com/repos/nhynes/tvm/deployments","created_at":"2018-02-22T00:50:41Z","updated_at":"2018-02-22T00:50:44Z","pushed_at":"2018-03-15T20:05:13Z","git_url":"git://github.com/nhynes/tvm.git","ssh_url":"git@github.com:nhynes/tvm.git","clone_url":"https://github.com/nhynes/tvm.git","svn_url":"https://github.com/nhynes/tvm","homepage":"","size":3292,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"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"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"dmlc:master","ref":"master","sha":"1d6df5a187127f514ea48f6a8a74c77ff59c89f5","user":{"login":"dmlc","id":11508361,"avatar_url":"https://avatars2.githubusercontent.com/u/11508361?v=4","gravatar_id":"","url":"https://api.github.com/users/dmlc","html_url":"https://github.com/dmlc","followers_url":"https://api.github.com/users/dmlc/followers","following_url":"https://api.github.com/users/dmlc/following{/other_user}","gists_url":"https://api.github.com/users/dmlc/gists{/gist_id}","starred_url":"https://api.github.com/users/dmlc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dmlc/subscriptions","organizations_url":"https://api.github.com/users/dmlc/orgs","repos_url":"https://api.github.com/users/dmlc/repos","events_url":"https://api.github.com/users/dmlc/events{/privacy}","received_events_url":"https://api.github.com/users/dmlc/received_events","type":"Organization","site_admin":false},"repo":{"id":70746484,"name":"tvm","full_name":"dmlc/tvm","owner":{"login":"dmlc","id":11508361,"avatar_url":"https://avatars2.githubusercontent.com/u/11508361?v=4","gravatar_id":"","url":"https://api.github.com/users/dmlc","html_url":"https://github.com/dmlc","followers_url":"https://api.github.com/users/dmlc/followers","following_url":"https://api.github.com/users/dmlc/following{/other_user}","gists_url":"https://api.github.com/users/dmlc/gists{/gist_id}","starred_url":"https://api.github.com/users/dmlc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dmlc/subscriptions","organizations_url":"https://api.github.com/users/dmlc/orgs","repos_url":"https://api.github.com/users/dmlc/repos","events_url":"https://api.github.com/users/dmlc/events{/privacy}","received_events_url":"https://api.github.com/users/dmlc/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/dmlc/tvm","description":"bring deep learning workloads to bare metal","fork":false,"url":"https://api.github.com/repos/dmlc/tvm","forks_url":"https://api.github.com/repos/dmlc/tvm/forks","keys_url":"https://api.github.com/repos/dmlc/tvm/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dmlc/tvm/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dmlc/tvm/teams","hooks_url":"https://api.github.com/repos/dmlc/tvm/hooks","issue_events_url":"https://api.github.com/repos/dmlc/tvm/issues/events{/number}","events_url":"https://api.github.com/repos/dmlc/tvm/events","assignees_url":"https://api.github.com/repos/dmlc/tvm/assignees{/user}","branches_url":"https://api.github.com/repos/dmlc/tvm/branches{/branch}","tags_url":"https://api.github.com/repos/dmlc/tvm/tags","blobs_url":"https://api.github.com/repos/dmlc/tvm/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dmlc/tvm/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dmlc/tvm/git/refs{/sha}","trees_url":"https://api.github.com/repos/dmlc/tvm/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dmlc/tvm/statuses/{sha}","languages_url":"https://api.github.com/repos/dmlc/tvm/languages","stargazers_url":"https://api.github.com/repos/dmlc/tvm/stargazers","contributors_url":"https://api.github.com/repos/dmlc/tvm/contributors","subscribers_url":"https://api.github.com/repos/dmlc/tvm/subscribers","subscription_url":"https://api.github.com/repos/dmlc/tvm/subscription","commits_url":"https://api.github.com/repos/dmlc/tvm/commits{/sha}","git_commits_url":"https://api.github.com/repos/dmlc/tvm/git/commits{/sha}","comments_url":"https://api.github.com/repos/dmlc/tvm/comments{/number}","issue_comment_url":"https://api.github.com/repos/dmlc/tvm/issues/comments{/number}","contents_url":"https://api.github.com/repos/dmlc/tvm/contents/{+path}","compare_url":"https://api.github.com/repos/dmlc/tvm/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dmlc/tvm/merges","archive_url":"https://api.github.com/repos/dmlc/tvm/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dmlc/tvm/downloads","issues_url":"https://api.github.com/repos/dmlc/tvm/issues{/number}","pulls_url":"https://api.github.com/repos/dmlc/tvm/pulls{/number}","milestones_url":"https://api.github.com/repos/dmlc/tvm/milestones{/number}","notifications_url":"https://api.github.com/repos/dmlc/tvm/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dmlc/tvm/labels{/name}","releases_url":"https://api.github.com/repos/dmlc/tvm/releases{/id}","deployments_url":"https://api.github.com/repos/dmlc/tvm/deployments","created_at":"2016-10-12T22:20:28Z","updated_at":"2018-03-15T17:18:22Z","pushed_at":"2018-03-15T20:05:15Z","git_url":"git://github.com/dmlc/tvm.git","ssh_url":"git@github.com:dmlc/tvm.git","clone_url":"https://github.com/dmlc/tvm.git","svn_url":"https://github.com/dmlc/tvm","homepage":"","size":3271,"stargazers_count":1233,"watchers_count":1233,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":233,"mirror_url":null,"archived":false,"open_issues_count":33,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":233,"open_issues":33,"watchers":1233,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dmlc/tvm/pulls/991"},"html":{"href":"https://github.com/dmlc/tvm/pull/991"},"issue":{"href":"https://api.github.com/repos/dmlc/tvm/issues/991"},"comments":{"href":"https://api.github.com/repos/dmlc/tvm/issues/991/comments"},"review_comments":{"href":"https://api.github.com/repos/dmlc/tvm/pulls/991/comments"},"review_comment":{"href":"https://api.github.com/repos/dmlc/tvm/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dmlc/tvm/pulls/991/commits"},"statuses":{"href":"https://api.github.com/repos/dmlc/tvm/statuses/ad61f0fa35b568d2132960304a518ac22fc74cc7"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"nhynes"}}