From 4c2bc9f8ff5276d71dfed4ae79e8eb0863a1dd40 Mon Sep 17 00:00:00 2001 From: tannevaled Date: Sat, 14 Nov 2026 22:37:05 +0100 Subject: [PATCH] docs: ndarray v0.41.1 Re-sync the mirrors at v0.41.1 (measured perf table: 188 of 256 rows slower, 54 faster; roadmap performance item open), and state the one-core verdict on the home page. Co-Authored-By: Claude Sonnet 5.5 --- README.md | 2 +- content/en/_index.md | 6 ++++-- content/en/accuracy.md | 2 +- content/en/dtypes.md | 2 +- content/en/linalg.md | 4 ++-- content/en/performance.md | 40 ++++++++++++++++++++++++--------------- content/en/random.md | 8 ++++---- content/en/roadmap.md | 11 +++++++---- content/en/security.md | 2 +- hugo.yaml | 2 +- 10 files changed, 47 insertions(+), 32 deletions(-) diff --git a/README.md b/README.md index e1b8e1c..5517dd5 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ describes**: | Source | Published under | | --- | --- | -| branch `main`, with `params.ndarray.version: v0.41.0` in `hugo.yaml` | `https://go-ndarray.github.io/docs//`, here `/docs/0.41/` | +| branch `main`, with `params.ndarray.version: v0.41.1` in `hugo.yaml` | `https://go-ndarray.github.io/docs//`, here `/docs/0.41/` | | the newest version | also `https://go-ndarray.github.io/docs/latest/` | `https://go-ndarray.github.io/docs/` redirects to `latest/`. Each push to diff --git a/content/en/_index.md b/content/en/_index.md index 6b31d6e..420933c 100644 --- a/content/en/_index.md +++ b/content/en/_index.md @@ -93,7 +93,7 @@ On an AMD Zen 3 (16 cores), `x + y` on 1 024 elements goes from 2.6 µs to ## Performance & architectures Large elementwise ops, reductions and products run **multicore** (across -`GOMAXPROCS`). On **amd64, arm64, ppc64le, loong64, riscv64 and s390x** the hot +`GOMAXPROCS`); the NumPy comparison below is on one core. On **amd64, arm64, ppc64le, loong64, riscv64 and s390x** the hot loops are go-asmgen SIMD kernels for `float64`: sum, add/sub/mul/div, sqrt and the dot product (SSE2 or AVX2/FMA on amd64, NEON on arm64, VSX on ppc64le, LASX on loong64, RVV on riscv64 and the vector facility on s390x, the last three @@ -112,7 +112,9 @@ is wrong on subnormals ([Performance](performance.md)): one row per public function (or a named exemption), against the pinned NumPy 2.5.4, `GOMAXPROCS=1` and one BLAS thread, interleaved rounds, refused at a 1-minute load of 8 or more, with the -allocation count of every row checked in CI. The earlier multicore comparison +allocation count of every row checked in CI. At v0.41.1 the measured table has +188 of 256 rows slower than NumPy and 54 faster ([ndarray#118](https://github.com/go-ndarray/ndarray/issues/118) +tracks the slower rows by cause). The earlier multicore comparison with single-threaded NumPy is kept as [Performance history](performance-history.md) for its kernel-level analysis; its ratios are not a verdict. diff --git a/content/en/accuracy.md b/content/en/accuracy.md index 660c3c7..3d64c22 100644 --- a/content/en/accuracy.md +++ b/content/en/accuracy.md @@ -8,7 +8,7 @@ description: "What go-ndarray promises about its results: a stated error bound, tags: [accuracy, numpy, math/big] --- -> Mirrored from [`README.md`](https://github.com/go-ndarray/ndarray/blob/v0.41.0/README.md#accuracy-contract) at v0.41.0. +> Mirrored from [`README.md`](https://github.com/go-ndarray/ndarray/blob/v0.41.1/README.md#accuracy-contract) at v0.41.1. The contract is **correct, and as fast as possible**. "Correct" means a stated error bound, checked against an exact oracle. Equality with NumPy's bits is not the contract: wherever it holds today, it is how a function was ported, and a faster default that stays within its bound may replace it. diff --git a/content/en/dtypes.md b/content/en/dtypes.md index cbf091a..6be6efc 100644 --- a/content/en/dtypes.md +++ b/content/en/dtypes.md @@ -8,7 +8,7 @@ description: "Why the dtype is a run-time property of one Array type, how arrays tags: [dtypes, numpy] --- -> Mirrored from [`docs/design-dtypes.md`](https://github.com/go-ndarray/ndarray/blob/v0.41.0/docs/design-dtypes.md) at v0.41.0. +> Mirrored from [`docs/design-dtypes.md`](https://github.com/go-ndarray/ndarray/blob/v0.41.1/docs/design-dtypes.md) at v0.41.1. > Status: implemented (Phase 2). Supersedes decision 4 of > [plan-ndarray.md](roadmap.md) ("`float64` first"). diff --git a/content/en/linalg.md b/content/en/linalg.md index a7b71b8..5e9415c 100644 --- a/content/en/linalg.md +++ b/content/en/linalg.md @@ -8,9 +8,9 @@ description: "Solve, Inv, Det, Cholesky, QR, SVD, Eig and the rest of numpy.lina tags: [linalg, numpy] --- -> Mirrored from [`docs/linalg.md`](https://github.com/go-ndarray/ndarray/blob/v0.41.0/docs/linalg.md) at v0.41.0. +> Mirrored from [`docs/linalg.md`](https://github.com/go-ndarray/ndarray/blob/v0.41.1/docs/linalg.md) at v0.41.1. -Package [`linalg`](https://pkg.go.dev/github.com/go-ndarray/ndarray@v0.41.0/linalg) gives ndarray arrays the functions of +Package [`linalg`](https://pkg.go.dev/github.com/go-ndarray/ndarray@v0.41.1/linalg) gives ndarray arrays the functions of `numpy.linalg`, written in Go without cgo or assembly of its own: the matrix products it relies on are the ndarray package's packed SIMD GEMM. diff --git a/content/en/performance.md b/content/en/performance.md index d35cb2b..ec96f84 100644 --- a/content/en/performance.md +++ b/content/en/performance.md @@ -8,11 +8,11 @@ description: "go-ndarray against the pinned NumPy on one core, both sides: the m tags: [performance, numpy, refbench] --- -> Mirrored from [`docs/perf.md`](https://github.com/go-ndarray/ndarray/blob/v0.41.0/docs/perf.md) at v0.41.0. +> Mirrored from [`docs/perf.md`](https://github.com/go-ndarray/ndarray/blob/v0.41.1/docs/perf.md) at v0.41.1. -The table is [perf-table.md](https://github.com/go-ndarray/ndarray/blob/v0.41.0/docs/perf-table.md), generated by -[refbench](https://github.com/go-scikit/refbench) (go-scikit/refbench v0.1.2) -from [perf.json](https://github.com/go-ndarray/ndarray/blob/v0.41.0/docs/perf.json); nothing in it is edited by hand. The rules are +The table is [perf-table.md](https://github.com/go-ndarray/ndarray/blob/v0.41.1/docs/perf-table.md), generated by +[refbench](https://github.com/go-scikit/refbench) (go-scikit/refbench v0.3.0) +from [perf.json](https://github.com/go-ndarray/ndarray/blob/v0.41.1/docs/perf.json); nothing in it is edited by hand. The rules are those of the go-scikit performance campaign ([go-scikit/roadmap#27](https://github.com/go-scikit/roadmap/issues/27)): @@ -36,7 +36,7 @@ those of the go-scikit performance campaign `TestRefSmoke` runs every NumPy call once. - **One case per public function** (a function with several shapes of use has several rows, `Array.SumAxis/axis0` and `/axis1`), or a named exemption with - its reason in [perf-exempt.md](https://github.com/go-ndarray/ndarray/blob/v0.41.0/docs/perf-exempt.md). CI fails on a public function + its reason in [perf-exempt.md](https://github.com/go-ndarray/ndarray/blob/v0.41.1/docs/perf-exempt.md). CI fails on a public function with neither. ## What a row times @@ -72,14 +72,24 @@ go test -run 'TestDataParity|TestRefSmoke' -perf.parity . # needs uv ## Status -The table at this commit is **deferred**: the host was at a 1-minute load of 8 -to 80 all day, so only the allocation counts are recorded (exact under any -load). There is no timing verdict, and no row is claimed faster or slower. The -first `-perf.run` at a load below 8 replaces it, and `refbench issues` drafts -one issue per slower row. +The table is **measured** at v0.41.0 (`de3f41ac`) on one pinned core of cfarm420 +(AMD EPYC 7773X, Zen 3). The 1-minute load over the rounds was 4.12 to 5.56, +and all 256 rows are valid. -Defects visible from the allocation counts alone are filed: -[#103](https://github.com/go-ndarray/ndarray/issues/103) (`Choice`: 200 013 -allocations for 100 000 draws) and -[#104](https://github.com/go-ndarray/ndarray/issues/104) (`linalg` -decompositions: 90 to 276 allocations per 64 x 64 call). +**188 rows are slower than NumPy and 54 are faster.** Every slower row is an +open defect. They are tracked by cause in +[#118](https://github.com/go-ndarray/ndarray/issues/118) rather than in one +issue per row: +- result allocation: the allocating `Add` is 3.1× slower, while `AddInto` ties (1.03); +- elementwise operations without a vector kernel: `Ceil` is 20× slower, `Abs` 12×; +- copies where NumPy returns a view or wraps the buffer; +- `linalg` at 64 × 64 (1.4–4×); +- the `fft` shifts; +- the `random` draws built on `log`/`exp`. + +Faster, for example: `SqrtInto` (0.51), `fft.FFT` (0.54), `Sum` (0.70), `Exp` (0.89). + +The run was made from the release's own code. The test binary was +cross-compiled from a clean v0.41.0 worktree, the tag was shipped to the host +as a git bundle, and the binary ran from outside the clone so that the tree +stayed clean. Done that way, the recorded commit is the tag itself. diff --git a/content/en/random.md b/content/en/random.md index dddc0fc..08f18e7 100644 --- a/content/en/random.md +++ b/content/en/random.md @@ -8,9 +8,9 @@ description: "numpy.random with NumPy's numbers for the same seed: the bit gener tags: [random, numpy] --- -> Mirrored from [`docs/random.md`](https://github.com/go-ndarray/ndarray/blob/v0.41.0/docs/random.md) at v0.41.0. +> Mirrored from [`docs/random.md`](https://github.com/go-ndarray/ndarray/blob/v0.41.1/docs/random.md) at v0.41.1. -Package [`random`](https://pkg.go.dev/github.com/go-ndarray/ndarray@v0.41.0/random) is `numpy.random` over go-ndarray arrays. Its goal +Package [`random`](https://pkg.go.dev/github.com/go-ndarray/ndarray@v0.41.1/random) is `numpy.random` over go-ndarray arrays. Its goal is migration: a notebook moved from NumPy to Go keeps its numbers for the same seed. @@ -24,7 +24,7 @@ u, _ := random.Rand(3) // np.random.rand(3) ``` `Example`, `ExampleSeed` and `ExampleGenerator_ChoiceN` in -[`example_test.go`](https://github.com/go-ndarray/ndarray/blob/v0.41.0/random/example_test.go) print NumPy's own numbers. +[`example_test.go`](https://github.com/go-ndarray/ndarray/blob/v0.41.1/random/example_test.go) print NumPy's own numbers. ## What is implemented @@ -142,7 +142,7 @@ random arguments. Used as-is, that made 3% of `np.random.randn` values and 10% of `lognormal` values one ULP off. So `random` rounds `log`, `log1p`, `exp`, `expm1` and `pow` **correctly** -([`libm.go`](https://github.com/go-ndarray/ndarray/blob/v0.41.0/random/libm.go)): a fast evaluation to about 2⁻⁶⁸ with Ziv's +([`libm.go`](https://github.com/go-ndarray/ndarray/blob/v0.41.1/random/libm.go)): a fast evaluation to about 2⁻⁶⁸ with Ziv's rounding test, and a double-double fallback (about 2⁻¹⁰⁰) for the one argument in ~2¹⁵ that needs it. Checked against mpmath at 300 bits on 63,000 arguments (0 misrounded; the committed `libm.json` keeps 8,400), and the fast paths diff --git a/content/en/roadmap.md b/content/en/roadmap.md index 74e621e..a620e61 100644 --- a/content/en/roadmap.md +++ b/content/en/roadmap.md @@ -8,7 +8,7 @@ description: "The plan for go-ndarray and what ships today." tags: [roadmap] --- -> Mirrored from [`docs/plan-ndarray.md`](https://github.com/go-ndarray/ndarray/blob/v0.41.0/docs/plan-ndarray.md) at v0.41.0. +> Mirrored from [`docs/plan-ndarray.md`](https://github.com/go-ndarray/ndarray/blob/v0.41.1/docs/plan-ndarray.md) at v0.41.1. > Goal: a **pure-Go (CGO=0)** NumPy-style N-dimensional array library, as a > **standalone, reusable** module with correct scalar kernels now and a clean @@ -109,10 +109,13 @@ suite (plus the per-arch CI jobs already wired in `.github/workflows/ci.yml`). GEMM/dot kernels live in `internal/kernels` for the Phase 1 SIMD path. Matches numpy 2.2.4. Blocked/transpose-aware and decomposition variants remain in Phase 4. -- **Performance — DONE (beats NumPy on its core ops; matmul at tuned-BLAS - parity).** Several levers behind the kernel seam, measured honestly vs NumPy +- **Performance — OPEN.** The first single-core measurement against NumPy 2.5.4 + (v0.41.0, #118) has 188 of 256 rows slower and 54 faster. The earlier + "beats NumPy on its core ops" compared multicore Go with single-threaded + NumPy. What follows is the history of the levers behind the kernel seam, + measured then against NumPy 2.2.4 (see [docs/perf.md](performance.md) and the repo's - [BENCHMARKS.md](https://github.com/go-ndarray/ndarray/blob/v0.41.0/BENCHMARKS.md)): + [BENCHMARKS.md](https://github.com/go-ndarray/ndarray/blob/v0.41.1/BENCHMARKS.md)): - **Multicore.** `Add/Sub/Mul/Div/Map`, `Sum/Max/Min`, the axis reductions, `Concatenate`/`Stack`, and the GEMM fan out across `GOMAXPROCS` above a size threshold (small arrays stay serial). Plus an allocation fix: the diff --git a/content/en/security.md b/content/en/security.md index 6115b5c..9d35ef7 100644 --- a/content/en/security.md +++ b/content/en/security.md @@ -8,7 +8,7 @@ description: "How to report a vulnerability, what the library guarantees, and th tags: [security] --- -> Mirrored from [`SECURITY.md`](https://github.com/go-ndarray/ndarray/blob/main/SECURITY.md) at v0.41.0. +> Mirrored from [`SECURITY.md`](https://github.com/go-ndarray/ndarray/blob/main/SECURITY.md) at v0.41.1. ## Reporting diff --git a/hugo.yaml b/hugo.yaml index 03b5221..8f6e9fb 100644 --- a/hugo.yaml +++ b/hugo.yaml @@ -100,7 +100,7 @@ params: # The ndarray release these pages describe. Its minor version is the # documentation's version label (v0.9.1 -> 0.9): the CI reads it here. ndarray: - version: "v0.41.0" + version: "v0.41.1" navbar: displayTitle: true