cutlass icon indicating copy to clipboard operation
cutlass copied to clipboard

[BUG] FP8 warp specialized gemm failed when m is small

Open donglinz opened this issue 2 years ago • 3 comments

Describe the bug

./54_hopper_fp8_warp_specialized_gemm cannot run with small m (e.g. 1/2/5).

Steps/Code to reproduce bug

1. build 54_hopper_fp8_warp_specialized_gemm 
2. run with ./54_hopper_fp8_warp_specialized_gemm --m=2 --n=2048 --k=2048

Output:

Got cutlass error: Invalid status at:489

Environment details (please complete the following information):

docker: nvcr.io/nvidia/cuda:12.1.0-devel-ubuntu22.04 gpu: h100 commit: 033d9efd2db0bbbcf3b3b0650acde6c472f3948e

donglinz avatar May 04 '24 08:05 donglinz

Did some trials and looks like its related to TmaWarpSpecialized epilogue schedule. In comparison, NoSmemWarpSpecialized schedule works for small m.

donglinz avatar May 04 '24 14:05 donglinz

TMA epilogue mandates 16B alignment for the leading dimension of C/D tensors. Combined with an 8-bit data type and column-major layout, this translates into the requirement that m is a multiple of 16. If you re-build the code with -DCUTLASS_DEBUG_TRACE_LEVEL=1, you can see this in the output for small m:

sm90_epilogue_tma_warpspecialized.hpp:325    CAN IMPLEMENT: Problem Size doesn't meet the minimum alignment requirements for TMA.

sklevtsov-nvidia avatar May 08 '24 03:05 sklevtsov-nvidia

Thank you so much for the explanation.

donglinz avatar May 09 '24 09:05 donglinz