cutlass icon indicating copy to clipboard operation
cutlass copied to clipboard

[EVT] Fix Row/Col broadcast with array arguments

Open jwfromm opened this issue 1 year ago • 5 comments

#2033 added the ability for row/col broadcast nodes to accept ptr array arguments, however, during some followup refactoring it was broken. Specifically, there is an invalid type comparison that was added. This small PR fixes the issue by using a constexpr if to avoid the comparison if ptrarray is being used.

jwfromm avatar Feb 20 '25 00:02 jwfromm

@ANIKET-SHIVAM can you take a look at this small change?

jwfromm avatar Feb 20 '25 00:02 jwfromm

@jwfromm Is the invalid type comparison happening bcoz this line right now is not behind constexpr: is_zero_ = params.ptr_row[0] == ElementInput(0); For Grouped Gemm case, there is a type mismatch, where ptr_row[0] is of ElementInput* type instead and hence the invalid type conversion issue. Is that correct? Could you try moving constexpr check inside instead like this and see if that works fine for you:

    else if (IsDynamicBroadcast && stride_N == bool(0) && stride_L == repeat_like(stride_L, 0)) {
      if constexpr (not IsArrayOfPointers) {
        is_zero_ = params.ptr_row[0] == ElementInput(0);
      }

ANIKET-SHIVAM avatar Feb 20 '25 16:02 ANIKET-SHIVAM

@ANIKET-SHIVAM Yeah that would also work, as long as we dont compare ptr_row[0] to ElementInput(0) as they are different types it will be fine. If you prefer having the constexpr check inside the else if we can do that instead.

jwfromm avatar Feb 20 '25 17:02 jwfromm

yes, please. thanks.

ANIKET-SHIVAM avatar Feb 20 '25 17:02 ANIKET-SHIVAM

@ANIKET-SHIVAM Done, I also confirmed this still works as expected.

jwfromm avatar Feb 20 '25 18:02 jwfromm