ashvardanian / ashvardanian/ParallelReductionsBenchmark

Using Mat-Mul Instructions, like Arm SME and Intel AMX

Open
#2 5 comments 1 reaction 0 assignees View on GitHub
good first issue
Dominant language
C++
Stars
119
Forks
10
PR merge metrics
No merged PRs in 30d

Description

Array reductions can be represented as a two-stage pipeline built on top of matrix-vector multiplications, where the vector is made of all ones.

Let's say our hardware supports fast 16 by 16 matrix multiplications with a single instruction. We can reshape the input array of length $N$ as a matrix of $16$ rows and $N/16$ columns, and use a tiled matrix-multiplication instruction sliding through that wide matrix, multiplying it by a $16$-element vector of ones, and accumulating into $16$ other floats.

In reality, we can't user Intel AMX with `float32` inputs, but we can use Arm SME, and later apply similar techniques to [SimSIMD](https://github.com/ashvardanian/SimSIMD/pull/218).

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.