Skip to content

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

Open
wants to merge 5 commits into
base: sycl-develop
Choose a base branch
from

Conversation

taozha2
Copy link
Collaborator

@taozha2 taozha2 commented Apr 29, 2025

No description provided.

@taozha2 taozha2 force-pushed the zt/splitK_MixedPrecision branch from f9855bd to 24b6043 Compare April 29, 2025 13:15
@pengzhao-intel
Copy link

INT4 is very important for us and we need the peak performance for it.
Thanks for the efforts.

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);
Copy link
Collaborator

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?

Suggested change
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
Copy link
Collaborator

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])));
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why the &(...)[0]?

Suggested change
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());
Copy link
Collaborator

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?

Suggested change
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?

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.

3 participants