🕸️ Nabled
Nabled is an ndarray-native Rust numerical library focused on production-grade linear algebra and ML-oriented matrix/vector operations.
Optional Arrow interop is available behind feature arrow, using
ndarrow as the zero-copy Arrow/ndarray bridge while keeping
the core numerical crates ndarray-native.
Important! Nabled is under active development right now, so the only way to be sure the public APIs don't break is to pin your version. When stabilized, it will follow proper versioning, but for now it is guaranteed to change.
Install
[]
= "0.0.7"
Implemented Domains
This list is ever-changing, consult the Rust Docs for the source of truth.
- SVD, QR, LU, Cholesky, Eigen, Schur, Polar
- Matrix functions (exp/log/power/sign)
- Triangular solve, Sylvester/Lyapunov
- PCA, regression, iterative solvers
- Numerical Jacobian/gradient/Hessian
- Statistics utilities
- Vector primitives (dot/norm/cosine/pairwise/batched)
Quick Example
use arr2;
use svd;
Review more examples in crates/nabled/examples.
Namespaced API
nabled::core: shared errors, validation, and prelude exports.nabled::linalg: linear algebra and decomposition modules.nabled::ml: ML-oriented numerical routines.
Features
blas: enablesndarray/blasacross participating workspace crates.openblas-system: enables provider-backed LAPACK paths via system OpenBLAS.openblas-static: enables provider-backed LAPACK paths via statically linked OpenBLAS.netlib-system: enables provider-backed LAPACK paths via system Netlib LAPACK.netlib-static: enables provider-backed LAPACK paths via statically linked Netlib LAPACK.magma-system: enables NVIDIA MAGMA provider-backed decomposition paths.accelerator-rayon: enables selected parallel CPU kernels.accelerator-wgpu: enables WGPU-backed dense/vector/tensor kernel paths (f32native,f64native whenSHADER_F64is available).arrow: enables facade-only Arrow/ndarray interop adapters backed byndarrow.
[]
= { = "0.0.7", = ["openblas-system"] }
[]
= { = "0.0.7", = ["arrow"] }
Arrow interop notes:
- Arrow awareness is isolated to facade crate
nabled; lower crates remain ndarray-native. - Arrow checkpoint 2 is complete under the concept-first standalone /
rows-of-Xcontract for dense, sparse, decomposition, tensor, batched, and ML/stat workflows. - Arrow wrappers delegate to the same ndarray-native execution paths, so provider backends, GPU/backend routing, and MAGMA behavior are inherited rather than reimplemented.
- Exact direct-ingress coverage is tracked in
docs/ARROW_SUPPORT_MATRIX.md.
Feature behavior:
openblas-systemimpliesblas.- Provider feature selection (
openblas-system,openblas-static,netlib-system,netlib-static) is compile-time and internal to decomposition paths. magma-systemimplies provider-backed decomposition routing and composes with the OpenBLAS/LAPACK provider stack.- Backend acceleration is compile-time and kernel-family-specific.
- GPU-backend-dispatched kernels use explicit CPU fallback when no usable GPU is available.
f64native GPU execution depends onwgpu::Features::SHADER_F64; when unavailable, backend-dispatchedf64calls fall back to CPU.- Provider/toolchain requirements depend on provider choice;
openblas-staticandnetlib-staticrequire native build toolchains (gcc/gfortran/make), andnetlib-systemrequires a systemLAPACK/Fortran runtime available to the linker.
Arrow Interop
nabled is now ndarrow-powered behind feature arrow.
Current Arrow-ingress coverage includes:
- Canonical dense vector batches over
FixedSizeList<T>(D) - Canonical sparse vector rows and sparse matrix batches over CSR carriers, including
ndarrow.csr_matrix_batch - Canonical dense fixed-shape and variable-shape tensor batches
- LU, Cholesky, QR, SVD, Eigen, Schur, Polar, matrix-functions, triangular solves
- Batched decomposition helpers
- Iterative solvers, Jacobian tools, optimization, PCA, regression, and stats
- Real and complex workflows where the Arrow boundary contract is explicit and natural
For exact module-by-module coverage and intentional remaining gaps, see:
docs/NDARROW_INTEGRATION.mddocs/ARROW_SUPPORT_MATRIX.md
Quality Gates
On macOS, provider-enabled just recipes automatically set PKG_CONFIG_PATH and OPENBLAS_DIR for Homebrew OpenBLAS (/opt/homebrew/opt/openblas). No manual env export is required for those recipes.
Benchmarks
License
Licensed under either:
- MIT license
- Apache License, Version 2.0
at your option.