Skip to content

v0.1.3

Choose a tag to compare

@nedpark nedpark released this 06 Nov 05:29
· 6 commits to main since this release
ff026ac

Bandal v0.1.3 — Faster than pandas across the benchmark suite

v0.1.3 is a performance release. Every workload in the pandas comparison benchmark now runs at or above pandas speed under all four execution policies (native, cpu, gpu, gpuFloat32). Checksums still match pandas (match: ok). There are no public API changes.

Performance (5,000,000 rows, speedup vs pandas)

Workload v0.1.3
left_join ~130x
groupby_sum ~30x
sort ~6.3x
correlation ~6x (native/CPU), 4.4x (GPU)
filter ~6x
expanding(.sum) ~5x
rolling(.mean, window: 20) ~2.7x
summary() 1.5x (CPU) – 3.3x (GPU)
arithmetic + sqrt ~1.1x

Median computation time only, pandas 3.1.1 vs Bandal. Reproduce with Scripts/benchmark.sh --rows 100000,1000000,5000000.

Highlights

  • Rolling and expanding windows: sum, mean and count now use a native single-pass O(n) kernel with Neumaier-compensated summation. They no longer go through MLX prefix sums, which were about 0.5x of pandas under the MLX policies.
  • Element-wise arithmetic and sqrt: + - * / and sqrt use a single-pass SIMD kernel that checks the result is finite as part of the write loop, with no separate validation pass. The native-policy fallback shares the same kernel.
  • GPU Float32 path: sqrt and sign no longer use it, because the Double ↔ Float conversion costs more than the GPU saves.
  • Columnar engine (Phase 8): unboxed typed paths for group-by, joins, sorting, filtering and BitSet slicing, plus O(N) sliding-window kernels.

Quality

  • 69 tests pass with swift test and Scripts/test-with-mlx.sh.
  • New tests cover sliding and expanding windows with missing values across execution policies, sliding-sum accuracy after a large value leaves the window, and chained multiply → add → sqrt with negative inputs.

Upgrade

.package(url: "https://github.com/NeuroAssociates/Bandal.git", from: "0.1.3")