Skip to content

perf(compute): add ARM64 NEON arithmetic kernels - #1265

Open
fallintoplace wants to merge 1 commit into
apache:mainfrom
fallintoplace:perf/compute-arm64-neon-arithmetic
Open

perf(compute): add ARM64 NEON arithmetic kernels#1265
fallintoplace wants to merge 1 commit into
apache:mainfrom
fallintoplace:perf/compute-arm64-neon-arithmetic

Conversation

@fallintoplace

Copy link
Copy Markdown
Contributor

Summary

  • Added ARM64 NEON kernels for primitive add, subtract, multiply, absolute value, and negate.
  • Covered int32, uint32, int64, uint64, float32, and float64 values.
  • Kept the generic path for unsupported widths and 64-bit integer multiply.
  • Added edge cases for vector tails, wrapping arithmetic, minimum integers, signed zero, and the no-assembly fallback.

Benchmark

Apple M1 Pro, 3 MiB input, no nulls, median of 3 runs from BenchmarkScalarArithmetic:

Case ARM64 NEON -tags noasm Speedup
int64 add, array-array 179,747 ns/op 759,116 ns/op 4.22x
int64 add, array-scalar 160,435 ns/op 697,497 ns/op 4.35x
float64 add, array-array 182,029 ns/op 761,779 ns/op 4.19x
float64 add, array-scalar 174,644 ns/op 714,281 ns/op 4.09x

Tests

  • go test ./arrow/compute/... -count=1
  • go test -tags noasm ./arrow/compute/... -count=1
  • go test -race ./arrow/compute/internal/kernels ./arrow/compute -count=1
  • go vet ./arrow/compute/internal/kernels
  • Linux ARM64 and AMD64 cross-builds for the touched packages

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