Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Target] Add target tags for Apple Silicon GPU #14068

Merged

Conversation

MasterJH5574
Copy link
Contributor

@MasterJH5574 MasterJH5574 commented Feb 21, 2023

As we are recently conducting experiments on GPU of Apple Silicon, we find it helpful to introduce the target tag for Apple Silicon GPUs, 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

@tvm-bot
Copy link
Collaborator

tvm-bot commented Feb 21, 2023

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 by @-ing them in a comment.

  • No users to tag found in teams: target See #10317 for details

Generated by tvm-bot

@MasterJH5574
Copy link
Contributor Author

@tvm-bot rerun

@github-actions
Copy link
Contributor

Failed to re-run CI in https://github.com/apache/tvm/actions/runs/4236625987

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"}

{"mtriple", String("arm64-apple-macos")}, \
{"mcpu", String("apple-latest")}}}});

TVM_REGISTER_METAL_TAG("apple/m1", 1024, 32768, 32);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. I also updated the PR title and description.

@MasterJH5574 MasterJH5574 force-pushed the tvm-dev/2023-02-21-apple-silicon-target branch from f2e2e4d to 9d4aa13 Compare February 21, 2023 21:19
@MasterJH5574 MasterJH5574 changed the title [Target] Add target tags for Apple Silicon [Target] Add target tags for Apple Silicon GPU Feb 21, 2023
As we are recently conducting experiments on GPU of Apple Silicon, we
find it helpful to introduce the target tag for Apple Silicon GPUs, 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
@MasterJH5574 MasterJH5574 force-pushed the tvm-dev/2023-02-21-apple-silicon-target branch from 9d4aa13 to 40bae75 Compare February 21, 2023 21:26
@tqchen tqchen merged commit b59da59 into apache:main Feb 22, 2023
@tqchen
Copy link
Member

tqchen commented Feb 22, 2023

Thanks @MasterJH5574

yongwww pushed a commit to yongwww/tvm that referenced this pull request Feb 27, 2023
As we are recently conducting experiments on GPU of Apple Silicon, we
find it helpful to introduce the target tag for Apple Silicon GPUs, 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants