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

[Relax][Bugfix] Annotate ComputePrimValue output as host function #17024

Conversation

Lunderberg
Copy link
Contributor

The ComputePrimValue transform is used to compute the value of symbolic expressions that may appear within a Relax function. For example, to compute a boolean condition used for a relax::If node. These functions are used for small host-side computations, prior to launching a device kernel.

This commit updates ComputePrimValue to annotate the generated PrimFunc with tir::attr::kIsHostFunc. This annotation is required for correct behavior in tvm.dlight.ApplyDefaultSchedule, to avoid erroneous scheduling of this function for the GPU, and for tir::transform::BindTarget, to ensure that the function is compiled for execution on the host.

The `ComputePrimValue` transform is used to compute the value of
symbolic expressions that may appear within a Relax function.  For
example, to compute a boolean condition used for a `relax::If` node.
These functions are used for small host-side computations, prior to
launching a device kernel.

This commit updates `ComputePrimValue` to annotate the generated
`PrimFunc` with `tir::attr::kIsHostFunc`.  This annotation is required
for correct behavior in `tvm.dlight.ApplyDefaultSchedule`, to avoid
erroneous scheduling of this function for the GPU, and for
`tir::transform::BindTarget`, to ensure that the function is compiled
for execution on the host.

Co-authored-by: Chris Sullivan <csullivan@octo.ai>
@tqchen
Copy link
Member

tqchen commented May 26, 2024

@tvm-bot rerun

Copy link
Contributor

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

Traceback (most recent call last):
  File "ci/scripts/github/github_tvmbot.py", line 595, in comment_failure
    raise item
  File "ci/scripts/github/github_tvmbot.py", line 701, in run
    pr.rerun_jenkins_ci()
  File "ci/scripts/github/github_tvmbot.py", line 554, in rerun_jenkins_ci
    post(url, auth=("tvm-bot", TVM_BOT_JENKINS_TOKEN))
  File "/home/runner/work/tvm/tvm/ci/scripts/jenkins/git_utils.py", line 53, in post
    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 404: Not Found

with response

<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1"/>
<title>Error 404 Not Found</title>
</head>
<body><h2>HTTP ERROR 404 Not Found</h2>
<table>
<tr><th>URI:</th><td>/job/tvm-arm/job/PR-17024/buildWithParameters</td></tr>
<tr><th>STATUS:</th><td>404</td></tr>
<tr><th>MESSAGE:</th><td>Not Found</td></tr>
<tr><th>SERVLET:</th><td>Stapler</td></tr>
</table>
<hr/><a href="https://eclipse.org/jetty">Powered by Jetty:// 10.0.11</a><hr/>

</body>
</html>

@tqchen
Copy link
Member

tqchen commented May 26, 2024

due to recent ci restart, likely we need to close and re create another pr for the ci to get retriggerd

@Lunderberg
Copy link
Contributor Author

Thank you for looking into the CI failures, and I'll resubmit as a new PR. Looks like #17022 and #17023 have the similar CI failure, as they were all submitted while the CI was down.

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.

None yet

2 participants