Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[EVT] Fix Row/Col broadcast with array arguments #2120

Merged
merged 2 commits into from
Feb 21, 2025

Conversation

jwfromm
Copy link
Contributor

@jwfromm jwfromm commented Feb 20, 2025

#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
Copy link
Contributor Author

jwfromm commented Feb 20, 2025

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

@ANIKET-SHIVAM ANIKET-SHIVAM self-requested a review February 20, 2025 01:38
@ANIKET-SHIVAM
Copy link
Collaborator

@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);
      }

@jwfromm
Copy link
Contributor Author

jwfromm commented Feb 20, 2025

@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.

@ANIKET-SHIVAM
Copy link
Collaborator

yes, please. thanks.

@jwfromm
Copy link
Contributor Author

jwfromm commented Feb 20, 2025

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

Copy link
Collaborator

@ANIKET-SHIVAM ANIKET-SHIVAM left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hwu36 this is ready to be merged.

@hwu36 hwu36 merged commit eefa171 into NVIDIA:main Feb 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants