You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by "MasterJH5574 (via GitHub)" <gi...@apache.org> on 2023/02/21 18:59:50 UTC

[GitHub] [tvm] MasterJH5574 opened a new pull request, #14068: [Target] Add target tags for Apple Silicon

MasterJH5574 opened a new pull request, #14068:
URL: https://github.com/apache/tvm/pull/14068

   As we are recently conducting experiments on Apple Silicon, we find it helpful to introduce the target tag for Apple Silicons, as specialized Metal targets.
   
   At this moment, we find the size of shared memory per thread block, the maximum number of threads per thread block and the warp size useful, so each specialized chip is configured by these three parameters.
   
   The feature numbers come from Apple's official document: https://developer.apple.com/metal/Metal-Feature-Set-Tables.pdf


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [tvm] MasterJH5574 commented on pull request #14068: [Target] Add target tags for Apple Silicon

Posted by "MasterJH5574 (via GitHub)" <gi...@apache.org>.
MasterJH5574 commented on PR #14068:
URL: https://github.com/apache/tvm/pull/14068#issuecomment-1439055310

   @tvm-bot rerun


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [tvm] MasterJH5574 commented on a diff in pull request #14068: [Target] Add target tags for Apple Silicon GPU

Posted by "MasterJH5574 (via GitHub)" <gi...@apache.org>.
MasterJH5574 commented on code in PR #14068:
URL: https://github.com/apache/tvm/pull/14068#discussion_r1113580742


##########
src/target/tag.cc:
##########
@@ -376,4 +376,19 @@ TVM_REGISTER_TAG_AWS_C5("aws/cpu/c5.24xlarge", 48, "cascadelake");
 
 #undef TVM_REGISTER_TAG_AWS_C5
 
+#define TVM_REGISTER_METAL_TAG(Name, ThreadsPerBlock, SharedMem, WarpSize)       \
+  TVM_REGISTER_TARGET_TAG(Name).set_config(                                      \
+      {{"kind", String("metal")},                                                \
+       {"max_threads_per_block", Integer(ThreadsPerBlock)},                      \
+       {"max_shared_memory_per_block", Integer(SharedMem)},                      \
+       {"thread_warp_size", Integer(WarpSize)},                                  \
+       {"host", Map<String, ObjectRef>{{"kind", String("llvm")},                 \
+                                       {"mtriple", String("arm64-apple-macos")}, \
+                                       {"mcpu", String("apple-latest")}}}});
+
+TVM_REGISTER_METAL_TAG("apple/m1", 1024, 32768, 32);

Review Comment:
   Thanks. I also updated the PR title and description.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [tvm] tqchen commented on pull request #14068: [Target] Add target tags for Apple Silicon GPU

Posted by "tqchen (via GitHub)" <gi...@apache.org>.
tqchen commented on PR #14068:
URL: https://github.com/apache/tvm/pull/14068#issuecomment-1439336623

   Thanks @MasterJH5574 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [tvm] tvm-bot commented on pull request #14068: [Target] Add target tags for Apple Silicon

