cutlass icon indicating copy to clipboard operation
cutlass copied to clipboard

[QST]FP6 Tensor Layout Requirment

Open lixlbuaa opened this issue 1 year ago • 5 comments

What is your question? Hi, I would like to ask about input layout requirements for mx fp6 gemm. I am storing 4 fp6 data in 3 uint8 format, e.g. a fp6 tensor with shape [m,n] exists in a [m,3*n//4] uint8 tensor. But the result calculated using cutlass's api is incorrect, it should be the way of storing the fp6 data above is incorrect. Can you tell me the requirement of input for fp6 gemm, or provide some reference documents, thanks!

lixlbuaa avatar Jun 08 '25 10:06 lixlbuaa

https://research.colfax-intl.com/cutlass-tutorial-sub-byte-gemm-on-nvidia-blackwell-gpus/

thakkarV avatar Jun 08 '25 17:06 thakkarV

https://research.colfax-intl.com/cutlass-tutorial-sub-byte-gemm-on-nvidia-blackwell-gpus/

Thank you for your reply. I have carefully read the reference documentation you provided and conducted some experiments. I discovered something interesting: when packing 4 consecutive fp6 e3m2 values (a, b, c, d) into three uint8 values, they are not stored in sequential order. Instead, the packing is as follows:

packed0: [b1 b0][a5 a4 a3 a2 a1 a0] packed1: [c3 c2 c1 c0][b5 b4 b3 b2] packed2: [d5 d4 d3 d2 d1 d0][c5 c4]

I couldn't find any description of this in the documentation. I want to know why it was designed this way. Is there any relevant documentation that describes this packing method? Thanks!

lixlbuaa avatar Jun 11 '25 10:06 lixlbuaa

I have also met this problem when using mxfp6 gemm here.

btw I also wonder why we use this specific packing method.

actypedef avatar Jun 12 '25 12:06 actypedef

This issue has been labeled inactive-30d due to no recent activity in the past 30 days. Please close this issue if no further response or action is needed. Otherwise, please respond with a comment indicating any updates or changes to the original issue and/or confirm this issue still needs to be addressed. This issue will be labeled inactive-90d if there is no activity in the next 60 days.

github-actions[bot] avatar Jul 12 '25 13:07 github-actions[bot]

This issue has been labeled inactive-90d due to no recent activity in the past 90 days. Please close this issue if no further response or action is needed. Otherwise, please respond with a comment indicating any updates or changes to the original issue and/or confirm this issue still needs to be addressed.

github-actions[bot] avatar Oct 10 '25 14:10 github-actions[bot]