core/tensor/blas library

OpenBLAS FFI bindings for the CPU matmul fast path.

Blas.sgemm wraps cblas_sgemm from the system-installed OpenBLAS (libopenblas.so.0). Falls back gracefully when the library isn't present or the caller sets DART_PYTORCH_NO_BLAS=1 — in either case Blas.enabled returns false and callers should use the Dart matmul path.

On WSL 2 with libopenblas-pthread 0.3.26, this gives roughly a 20-50× speedup on the shapes we hit in Qwen1.5-MoE forward ([T, D=2048] @ [D, hidden=1408..151936]) compared to the hand-unrolled Dart triple loop.

Classes

Blas