cutlass icon indicating copy to clipboard operation
cutlass copied to clipboard

[BUG] Incorrect calculation results of CuteDsl/ampere/tensorop_gemm.py

Open lucifer1004 opened this issue 7 months ago • 3 comments

Describe the bug python3 tensorop_gemm.py --mnkl 8,16384,16384,1 failed to pass ref check on RTX 5000 Ada (sm_89).

AssertionError: Tensor-likes are not close!

Mismatched elements: 90391 / 131072 (69.0%)
Greatest absolute difference: 18.0 at index (6, 2160, 0) (up to 0.001 allowed)
Greatest relative difference: 0.00452423095703125 at index (6, 2160, 0) (up to 1e-05 allowed)

This issue does not occur when using smaller n,k values.

Steps/Code to reproduce bug Just run the program with the given options.

Expected behavior The program should pass ref check.

lucifer1004 avatar May 27 '25 08:05 lucifer1004

@keithzzzzz

hwu36 avatar May 28 '25 02:05 hwu36

It seems that when k is large enough, the recast result from fp32 to fp16 start to differ from the reference program.

lucifer1004 avatar May 28 '25 02:05 lucifer1004

@lucifer1004 I can't reproduce your problem, what's your GPU

Jie-Fang avatar May 28 '25 06:05 Jie-Fang

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 Jun 28 '25 08:06 github-actions[bot]

Hi @lucifer1004 , we found that the torch.enisum has precision issue for ada arch. If you use cpu tensors to call torch.enisum, or use fp32 datatype, the program could pass ref check.

We will change the input reference tensors to datatype fp32 later.

keithzzzzz avatar Jun 30 '25 10:06 keithzzzzz

FYI - This is fixed in 4.1. Please let us know if you see other issues.

brandon-yujie-sun avatar Jul 22 '25 07:07 brandon-yujie-sun