perf(mapreduce): vectorized SIMD.jl loads for stride-1 by_block redution - #105
Draft
shreyas-omkar wants to merge 1 commit into
Draft
perf(mapreduce): vectorized SIMD.jl loads for stride-1 by_block redution#105shreyas-omkar wants to merge 1 commit into
shreyas-omkar wants to merge 1 commit into
Conversation
…tion Add _mapreduce_nd_by_block_contiguous!, a vectorized variant of the stride-1 by_block reduction: each thread pulls W = 16/sizeof(T) contiguous elements through one 128-bit aligned SIMD.vloada (Vec4 for 4-byte, Vec2 for 8-byte), lowering to ld.global.v4/v2 on CUDA and global_load_dwordx4 on AMDGPU. Host gates on stride-1, 4-/8-byte primitive T, and 16-byte-aligned rows; every other shape/type/layout keeps the scalar by_block path. Correct and faster across CUDA, AMDGPU, POCL and oneAPI (up to +44% vs scalar on RTX 5080). Co-Authored-By: Claude Opus 4.8 <[email protected]>
This file contains hidden or 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
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.
Add _mapreduce_nd_by_block_contiguous!, a vectorized variant of the stride-1 by_block reduction
CUDA: RTX 5080
AMD RDNA4: RX 9060 XT (gfx1200)
POCL: CPU (AMD Ryzen 7 5700)
oneAPI: Intel Iris Xe