🕸️ Nabled
Nabled is an ndarray-native Rust numerical library focused on production-grade linear algebra and ML-oriented matrix/vector operations.
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.5"
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).
[]
= { = "0.0.5", = ["openblas-system"] }
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.
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.