-
Notifications
You must be signed in to change notification settings - Fork 29
enable splitk for mixed precision gemm #339
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
base: sycl-develop
Are you sure you want to change the base?
enable splitk for mixed precision gemm #339
Conversation
c8d2bfa
to
f9855bd
Compare
f9855bd
to
24b6043
Compare
INT4 is very important for us and we need the peak performance for it. |
for (int i = 0; i < decltype(size(tCrA_mma))::value; i++) { | ||
tCrA_mma[i] = static_cast<DstType>(tCrA_load[i].get()); | ||
} | ||
convert_int_subbyte_to_half(out, in); |
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.
What's the point of adding in
and out
?
convert_int_subbyte_to_half(out, in); | |
convert_int_subbyte_to_half(tCrA_mma, tCrA_load); |
if constexpr (sizeof_bits_v<SrcType> < 8) { | ||
// TODO (Codeplay): Current NumericArrayConverter doesn't work for int4 on intel Xe, just workaround and |
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.
You didn't address the TODO. You added a different helper function rather than making the existing one work correctly.
static constexpr auto v_cnt = decltype(size(out))::value / scalar / loop_cnt; | ||
static constexpr auto is_src_signed = is_signed<SrcType>::value; | ||
|
||
auto src_ptr = reinterpret_cast<const format_type*>(raw_pointer_cast(&(in.data()[0]))); |
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.
Why the &(...)[0]
?
auto src_ptr = reinterpret_cast<const format_type*>(raw_pointer_cast(&(in.data()[0]))); | |
auto src_ptr = reinterpret_cast<const format_type*>(raw_pointer_cast(in.data())); |
It isn't obvious why this isn't UB and why the reinterpret_cast is needed. Both should be explained in a comment (also next line).
static constexpr auto is_src_signed = is_signed<SrcType>::value; | ||
|
||
auto src_ptr = reinterpret_cast<const format_type*>(raw_pointer_cast(&(in.data()[0]))); | ||
auto&& dst_ptr = *(cute::intel::vector_t<ushort, decltype(size(out))::value>*)(out.data()); |
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.
Why auto&&
? We shouldn't use C-style cast. dst_ptr isn't a pointer, is it?
auto&& dst_ptr = *(cute::intel::vector_t<ushort, decltype(size(out))::value>*)(out.data()); | |
auto& dst = *reinterpret_cast<cute::intel::vector_t<ushort, decltype(size(out))::value>*>(out.data()); |
Why does this not need a raw_pointer_cast?
No description provided.