Posted by "tvm-bot (via GitHub)" <gi...@apache.org>.
tvm-bot commented on PR #14068:
URL: https://github.com/apache/tvm/pull/14068#issuecomment-1438957838

   <!---bot-comment-->
   
   Thanks for contributing to TVM! Please refer to the contributing guidelines https://tvm.apache.org/docs/contribute/ for useful information and tips. Please request code reviews from [Reviewers](https://github.com/apache/incubator-tvm/blob/master/CONTRIBUTORS.md#reviewers) by @-ing them in a comment.
   
   <!--bot-comment-ccs-start-->
    * No users to tag found in teams: `target` <sub>See [#10317](https://github.com/apache/tvm/issues/10317) for details</sub><!--bot-comment-ccs-end-->
   
   <sub>Generated by [tvm-bot](https://github.com/apache/tvm/blob/main/ci/README.md#github-actions)</sub>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [tvm] tqchen commented on a diff in pull request #14068: [Target] Add target tags for Apple Silicon

Posted by "tqchen (via GitHub)" <gi...@apache.org>.
tqchen commented on code in PR #14068:
URL: https://github.com/apache/tvm/pull/14068#discussion_r1113565306


##########
src/target/tag.cc:
##########
@@ -376,4 +376,19 @@ TVM_REGISTER_TAG_AWS_C5("aws/cpu/c5.24xlarge", 48, "cascadelake");
 
 #undef TVM_REGISTER_TAG_AWS_C5
 
+#define TVM_REGISTER_METAL_TAG(Name, ThreadsPerBlock, SharedMem, WarpSize)       \
+  TVM_REGISTER_TARGET_TAG(Name).set_config(                                      \
+      {{"kind", String("metal")},                                                \
+       {"max_threads_per_block", Integer(ThreadsPerBlock)},                      \
+       {"max_shared_memory_per_block", Integer(SharedMem)},                      \
+       {"thread_warp_size", Integer(WarpSize)},                                  \
+       {"host", Map<String, ObjectRef>{{"kind", String("llvm")},                 \
+                                       {"mtriple", String("arm64-apple-macos")}, \
+                                       {"mcpu", String("apple-latest")}}}});
+
+TVM_REGISTER_METAL_TAG("apple/m1", 1024, 32768, 32);

Review Comment:
   apple/m1-gpu (since m1 also comes with cpu)



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [tvm] tqchen merged pull request #14068: [Target] Add target tags for Apple Silicon GPU

Posted by "tqchen (via GitHub)" <gi...@apache.org>.
tqchen merged PR #14068:
URL: https://github.com/apache/tvm/pull/14068


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [tvm] github-actions[bot] commented on pull request #14068: [Target] Add target tags for Apple Silicon

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #14068:
URL: https://github.com/apache/tvm/pull/14068#issuecomment-1439055634

   Failed to re-run CI in https://github.com/apache/tvm/actions/runs/4236625987
   
   <details>
   
   ```
   Traceback (most recent call last):
     File "/home/runner/work/tvm/tvm/ci/scripts/jenkins/git_utils.py", line 121, in _request
       with request.urlopen(req, data) as response:
     File "/usr/lib/python3.8/urllib/request.py", line 222, in urlopen
       return opener.open(url, data, timeout)
     File "/usr/lib/python3.8/urllib/request.py", line 531, in open
       response = meth(req, response)
     File "/usr/lib/python3.8/urllib/request.py", line 640, in http_response
       response = self.parent.error(
     File "/usr/lib/python3.8/urllib/request.py", line 569, in error
       return self._call_chain(*args)
     File "/usr/lib/python3.8/urllib/request.py", line 502, in _call_chain
       result = func(*args)
     File "/usr/lib/python3.8/urllib/request.py", line 649, in http_error_default
       raise HTTPError(req.full_url, code, msg, hdrs, fp)
   urllib.error.HTTPError: HTTP Error 403: Forbidden
   
   During handling of the above exception, another exception occurred:
   
   Traceback (most recent call last):
     File "ci/scripts/github/github_tvmbot.py", line 594, in comment_failure
       raise item
     File "ci/scripts/github/github_tvmbot.py", line 706, in run
       pr.rerun_github_actions()
     File "ci/scripts/github/github_tvmbot.py", line 583, in rerun_github_actions
       raise e
     File "ci/scripts/github/github_tvmbot.py", line 575, in rerun_github_actions
       actions_github.post(f"actions/runs/{workflow_id}/rerun-failed-jobs", data={})
     File "/home/runner/work/tvm/tvm/ci/scripts/jenkins/git_utils.py", line 143, in post
       return self._request(self.base + url, data, method="POST")
     File "/home/runner/work/tvm/tvm/ci/scripts/jenkins/git_utils.py", line 126, in _request
       raise RuntimeError(f"Error response: {msg}\n{error_data}")
   RuntimeError: Error response: HTTP Error 403: Forbidden
   {"message":"This workflow is already running","documentation_url":"https://docs.github.com/rest/reference/actions#re-run-workflow-failed-jobs"}
   
   ```
   
   </details>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org