cutlass icon indicating copy to clipboard operation
cutlass copied to clipboard

[QST] why use AutoVectoringCopy rather LDSM in hopper mixed gemm?

Open danielhua23 opened this issue 1 year ago • 4 comments

What is your question?

Hello folks,

I observe the SmemCopyAtomA in SM90_WS_RS collective builder is set to AutoVectorizingCopy. In 55_hopper_mixed_gemm example, narrower dtype (int8,int4....) will be operand A, my question is why we use AutoVectorizingCopyhere rather LDSM here? https://github.com/NVIDIA/cutlass/blob/main/include/cutlass/gemm/collective/builders/sm90_gmma_builder.inl#L468

Thanks

danielhua23 avatar Apr 13 '25 11:04 danielhua23

I had a view after thinking and going through the code. Is that since LDSM dst partitioner layout is not compatiable with the MMA sources when applying LDSM to int4 dtype? @hwu36 @thakkarV @ccecka, thanks in advance!

danielhua23 avatar Apr 15 '25 04:04 danielhua23

Is that since LDSM dst partitioner layout is not compatiable with the MMA sources when applying LDSM to int4 dtype?

That's basically it. The mixed input mainloop loads 1 MMA worth of A values at a time; in MMA layout at most 2 values for each thread are contiguous in default (simple K-major) smem layout; for any type smaller than 16 bits, the resulting smem load width is less than 32 bits/thread required by LDSM.

Now, in ex55 we actually apply memory reordering which places up to 8 values of 1 MMA in contiguous memory. So LDSM could work, say, for 8 x int4 shuffled values, but the builder was never updated to take advantage of that. It's just a matter of figuring out how to robustly detect when LDSM is applicable.

@IwakuraRein for viz

sklevtsov-nvidia avatar Apr 20 '25 01:04 sklevtsov-nvidia

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 May 20 '25 02:05 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 Aug 18 '25 02:08 github-actions[bot]