Skip to content

Add compile-time tiling primitive and use it in the 1D reduce - #107

Draft
shreyas-omkar wants to merge 1 commit into
JuliaGPU:mainfrom
shreyas-omkar:sh/backend-specialize
Draft

Add compile-time tiling primitive and use it in the 1D reduce#107
shreyas-omkar wants to merge 1 commit into
JuliaGPU:mainfrom
shreyas-omkar:sh/backend-specialize

Conversation

@shreyas-omkar

Copy link
Copy Markdown
Member

Port GemmKernels.jl's Tile (shape in the size type parameter, position in the dynamic base/offset fields) as an internal Tiling module, keeping the same translate_base / translate_offset / tile.index calling convention.

Use it in _mapreduce_block! to load items_per_thread elements per thread in a block-strided pass. The default of 2 reproduces the previous two-element load byte-for-byte (op(neutral, x) == x); a new items_per_thread keyword and a _default_items_per_thread(backend) trait let backends/users opt into more.

Correct on POCL and CUDA across ops/sizes; ~1.6x faster at K=4 on an RTX 3060 (64M Int32 sum: 1.36 -> 0.85 ms), unchanged at the default.

@shreyas-omkar
shreyas-omkar force-pushed the sh/backend-specialize branch from 02730e1 to ec42890 Compare August 6, 2026 05:18
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.

1 participant