Skip to content

Pure FP8 (W8A8) GEMM support (draft) #306

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 2 commits into
base: sycl-develop
Choose a base branch
from

Conversation

jiyang1011
Copy link
Collaborator

  1. a new method to remove data shuffle
  2. the main performance gap results from data conversion

currently hard code to store the result collective/xe_epilogue.hpp
and example pvc_gemm_fp8.cpp

@tdeng5 tdeng5 changed the title a method to avoid data shuffle(draft) Pure FP8 (W8A8) GEMM support (draft) Apr 14, 2025
@tdeng5
Copy link
Collaborator

tdeng5 commented Apr 14, 2025

This requirements from framework team, provide a prototype for framework team, they expect to evaluate scaled W8A8 bases on this interface.

Comment on lines 380 to 389
// 32 x 64
if constexpr(!is_same_v<CopyOpR2G_, XE_2D_U32x8x16_ST_N>) {
auto D = make_tensor(make_gmem_ptr(params.ptr_D), make_layout(make_shape(4096, 4096), make_stride(4096, 1)));
for(int i = 0; i < size<1>(accumulators); i++) {
for(int j = 0; j < size<2>(accumulators); j++) {
for(int v = 0; v < size<0>(accumulators); v++) {
D(v + i * 8 + m_sg * 32 + BlockIdxY() * 256 , BlockIdxX() * 256 + n_sg * 64 + (thread_idx % 16) * 2 + (j % 2) + (j / 2) * 32) = accumulators(v, i, j);
}
}
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

This looks really ugly here. Is there any good reason not to implement it as a new copy atom?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think you are right. UniveralCopy will be OK for this copy atom. But I did not figure it out yet

@jiyang1011
Copy link
Collaborator Author

This is a draft version. I will polish the code ASAP

@jiyang1011 jiyang1011 force-pushed the jiyang/fp8 branch 2 times, most recently from 7ab624a to eb3529e Compare April 15, 2025 07:47
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