-
Notifications
You must be signed in to change notification settings - Fork 69
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
Cherry-pick: Optimize block_reduce_warp_reduce when block size is the same as warp size #599
Merged
stanleytsang-amd
merged 2 commits into
ROCm:release/rocm-rel-6.2
from
stanleytsang-amd:block_reduce_warp_reduce_opt
Aug 27, 2024
Merged
Cherry-pick: Optimize block_reduce_warp_reduce when block size is the same as warp size #599
stanleytsang-amd
merged 2 commits into
ROCm:release/rocm-rel-6.2
from
stanleytsang-amd:block_reduce_warp_reduce_opt
Aug 27, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
stanleytsang-amd
requested review from
a team,
umfranzw,
RobsonRLemos and
lawruble13
as code owners
August 22, 2024 19:23
stanleytsang-amd
changed the title
Cherry-pick: Optimize block_reduce_warp_reduce when block size is the same warp size
Cherry-pick: Optimize block_reduce_warp_reduce when block size is the same as warp size
Aug 22, 2024
Naraenda
reviewed
Aug 23, 2024
rocprim/include/rocprim/block/detail/block_reduce_warp_reduce.hpp
Outdated
Show resolved
Hide resolved
Naraenda
approved these changes
Aug 26, 2024
umfranzw
approved these changes
Aug 26, 2024
stanleytsang-amd
added a commit
that referenced
this pull request
Sep 17, 2024
* Update dependency names for static builds (#557) This also removes the line setting `BUILD_SHARED_LIBS` to `ON`, which was previously required to get the correctly named packages when not specifically compiling for a static build. Updates to the ROCmCMakeBuildTools (rocm-cmake) should mean this is no longer necessary. * Fix BUILD_SHARED_LIBS for packaging (#558) * Fix the dependencies of the static packages (#563) * cmake: don't set CMAKE_C_COMPILER, as rocPRIM is a CXX project (#567) * add developer guidelines (#555) (#574) Co-authored-by: Nol Moonen <nol@streamhpc.com> * Update Read the Docs config to Python 3.10 and latest rocm-docs-core (#564) (#579) * Cherry-pick: Optimize block_reduce_warp_reduce when block size is the same as warp size (#599) * Optimize block_reduce_warp_reduce when block size == warp size * Make conditional constexpr * Fix conflict in concepts.rst --------- Co-authored-by: Lauren Wrubleski <Lauren.Wrubleski@amd.com> Co-authored-by: Steve Leung <Steve.Leung@amd.com> Co-authored-by: randyh62 <42045079+randyh62@users.noreply.github.com> Co-authored-by: Nol Moonen <nol@streamhpc.com> Co-authored-by: Sam Wu <22262939+samjwu@users.noreply.github.com>
stanleytsang-amd
added a commit
to stanleytsang-amd/rocPRIM
that referenced
this pull request
Oct 10, 2024
* Update dependency names for static builds (ROCm#557) This also removes the line setting `BUILD_SHARED_LIBS` to `ON`, which was previously required to get the correctly named packages when not specifically compiling for a static build. Updates to the ROCmCMakeBuildTools (rocm-cmake) should mean this is no longer necessary. * Fix BUILD_SHARED_LIBS for packaging (ROCm#558) * Fix the dependencies of the static packages (ROCm#563) * cmake: don't set CMAKE_C_COMPILER, as rocPRIM is a CXX project (ROCm#567) * add developer guidelines (ROCm#555) (ROCm#574) Co-authored-by: Nol Moonen <nol@streamhpc.com> * Update Read the Docs config to Python 3.10 and latest rocm-docs-core (ROCm#564) (ROCm#579) * Cherry-pick: Optimize block_reduce_warp_reduce when block size is the same as warp size (ROCm#599) * Optimize block_reduce_warp_reduce when block size == warp size * Make conditional constexpr * Fix conflict in concepts.rst --------- Co-authored-by: Lauren Wrubleski <Lauren.Wrubleski@amd.com> Co-authored-by: Steve Leung <Steve.Leung@amd.com> Co-authored-by: randyh62 <42045079+randyh62@users.noreply.github.com> Co-authored-by: Nol Moonen <nol@streamhpc.com> Co-authored-by: Sam Wu <22262939+samjwu@users.noreply.github.com>
stanleytsang-amd
added a commit
that referenced
this pull request
Oct 11, 2024
* Update dependency names for static builds (#557) This also removes the line setting `BUILD_SHARED_LIBS` to `ON`, which was previously required to get the correctly named packages when not specifically compiling for a static build. Updates to the ROCmCMakeBuildTools (rocm-cmake) should mean this is no longer necessary. * Fix BUILD_SHARED_LIBS for packaging (#558) * Fix the dependencies of the static packages (#563) * cmake: don't set CMAKE_C_COMPILER, as rocPRIM is a CXX project (#567) * add developer guidelines (#555) (#574) * Update Read the Docs config to Python 3.10 and latest rocm-docs-core (#564) (#579) * Cherry-pick: Optimize block_reduce_warp_reduce when block size is the same as warp size (#599) * Optimize block_reduce_warp_reduce when block size == warp size * Make conditional constexpr * Fix conflict in concepts.rst --------- Co-authored-by: Lauren Wrubleski <Lauren.Wrubleski@amd.com> Co-authored-by: Steve Leung <Steve.Leung@amd.com> Co-authored-by: randyh62 <42045079+randyh62@users.noreply.github.com> Co-authored-by: Nol Moonen <nol@streamhpc.com> Co-authored-by: Sam Wu <22262939+samjwu@users.noreply.github.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
For a block reduce that utilizes warp reductions for the first stage, generally a final reduction is required across all warps to get the final reduction result for the entire block. In the corner case where there is only one warp per block however, that final reduction isn't required as all threads have the final result already from the warp reduction (the final operation of the warp reduction is each lane in the warp reads the result from the last lane of the logical warp, which has the reduction result.)
A customer benchmark has revealed that not doing the final reduction for this very specific case can increase kernel performance by up to 15-30%.
One could argue that the user should just call warp_reduce instead when block size == warp size. However there may be limitations which prevent that from happening.