Skip to content

Require KernelAbstractions 0.10 and clean up the matmul kernel - #827

Merged
maleadt merged 4 commits into
jlka0.10from
noka0.9
Nov 6, 2026
Merged

maleadt merged 4 commits into
jlka0.10from
noka0.9

Conversation

@christiangnrd

@christiangnrd christiangnrd commented Oct 19, 2026 •

Copy link
Copy Markdown
Member

With JLArrays on KernelAbstractions 0.10, GPUArrays no longer needs to support 0.9: all vendor back-ends have moved to 0.10.

That lets the generic matmul kernel lose the workarounds for KA 0.9's CPU back-end, which split kernels at every @synchronize (@uniform, @private, and recomputing the global indices after each barrier). The kernel is now written against KernelInterface directly: it always launches a 2D grid of fixed-size work-groups and indexes by work-group and local id, so @kernel adds nothing.

It also drops the local-memory padding. The padding avoids bank conflicts for row-major access, but here consecutive work-items access consecutive elements of a column-major tile, or all read the same element, which is conflict-free without it. The padding only misaligned the tile's columns, which kept the work-items from reading them with vector loads. On an RTX 5080, 2048×2048 matmul:

before after
Float32 5.1 ms 3.5 ms
ComplexF32 5.2 ms 4.4 ms
Float16 5.1 ms 3.2 ms
Float64 18.1 ms 18.4 ms

@christiangnrd
christiangnrd added this pull request to stack #828 October 19, 2026 21:03
@christiangnrd
christiangnrd removed this pull request from stack #828 October 20, 2026 14:36
@christiangnrd
christiangnrd added this pull request to stack #830 October 20, 2026 14:36
@christiangnrd
christiangnrd force-pushed the noka0.9 branch 6 times, most recently from 67d0704 to 79012cf Compare October 21, 2026 14:27
@maleadt maleadt changed the title Remove KA 0.9 compat and clean up generic_matmatmul implementation Require KernelAbstractions 0.10 and clean up the matmul kernel Nov 5, 2026
All back-ends, JLArrays included, have moved to KernelAbstractions 0.10.
Update the back-end interface docs to define a KernelInterface back-end.
KA 0.9's CPU back-end split kernels at every `@synchronize`, so values
live across a barrier had to be `@uniform`, `@private` or recomputed. KA
0.10 runs kernels on POCL, which needs none of that: compute the global
indices once and accumulate into a plain variable.
The kernel always launches a 2D grid of fixed-size work-groups and
indexes by work-group and local id, which is what KernelInterface
exposes directly; KernelAbstractions' `@kernel` transformations add
nothing here. Performance is unchanged.
The padding avoided bank conflicts for row-major access, but work-items
with consecutive local ids access consecutive elements of a column-major
tile (or all read one element of `tile2`), which is conflict-free
without it. Padding instead misaligned the columns of `tile2`, keeping
each work-item from reading its column with vector loads.

On an RTX 5080, 2048x2048 matmul takes 3.5 instead of 5.1 ms for
Float32, 4.4 instead of 5.2 ms for ComplexF32, and 3.2 instead of 5.1 ms
for Float16. Float64, bound by this GPU's FP64 throughput, stays within
5%.
@maleadt
maleadt merged commit 16b78ef into main Nov 6, 2026
9 checks passed
@maleadt
maleadt deleted the noka0.9 branch November 6, 2026 17:07
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.

2 participants