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

[METAL] Fix int8 vectorized cast #14962

Merged
merged 1 commit into from
May 26, 2023

Conversation

Hzfengsy
Copy link
Member

@Hzfengsy Hzfengsy commented May 26, 2023

Current codegen output (half4)*(device uint*)A tries to create a int32 number and then cast it to half4, which is not the expected behavior.

As Metal natively supports uchar4 and char4 types (ref), we can direct use them to solve that problem.

cc @tqchen

Current codegen output `(half4)*(device uint*)A` tries to create a `int32`
number and then cast it to `half4`, which is not the expected behavior.

As Metal supports `uchar4` and `char4` types, we can direct use them to
solve that problem.
@tvm-bot
Copy link
Collaborator

tvm-bot commented May 26, 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.

Generated by tvm-bot

@github-actions github-actions bot requested a review from tqchen May 26, 2023 04:38
Copy link
Contributor

@echuraev echuraev left a comment

Choose a reason for hiding this comment

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

LGTM!

@echuraev echuraev merged commit 6198c7f into apache:main May 26, 2023
tqchen pushed a commit to tqchen/tvm that referenced this pull request May 29, 2023
)

Current codegen output `(half4)*(device uint*)A` tries to create a
`int32` number and then cast it to `half4`, which is not the expected
behavior.

As Metal supports `uchar4` and `char4` types, we can direct use them to
solve that problem.

(cherry picked from commit 6198c7f)
mei-ye pushed a commit to mei-ye/tvm that referenced this pull request Jun 1, 2023
Current codegen output `(half4)*(device uint*)A` tries to create a `int32`
number and then cast it to `half4`, which is not the expected behavior.

As Metal supports `uchar4` and `char4` types, we can direct use them to
solve that problem.
@Hzfengsy Hzfengsy deleted the fix_metal_vectorized_cast branch July 12, 2023 11:55
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