You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by "yanghaku (via GitHub)" <gi...@apache.org> on 2023/05/14 08:24:45 UTC
[GitHub] [tvm] yanghaku opened a new pull request, #14850: [BugFix][Target][Web] Fix the wrong dtype for the shift expression
yanghaku opened a new pull request, #14850:
URL: https://github.com/apache/tvm/pull/14850
This PR fixes the wrong data type for the shift expression in WGSL.
In [WGSL standard](https://www.w3.org/TR/WGSL/#bit-expr), The number of bits to shift must be u32, but the generated code may has i32 type, such as the following:
```wgsl
pad_temp_shared[((i32(threadIdx.z) * 7) + i32(threadIdx.x))] = p0[(((((rc_outer * 784) + ((i32(threadIdx.z) >> 2i) * 196)) + (i32(blockIdx.y) * 28)) + ((i32(threadIdx.z) & 3) * 7)) + i32(threadIdx.x))];
```
And the error message in tint:
```console
error: no matching overload for operator >> (i32, i32)
```
This PR adds a convert, if the number of bits to shift is i32, it will be converted to u32. E.g. `2i` -> `u32(2i)`.
--
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 #14850: [BugFix][Target][Web] Fix the wrong dtype for the shift expression
Posted by "tqchen (via GitHub)" <gi...@apache.org>.
tqchen commented on PR #14850:
URL: https://github.com/apache/tvm/pull/14850#issuecomment-1546904153
Thanks @yanghaku . There is already a patch in unity branch https://github.com/apache/tvm/blob/unity/src/target/source/codegen_webgpu.cc#L365 you are more than welcome to try it out.
--
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 #14850: [BugFix][Target][Web] Fix the wrong dtype for the shift expression
Posted by "tvm-bot (via GitHub)" <gi...@apache.org>.
tvm-bot commented on PR #14850:
URL: https://github.com/apache/tvm/pull/14850#issuecomment-1546840037
<!---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: `bugfix`, `target`, `web` <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] yanghaku closed pull request #14850: [BugFix][Target][Web] Fix the wrong dtype for the shift expression
Posted by "yanghaku (via GitHub)" <gi...@apache.org>.
yanghaku closed pull request #14850: [BugFix][Target][Web] Fix the wrong dtype for the shift expression
URL: https://github.com/apache/tvm/pull/14850
--
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] yanghaku commented on pull request #14850: [BugFix][Target][Web] Fix the wrong dtype for the shift expression
Posted by "yanghaku (via GitHub)" <gi...@apache.org>.
yanghaku commented on PR #14850:
URL: https://github.com/apache/tvm/pull/14850#issuecomment-1547495350
@tqchen Thanks, I'll try the unity branch and close this PR.
--
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