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

Improve coalesced reduction performance for tall and thin matrices (up to 2.6x faster) #2259

Merged
merged 8 commits into from
Apr 22, 2024

Conversation

Nyrio
Copy link
Contributor

@Nyrio Nyrio commented Apr 9, 2024

This PR implements two optimizations to coalescedReductionThinKernel which is used for coalesced reductions of tall matrices (many rows) and/or thin (few columns):

  1. Process multiple rows per warp to increase bytes in flight and amortize load latencies.
  2. Use a vectorized reduction to avoid the LSU bottleneck and have fewer global stores (and at least partially coalesced).

The benchmark below shows the achieved SOL percentage on A30. I also measured that on H200, it achieved 84% SOL for 32 columns and up to 94% for 512 columns.

2024-04-09_coalesced_reduction_vec

@Nyrio Nyrio added 3 - Ready for Review improvement Improvement / enhancement to an existing function non-breaking Non-breaking change cpp labels Apr 9, 2024
@Nyrio Nyrio requested a review from a team as a code owner April 9, 2024 19:19
Copy link

copy-pr-bot bot commented Apr 9, 2024

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@Nyrio
Copy link
Contributor Author

Nyrio commented Apr 9, 2024

/ok to test

@Nyrio
Copy link
Contributor Author

Nyrio commented Apr 9, 2024

/ok to test

@Nyrio
Copy link
Contributor Author

Nyrio commented Apr 10, 2024

/ok to test

Copy link
Contributor

@tfeher tfeher left a comment

Choose a reason for hiding this comment

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

Thanks Louis for this updte! Overeall it looks good, I just have two questions.

Copy link
Contributor

@tfeher tfeher left a comment

Choose a reason for hiding this comment

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

Thanks Louis for the explanation! The PR looks good to me.

@tfeher
Copy link
Contributor

tfeher commented Apr 17, 2024

/ok to test

@tfeher
Copy link
Contributor

tfeher commented Apr 22, 2024

/ok to test

@cjnolet
Copy link
Member

cjnolet commented Apr 22, 2024

/merge

@rapids-bot rapids-bot bot merged commit 317a61c into rapidsai:branch-24.06 Apr 22, 2024
69 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3 - Ready for Review cpp improvement Improvement / enhancement to an existing function non-breaking Non-breaking change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants