Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
bit_cast operator #3655
base: develop
Are you sure you want to change the base?
bit_cast operator #3655
Changes from 7 commits
70336db
b41c8b6
bdebeb5
a1fb21e
b8e2041
8366434
a15e5a4
be5d9a0
3e08ab2
7b40796
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function should return
auto
.To
is not valid return with vector types. If you dobit_cast<int8_t>(vec<uint8_t, 2>{})
it should returnvec<int8_t, 2>{}
notint8_t
. Thevec_transform
functor already takes care of figuring out the return type for you, so you can just returnauto
instead.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same issue. When compiling float8 for GPU this version is used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same issue? The return type is wrong for this. If you bit_cast a vector type you should get a vector type, not the scalar type.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The issue comes from the usage here:
AMDMIGraphX/src/targets/gpu/kernels/include/migraphx/kernels/float8_impl.hpp
Line 268 in cd37826
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That takes a scalar input not a vector input.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no need for this overload, since the
vec_transform
works with non vectors as well.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It doesn't work properly with the usage of bit_cast in
float8_impl
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We shouldn't be vectorizing fp8 types.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also,
vec_transform
already does the same check foris_any_vec
and it just calls the function directly, so I dont see how that would cause an error with fp8 types.