From 5ce798d1a765a09e6504b11c36efce372fe8a0d7 Mon Sep 17 00:00:00 2001 From: tannevaled Date: Sat, 14 Nov 2026 22:14:02 +0100 Subject: [PATCH 1/3] landing: single-core NumPy figures replace the multicore claims (go-ndarray/ndarray#118) Co-Authored-By: Claude Opus 5.5 --- layouts/index.html | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/layouts/index.html b/layouts/index.html index d32be7d..91d8653 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -104,11 +104,19 @@

{{ len .Site.Params.families }} families, NumPy's names.

100%
test coverage, differentially checked against numpy
-
2.3–4.5×
NumPy's speed on whole-array Sum/Mean/Max at 4 Mi (NumPy 2.5.3, 16-core Zen 3)
-
3.7–5.9×
single-threaded OpenBLAS 0.3.34 on MatMul from 512² (Zen 3)
+
54 / 256
public operations faster than NumPy 2.5.4 on one Zen 3 core (Sum 0.70×, fft.FFT 0.54× NumPy's time)
+
188 / 256
slower on one core, every one an open defect, tracked by cause in #118
≤ 0.51
ULP for Exp/Log, ports of Arm's optimized-routines
-

Measured, wins and losses. Against NumPy 2.5.3 + OpenBLAS 0.3.34 on a 16-core AMD Zen 3: faster on whole-array Sum/Mean/Max at 4 Mi (2.3–4.5×), SumAxis(1) (2.2×), MaxAxis(1) (1.7×), Exp from 256 Ki elements (2.4–5.6×) and MatMul against single-threaded OpenBLAS (3.7–5.9× from 512²); slower against 16-thread OpenBLAS (MatMul 0.42× at 512² and 0.51× at 1024², though 1.44× faster at 256²; Dot 0.69× and mat·vec 0.52×, all measured in one run with NumPy) and on allocating elementwise forms outside a Workspace. On Apple silicon the packed GEMM reaches tuned-BLAS parity at 1024² and beats the pure-Go gonum 4–10×. On the other targets, against its own scalar code on one core: on a RISC-V SpacemiT X60 the RVV kernels make Sum up to 5.8× faster and cut MatMul time by 31–45%; on an IBM z17 the s390x kernels take MatMul 1024² from 340 to 70 ms and cut Max by 92–96%.

+

Measured, wins and losses, one core against one core. The whole public API was timed against NumPy 2.5.4 with one-thread OpenBLAS 0.3.34, on the same data and on one AMD Zen 3 core (v0.41.0). Faster on 54 of 256 operations, for example SqrtInto (0.51× NumPy's time), the complex fft.FFT (0.54×), Sum (0.70×) and Exp (0.89×). Slower on 188, chiefly from: +

    +
  • allocating the result (Add 3.1× NumPy's time, where AddInto ties);
  • +
  • elementwise operations without a vector kernel yet (Ceil 20×, Abs 12×);
  • +
  • copies where NumPy returns a view;
  • +
  • linalg at 64² (1.4–4×);
  • +
  • the random draws built on log/exp.
  • +
+The table is in the docs, and every slower row is tracked in #118. On Apple silicon the packed GEMM reaches tuned-BLAS parity at 1024² and beats the pure-Go gonum 4–10×. On the other targets, against its own scalar code on one core: on a RISC-V SpacemiT X60 the RVV kernels make Sum up to 5.8× faster and cut MatMul time by 31–45%; on an IBM z17 the s390x kernels take MatMul 1024² from 340 to 70 ms and cut Max by 92–96%.

@@ -127,7 +135,7 @@

What is here.

The cgo-free ndarray the Go and Ruby ecosystems lacked.

-

No cgo, no BLAS shim. A portable pure-Go core, multicore, with SIMD kernels on amd64, arm64, ppc64le, loong64, riscv64 and s390x and a Workspace arena that takes the garbage collector out of loops. Faster than NumPy on whole-array and row reductions, on large Exp and on MatMul against single-threaded BLAS, slower against 16-thread BLAS — the numbers are on the performance page.

+

No cgo, no BLAS shim. A portable pure-Go core, multicore, with SIMD kernels on amd64, arm64, ppc64le, loong64, riscv64 and s390x and a Workspace arena that takes the garbage collector out of loops. Measured against NumPy one core against one core: faster on Sum, Exp, Sqrt and the complex FFT, slower on 188 of 256 operations, which are being worked through. The numbers are on the performance page.

{{ partial "icons/github.html" . }}Read the source on GitHub →
From c09d510880b9df730c41d198e9fc5fe7575185d5 Mon Sep 17 00:00:00 2001 From: tannevaled Date: Sat, 14 Nov 2026 22:41:24 +0100 Subject: [PATCH 2/3] landing: ndarray v0.41.1 (the release carrying the measured table) Co-Authored-By: Claude Opus 5.5 --- hugo.toml | 2 +- playground/go.mod | 2 +- playground/go.sum | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/hugo.toml b/hugo.toml index 306c938..02b03d5 100644 --- a/hugo.toml +++ b/hugo.toml @@ -36,7 +36,7 @@ disableKinds = ['taxonomy', 'term', 'rss', 'sitemap', '404'] [[params.repos]] name = "ndarray" - kind = "library · v0.41.0" + kind = "library · v0.41.1" href = "https://github.com/go-ndarray/ndarray" blurb = "The library, in 13 dtypes with NumPy 2 promotion. Creation (Zeros/Arange/Linspace/…), strided views, broadcasting elementwise + ufuncs, reductions (Sum in NumPy's pairwise order, within a stated error bound checked against math/big, from go-simd/floats; Max/ArgMax/CumSum/Clip/Where), manipulation (Reshape/Concatenate/Stack), linalg (MatMul/Dot) via a panel-packed cache-blocked GEMM with a go-asmgen SIMD-FMA micro-kernel (NEON 4×8 on arm64, AVX2/FMA 6×8 on amd64, VSX 8×8 on ppc64le, LASX 8×8 on loong64, RVV 6×16, or 8×16 on 256-bit vectors, on riscv64, 4×8 on s390x), and a Workspace arena for loops (Use/Reset/Detach). Packages linalg, fft and random are numpy.linalg, numpy.fft and numpy.random." [[params.repos]] diff --git a/playground/go.mod b/playground/go.mod index 076b92a..96ccd52 100644 --- a/playground/go.mod +++ b/playground/go.mod @@ -3,7 +3,7 @@ module github.com/go-ndarray/go-ndarray.github.io/playground go 1.27.2 require ( - github.com/go-ndarray/ndarray v0.41.0 + github.com/go-ndarray/ndarray v0.41.1 github.com/go-widgets/mvvm v0.15.0 github.com/go-widgets/mvvmtk v0.15.0 github.com/go-widgets/painter v0.17.0 diff --git a/playground/go.sum b/playground/go.sum index 2697ab4..b82929e 100644 --- a/playground/go.sum +++ b/playground/go.sum @@ -11,8 +11,8 @@ github.com/go-icons/iconoir v0.3.0 h1:kHG2sU5IsCvtBS1JICuXgfFo5f8UfwY1m7KYMVy97C github.com/go-icons/iconoir v0.3.0/go.mod h1:lPh5OuzVQ+rR4qDPGgAdSRUhnCbHeCAX70HDdwp8/RI= github.com/go-images/images v0.1.1-0.20261026203936-4ac989d310a1 h1:R7Phx1lhFniaqF+k7yE72HcadFeViKYXXb9w2puZJRI= github.com/go-images/images v0.1.1-0.20261026203936-4ac989d310a1/go.mod h1:TXN7V9gKgEe8L4GVYeTO01sQI6n5JUL5Q1xIl09qOio= -github.com/go-ndarray/ndarray v0.41.0 h1:IN7ghnJCpIn9T/T3iXzOmqSzPWNWlTBbpRKvDJWHijI= -github.com/go-ndarray/ndarray v0.41.0/go.mod h1:e/5IBOVrikiwf3Hs8Z6G9EGC7kVwKAj+K569C83HbyU= +github.com/go-ndarray/ndarray v0.41.1 h1:VQp9HKprI8ctB1F4GP4N/PCtc5ZWU/1b/ZkRdktMP2s= +github.com/go-ndarray/ndarray v0.41.1/go.mod h1:e/5IBOVrikiwf3Hs8Z6G9EGC7kVwKAj+K569C83HbyU= github.com/go-opentype/fonts v0.14.0 h1:WHw7k9gkHT1pu9B2yyvd0FWyQqn/4NKFQoKhvMYt3Mo= github.com/go-opentype/fonts v0.14.0/go.mod h1:od2QcmdpKo7QCqo6Jb16y4GULk+h2Hhfq6x3xfvn62Q= github.com/go-opentype/opentype v0.16.2-0.20261027113239-5e69589e9a5e h1:SxBkVzp042LB0X7Ndu0WntqCVaewOm4DwikQYHenP5A= From 691268781960537973ad9eb7afaf3d27af2297a2 Mon Sep 17 00:00:00 2001 From: tannevaled Date: Sat, 14 Nov 2026 22:42:30 +0100 Subject: [PATCH 3/3] landing: review fixes (SqrtInto, div for the list, Workspace card Go against Go) Co-Authored-By: Claude Opus 5.5 --- layouts/index.html | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/layouts/index.html b/layouts/index.html index 91d8653..70c7d54 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -82,7 +82,7 @@

The n-dimensional array, without cgo.

🐹

Pure Go

CGO_ENABLED=0 across the org. No cgo, no BLAS shim.

✅

100% test coverage

Gated in CI, differentially checked against numpy.

🔢

NumPy semantics

Row-major strided arrays, NumPy broadcasting, and NumPy basic-indexing Slice returning strided views that share data.

-
♻️

Workspace arena for loops

Bind the inputs with ws.Use, compute as usual, ws.Reset() at the end of each pass: results stop costing the garbage collector anything. On a Zen 3, x + y on 1 024 elements drops from 2.6 to 0.38 µs (2.1× NumPy).

+
♻️

Workspace arena for loops

Bind the inputs with ws.Use, compute as usual, ws.Reset() at the end of each pass: results stop costing the garbage collector anything. On a Zen 3, x + y on 1 024 elements drops from 2.6 to 0.38 µs, Go against Go.

⚡

SIMD on every 64-bit target

go-asmgen SIMD kernels on amd64 (SSE2, AVX2/FMA picked at run time), arm64 (NEON), ppc64le (VSX), loong64 (LASX, when the CPU has it), riscv64 (RVV, when the CPU has it) and s390x (vector facility, measured on a real IBM z17); the 32-bit targets run the same pure-Go code those kernels are tested against.

🎯

Accurate Exp/Log

Ports of Arm's optimized-routines: worst 0.504 / 0.508 ULP against a 300-bit reference, and correct where Go's amd64 math.Exp returns +Inf (golang/go#81995) and math.Log is wrong on subnormals (golang/go#56600).

🧪

Multi-arch CI

The suite runs on amd64, arm64 and 386 natively and on riscv64/loong64/ppc64le/s390x/arm under qemu, on Linux, macOS and Windows, and compiles for every GOOS/GOARCH pair Go supports; v0.2.0 was also run on real amd64, arm64, ppc64le, riscv64 and loong64 hardware.

@@ -108,7 +108,7 @@

{{ len .Site.Params.families }} families, NumPy's names.

188 / 256
slower on one core, every one an open defect, tracked by cause in #118
≤ 0.51
ULP for Exp/Log, ports of Arm's optimized-routines
-

Measured, wins and losses, one core against one core. The whole public API was timed against NumPy 2.5.4 with one-thread OpenBLAS 0.3.34, on the same data and on one AMD Zen 3 core (v0.41.0). Faster on 54 of 256 operations, for example SqrtInto (0.51× NumPy's time), the complex fft.FFT (0.54×), Sum (0.70×) and Exp (0.89×). Slower on 188, chiefly from: +

Measured, wins and losses, one core against one core. The whole public API was timed against NumPy 2.5.4 with one-thread OpenBLAS 0.3.34, on the same data and on one AMD Zen 3 core (v0.41.0). Faster on 54 of 256 operations, for example SqrtInto (0.51× NumPy's time), the complex fft.FFT (0.54×), Sum (0.70×) and Exp (0.89×). Slower on 188, chiefly from:
  • allocating the result (Add 3.1× NumPy's time, where AddInto ties);
  • elementwise operations without a vector kernel yet (Ceil 20×, Abs 12×);
  • @@ -116,7 +116,7 @@

    {{ len .Site.Params.families }} families, NumPy's names.

  • linalg at 64² (1.4–4×);
  • the random draws built on log/exp.
-The table is in the docs, and every slower row is tracked in #118. On Apple silicon the packed GEMM reaches tuned-BLAS parity at 1024² and beats the pure-Go gonum 4–10×. On the other targets, against its own scalar code on one core: on a RISC-V SpacemiT X60 the RVV kernels make Sum up to 5.8× faster and cut MatMul time by 31–45%; on an IBM z17 the s390x kernels take MatMul 1024² from 340 to 70 ms and cut Max by 92–96%.

+The table is in the docs, and every slower row is tracked in #118. On Apple silicon the packed GEMM reaches tuned-BLAS parity at 1024² and beats the pure-Go gonum 4–10×. On the other targets, against its own scalar code on one core: on a RISC-V SpacemiT X60 the RVV kernels make Sum up to 5.8× faster and cut MatMul time by 31–45%; on an IBM z17 the s390x kernels take MatMul 1024² from 340 to 70 ms and cut Max by 92–96%.
@@ -135,7 +135,7 @@

What is here.

The cgo-free ndarray the Go and Ruby ecosystems lacked.

-

No cgo, no BLAS shim. A portable pure-Go core, multicore, with SIMD kernels on amd64, arm64, ppc64le, loong64, riscv64 and s390x and a Workspace arena that takes the garbage collector out of loops. Measured against NumPy one core against one core: faster on Sum, Exp, Sqrt and the complex FFT, slower on 188 of 256 operations, which are being worked through. The numbers are on the performance page.

+

No cgo, no BLAS shim. A portable pure-Go core, multicore, with SIMD kernels on amd64, arm64, ppc64le, loong64, riscv64 and s390x and a Workspace arena that takes the garbage collector out of loops. Measured against NumPy one core against one core: faster on Sum, Exp, SqrtInto and the complex FFT, slower on 188 of 256 operations, which are being worked through. The numbers are on the performance page.

{{ partial "icons/github.html" . }}Read the source on GitHub →