Skip to content

perf(simd): explore multiple accumulators in SIMD kernels #91

Description

@bennibbelink

Context

The SIMD arithmetic kernels introduced in PR #72 use a single accumulator per loop iteration (one vector register accumulating the result for each step). #72 (review)

Suggested Fix

Restructure the inner loop to use multiple independent accumulator chains. For example:

// Instead of:
for i := 0; i+8 <= n; i += 8 {
    acc = simd.AddFloat32x8(a[i:], b[i:])
    ...
}

// Use:
for i := 0; i+16 <= n; i += 16 {
    acc0 = simd.AddFloat32x8(a[i:],   b[i:])
    acc1 = simd.AddFloat32x8(a[i+8:], b[i+8:])
    ...
}

Metadata

Metadata

Labels

area: cpuCPU backend, element-wise ops, BLASpriority: lowBacklog, nice to havetype: performanceSpeed/memory improvement or regression

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions