payload: {"action":"created","comment":{"url":"https://api.github.com/repos/apache/incubator-tvm/pulls/comments/346027734","pull_request_review_id":316590027,"id":346027734,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDM0NjAyNzczNA==","diff_hunk":"@@ -589,6 +597,25 @@ std::string AsText(const NodeRef& node,\n                    bool show_meta_data = true,\n                    runtime::TypedPackedFunc<std::string(Expr)> annotate = nullptr);\n \n+/*! \\brief namespace of the attributes that are attached to a function. */\n+namespace attr {\n+/*! \\brief Mark the function as a primitive function. */","path":"include/tvm/relay/expr.h","position":21,"original_position":21,"commit_id":"72d3a386b9906be24f3a8a15a4d6473945597ba9","original_commit_id":"72d3a386b9906be24f3a8a15a4d6473945597ba9","user":{"login":"u99127","id":19559067,"node_id":"MDQ6VXNlcjE5NTU5MDY3","avatar_url":"https://avatars3.githubusercontent.com/u/19559067?v=4","gravatar_id":"","url":"https://api.github.com/users/u99127","html_url":"https://github.com/u99127","followers_url":"https://api.github.com/users/u99127/followers","following_url":"https://api.github.com/users/u99127/following{/other_user}","gists_url":"https://api.github.com/users/u99127/gists{/gist_id}","starred_url":"https://api.github.com/users/u99127/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/u99127/subscriptions","organizations_url":"https://api.github.com/users/u99127/orgs","repos_url":"https://api.github.com/users/u99127/repos","events_url":"https://api.github.com/users/u99127/events{/privacy}","received_events_url":"https://api.github.com/users/u99127/received_events","type":"User","site_admin":false},"body":"What do we mean by a \"primitive\" function ?","created_at":"2019-11-13T22:06:01Z","updated_at":"2019-11-13T22:20:07Z","html_url":"https://github.com/apache/incubator-tvm/pull/4258#discussion_r346027734","pull_request_url":"https://api.github.com/repos/apache/incubator-tvm/pulls/4258","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/apache/incubator-tvm/pulls/comments/346027734"},"html":{"href":"https://github.com/apache/incubator-tvm/pull/4258#discussion_r346027734"},"pull_request":{"href":"https://api.github.com/repos/apache/incubator-tvm/pulls/4258"}}},"pull_request":{"url":"https://api.github.com/repos/apache/incubator-tvm/pulls/4258","id":336981832,"node_id":"MDExOlB1bGxSZXF1ZXN0MzM2OTgxODMy","html_url":"https://github.com/apache/incubator-tvm/pull/4258","diff_url":"https://github.com/apache/incubator-tvm/pull/4258.diff","patch_url":"https://github.com/apache/incubator-tvm/pull/4258.patch","issue_url":"https://api.github.com/repos/apache/incubator-tvm/issues/4258","number":4258,"state":"open","locked":false,"title":"[WIP][TVM] Bring Your Own Codegen to TVM","user":{"login":"zhiics","id":5145158,"node_id":"MDQ6VXNlcjUxNDUxNTg=","avatar_url":"https://avatars1.githubusercontent.com/u/5145158?v=4","gravatar_id":"","url":"https://api.github.com/users/zhiics","html_url":"https://github.com/zhiics","followers_url":"https://api.github.com/users/zhiics/followers","following_url":"https://api.github.com/users/zhiics/following{/other_user}","gists_url":"https://api.github.com/users/zhiics/gists{/gist_id}","starred_url":"https://api.github.com/users/zhiics/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zhiics/subscriptions","organizations_url":"https://api.github.com/users/zhiics/orgs","repos_url":"https://api.github.com/users/zhiics/repos","events_url":"https://api.github.com/users/zhiics/events{/privacy}","received_events_url":"https://api.github.com/users/zhiics/received_events","type":"User","site_admin":false},"body":"This is a WIP that enables different backends and/or hardware vendors to bring their own codegen tools to TVM. This is the collaboration between @comaniac and me. @jroesch also provided lots of suggestions in the initial design. The RFC can be found here:  https://discuss.tvm.ai/t/bring-your-own-codegen-to-tvm/4501/27\r\n\r\nSome high-level design and APIs involve the following parts:\r\n\r\n- Graph coloring/annotation\r\nProviding HW vendors an infra to customize where they want to execute an op.\r\nTwo possible ways are allowed to annotate a graph:\r\n  - Custom pass: users can write a Relay pass to decide how they want to partition graph using (`subgraph_begin` and `subgraph_end` annotations). For example, more sophisticated algorithm could be implemented to annotate the groups of operators.\r\n  - A high-level API is used to help user/vendors to enable a convenient integration\r\n       ```python\r\n       @reg.register_extern_op(\"nn.conv2d\")\r\n       def conv2d(attrs, args, comp):\r\n\t       return get_extern_op(comp, \"conv2d\")(attrs, args)\r\n    ```\r\n    Each codegen only needs provide the supported operators and they can invoke a separate build pipeline, e.g. `build_extern`, to invoke partitioning. On the completion of this pipeline, the operators that will be offloaded is wrapped with `subgraph_start` and `subgraph_end` annotation. The annotated program will then be sent to the normal `build` pipeline for code and artifacts generation.\r\n    ```python\r\n    @reg.register_extern_op(\"nn.conv2d\")\r\n    def conv2d(attrs, args, comp):\r\n\t    return get_extern_op(comp, \"conv2d\")(attrs, args)\r\n    ```\r\n      \r\n- Graph partitioning\r\nIt is a Relay pass that partitions a program into segments that could be executed on various hardware platforms based on the annotations. The current implementation has not fused consecutive subgraphs belonging to the same backend together yet. It will be handled by follow-up PRs.\r\n\r\n- Code generation\r\nGenerate code for each segment of a partition Relay program. Each codegen tool is wrapped into a runtime module so that we can leverage the current TVM infra to do serialization and runtime invocation.\r\n\r\nFYI, we currently used GCC as an external codegen tool for easy prototyping and verification. It should be removed later when we land it.\r\n\r\ncc @tqchen @yzhliu @wweic @broune @soiferj @junrushao1994 @icemelon9 ","created_at":"2019-11-05T20:49:29Z","updated_at":"2019-11-13T22:20:07Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ad2288f210b78676e61d655bde2cfbe35f8cf36c","assignee":{"login":"tqchen","id":2577440,"node_id":"MDQ6VXNlcjI1Nzc0NDA=","avatar_url":"https://avatars3.githubusercontent.com/u/2577440?v=4","gravatar_id":"","url":"https://api.github.com/users/tqchen","html_url":"https://github.com/tqchen","followers_url":"https://api.github.com/users/tqchen/followers","following_url":"https://api.github.com/users/tqchen/following{/other_user}","gists_url":"https://api.github.com/users/tqchen/gists{/gist_id}","starred_url":"https://api.github.com/users/tqchen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tqchen/subscriptions","organizations_url":"https://api.github.com/users/tqchen/orgs","repos_url":"https://api.github.com/users/tqchen/repos","events_url":"https://api.github.com/users/tqchen/events{/privacy}","received_events_url":"https://api.github.com/users/tqchen/received_events","type":"User","site_admin":false},"assignees":[{"login":"tqchen","id":2577440,"node_id":"MDQ6VXNlcjI1Nzc0NDA=","avatar_url":"https://avatars3.githubusercontent.com/u/2577440?v=4","gravatar_id":"","url":"https://api.github.com/users/tqchen","html_url":"https://github.com/tqchen","followers_url":"https://api.github.com/users/tqchen/followers","following_url":"https://api.github.com/users/tqchen/following{/other_user}","gists_url":"https://api.github.com/users/tqchen/gists{/gist_id}","starred_url":"https://api.github.com/users/tqchen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tqchen/subscriptions","organizations_url":"https://api.github.com/users/tqchen/orgs","repos_url":"https://api.github.com/users/tqchen/repos","events_url":"https://api.github.com/users/tqchen/events{/privacy}","received_events_url":"https://api.github.com/users/tqchen/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/apache/incubator-tvm/pulls/4258/commits","review_comments_url":"https://api.github.com/repos/apache/incubator-tvm/pulls/4258/comments","review_comment_url":"https://api.github.com/repos/apache/incubator-tvm/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apache/incubator-tvm/issues/4258/comments","statuses_url":"https://api.github.com/repos/apache/incubator-tvm/statuses/72d3a386b9906be24f3a8a15a4d6473945597ba9","head":{"label":"zhiics:partitioning","ref":"partitioning","sha":"72d3a386b9906be24f3a8a15a4d6473945597ba9","user":{"login":"zhiics","id":5145158,"node_id":"MDQ6VXNlcjUxNDUxNTg=","avatar_url":"https://avatars1.githubusercontent.com/u/5145158?v=4","gravatar_id":"","url":"https://api.github.com/users/zhiics","html_url":"https://github.com/zhiics","followers_url":"https://api.github.com/users/zhiics/followers","following_url":"https://api.github.com/users/zhiics/following{/other_user}","gists_url":"https://api.github.com/users/zhiics/gists{/gist_id}","starred_url":"https://api.github.com/users/zhiics/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zhiics/subscriptions","organizations_url":"https://api.github.com/users/zhiics/orgs","repos_url":"https://api.github.com/users/zhiics/repos","events_url":"https://api.github.com/users/zhiics/events{/privacy}","received_events_url":"https://api.github.com/users/zhiics/received_events","type":"User","site_admin":false},"repo":{"id":143820078,"node_id":"MDEwOlJlcG9zaXRvcnkxNDM4MjAwNzg=","name":"tvm","full_name":"zhiics/tvm","private":false,"owner":{"login":"zhiics","id":5145158,"node_id":"MDQ6VXNlcjUxNDUxNTg=","avatar_url":"https://avatars1.githubusercontent.com/u/5145158?v=4","gravatar_id":"","url":"https://api.github.com/users/zhiics","html_url":"https://github.com/zhiics","followers_url":"https://api.github.com/users/zhiics/followers","following_url":"https://api.github.com/users/zhiics/following{/other_user}","gists_url":"https://api.github.com/users/zhiics/gists{/gist_id}","starred_url":"https://api.github.com/users/zhiics/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zhiics/subscriptions","organizations_url":"https://api.github.com/users/zhiics/orgs","repos_url":"https://api.github.com/users/zhiics/repos","events_url":"https://api.github.com/users/zhiics/events{/privacy}","received_events_url":"https://api.github.com/users/zhiics/received_events","type":"User","site_admin":false},"html_url":"https://github.com/zhiics/tvm","description":"Open deep learning compiler stack for cpu, gpu and specialized accelerators","fork":true,"url":"https://api.github.com/repos/zhiics/tvm","forks_url":"https://api.github.com/repos/zhiics/tvm/forks","keys_url":"https://api.github.com/repos/zhiics/tvm/keys{/key_id}","collaborators_url":"https://api.github.com/repos/zhiics/tvm/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/zhiics/tvm/teams","hooks_url":"https://api.github.com/repos/zhiics/tvm/hooks","issue_events_url":"https://api.github.com/repos/zhiics/tvm/issues/events{/number}","events_url":"https://api.github.com/repos/zhiics/tvm/events","assignees_url":"https://api.github.com/repos/zhiics/tvm/assignees{/user}","branches_url":"https://api.github.com/repos/zhiics/tvm/branches{/branch}","tags_url":"https://api.github.com/repos/zhiics/tvm/tags","blobs_url":"https://api.github.com/repos/zhiics/tvm/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/zhiics/tvm/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/zhiics/tvm/git/refs{/sha}","trees_url":"https://api.github.com/repos/zhiics/tvm/git/trees{/sha}","statuses_url":"https://api.github.com/repos/zhiics/tvm/statuses/{sha}","languages_url":"https://api.github.com/repos/zhiics/tvm/languages","stargazers_url":"https://api.github.com/repos/zhiics/tvm/stargazers","contributors_url":"https://api.github.com/repos/zhiics/tvm/contributors","subscribers_url":"https://api.github.com/repos/zhiics/tvm/subscribers","subscription_url":"https://api.github.com/repos/zhiics/tvm/subscription","commits_url":"https://api.github.com/repos/zhiics/tvm/commits{/sha}","git_commits_url":"https://api.github.com/repos/zhiics/tvm/git/commits{/sha}","comments_url":"https://api.github.com/repos/zhiics/tvm/comments{/number}","issue_comment_url":"https://api.github.com/repos/zhiics/tvm/issues/comments{/number}","contents_url":"https://api.github.com/repos/zhiics/tvm/contents/{+path}","compare_url":"https://api.github.com/repos/zhiics/tvm/compare/{base}...{head}","merges_url":"https://api.github.com/repos/zhiics/tvm/merges","archive_url":"https://api.github.com/repos/zhiics/tvm/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/zhiics/tvm/downloads","issues_url":"https://api.github.com/repos/zhiics/tvm/issues{/number}","pulls_url":"https://api.github.com/repos/zhiics/tvm/pulls{/number}","milestones_url":"https://api.github.com/repos/zhiics/tvm/milestones{/number}","notifications_url":"https://api.github.com/repos/zhiics/tvm/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/zhiics/tvm/labels{/name}","releases_url":"https://api.github.com/repos/zhiics/tvm/releases{/id}","deployments_url":"https://api.github.com/repos/zhiics/tvm/deployments","created_at":"2018-08-07T04:34:08Z","updated_at":"2019-11-04T17:35:26Z","pushed_at":"2019-11-13T22:14:56Z","git_url":"git://github.com/zhiics/tvm.git","ssh_url":"git@github.com:zhiics/tvm.git","clone_url":"https://github.com/zhiics/tvm.git","svn_url":"https://github.com/zhiics/tvm","homepage":"https://tvm.ai","size":18829,"stargazers_count":2,"watchers_count":2,"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":1,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":0,"open_issues":1,"watchers":2,"default_branch":"master"}},"base":{"label":"apache:master","ref":"master","sha":"aae5cde8b90b82beb24c28894a4751f1b77c1801","user":{"login":"apache","id":47359,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ3MzU5","avatar_url":"https://avatars0.githubusercontent.com/u/47359?v=4","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"repo":{"id":70746484,"node_id":"MDEwOlJlcG9zaXRvcnk3MDc0NjQ4NA==","name":"incubator-tvm","full_name":"apache/incubator-tvm","private":false,"owner":{"login":"apache","id":47359,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ3MzU5","avatar_url":"https://avatars0.githubusercontent.com/u/47359?v=4","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/apache/incubator-tvm","description":"Open deep learning compiler stack for cpu, gpu and specialized accelerators","fork":false,"url":"https://api.github.com/repos/apache/incubator-tvm","forks_url":"https://api.github.com/repos/apache/incubator-tvm/forks","keys_url":"https://api.github.com/repos/apache/incubator-tvm/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apache/incubator-tvm/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apache/incubator-tvm/teams","hooks_url":"https://api.github.com/repos/apache/incubator-tvm/hooks","issue_events_url":"https://api.github.com/repos/apache/incubator-tvm/issues/events{/number}","events_url":"https://api.github.com/repos/apache/incubator-tvm/events","assignees_url":"https://api.github.com/repos/apache/incubator-tvm/assignees{/user}","branches_url":"https://api.github.com/repos/apache/incubator-tvm/branches{/branch}","tags_url":"https://api.github.com/repos/apache/incubator-tvm/tags","blobs_url":"https://api.github.com/repos/apache/incubator-tvm/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apache/incubator-tvm/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apache/incubator-tvm/git/refs{/sha}","trees_url":"https://api.github.com/repos/apache/incubator-tvm/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apache/incubator-tvm/statuses/{sha}","languages_url":"https://api.github.com/repos/apache/incubator-tvm/languages","stargazers_url":"https://api.github.com/repos/apache/incubator-tvm/stargazers","contributors_url":"https://api.github.com/repos/apache/incubator-tvm/contributors","subscribers_url":"https://api.github.com/repos/apache/incubator-tvm/subscribers","subscription_url":"https://api.github.com/repos/apache/incubator-tvm/subscription","commits_url":"https://api.github.com/repos/apache/incubator-tvm/commits{/sha}","git_commits_url":"https://api.github.com/repos/apache/incubator-tvm/git/commits{/sha}","comments_url":"https://api.github.com/repos/apache/incubator-tvm/comments{/number}","issue_comment_url":"https://api.github.com/repos/apache/incubator-tvm/issues/comments{/number}","contents_url":"https://api.github.com/repos/apache/incubator-tvm/contents/{+path}","compare_url":"https://api.github.com/repos/apache/incubator-tvm/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apache/incubator-tvm/merges","archive_url":"https://api.github.com/repos/apache/incubator-tvm/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apache/incubator-tvm/downloads","issues_url":"https://api.github.com/repos/apache/incubator-tvm/issues{/number}","pulls_url":"https://api.github.com/repos/apache/incubator-tvm/pulls{/number}","milestones_url":"https://api.github.com/repos/apache/incubator-tvm/milestones{/number}","notifications_url":"https://api.github.com/repos/apache/incubator-tvm/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apache/incubator-tvm/labels{/name}","releases_url":"https://api.github.com/repos/apache/incubator-tvm/releases{/id}","deployments_url":"https://api.github.com/repos/apache/incubator-tvm/deployments","created_at":"2016-10-12T22:20:28Z","updated_at":"2019-11-13T19:18:53Z","pushed_at":"2019-11-13T22:17:51Z","git_url":"git://github.com/apache/incubator-tvm.git","ssh_url":"git@github.com:apache/incubator-tvm.git","clone_url":"https://github.com/apache/incubator-tvm.git","svn_url":"https://github.com/apache/incubator-tvm","homepage":"https://tvm.ai","size":18599,"stargazers_count":4612,"watchers_count":4612,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1205,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":152,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":1205,"open_issues":152,"watchers":4612,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/apache/incubator-tvm/pulls/4258"},"html":{"href":"https://github.com/apache/incubator-tvm/pull/4258"},"issue":{"href":"https://api.github.com/repos/apache/incubator-tvm/issues/4258"},"comments":{"href":"https://api.github.com/repos/apache/incubator-tvm/issues/4258/comments"},"review_comments":{"href":"https://api.github.com/repos/apache/incubator-tvm/pulls/4258/comments"},"review_comment":{"href":"https://api.github.com/repos/apache/incubator-tvm/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apache/incubator-tvm/pulls/4258/commits"},"statuses":{"href":"https://api.github.com/repos/apache/incubator-tvm/statuses/72d3a386b9906be24f3a8a15a4d6473945597ba9"}},"author_association":"CONTRIBUTOR"}}
other: {"actor":{"display_login":"u99127"}}