Swift · Highlights

Highlights

8.0.0-rc.1 · b1f866ab

Collection-first scalar API. Plain [Float32], [Float16], [Int8], [U1x8], and other wrapper arrays work directly. Owning tensors. Tensor<T> owns its storage, produces views and spans without nested pointer closures, and drives the matrix kernel API. Explicit matrix views. MatrixView and MatrixSpan make strides and ownership visible. Reusable packed matrices. PackedMatrix owns its internal packed buffer and can be reused across repeated queries. Binary metrics. U1x8 packs 8 bits per byte; Hamming and Jaccard kernels operate directly on those packed words. MaxSim and ColBERT-style late interaction. MaxSimPackedMatrix and .maxSimPack() cover token-level late-interaction scoring. No hidden output allocation. You own the result buffers for matrix kernels. Low-precision wrappers. Storage wrappers preserve exact bits for bf16 and mini-float formats. Unaligned caller buffers are fine. Packing handles internal layout itself.

§ Ecosystem Comparison

FeatureNumKongAccelerate/vDSPMLX
Operation familiesdots, distances, binary, geospatial, MaxSimdots, distances, FFT, some BLASmatmul, elementwise, reductions, FFT
PrecisionBFloat16 through sub-byte — Float8, Float6, packed bits; automatic widening; Kahan summation; 0 ULP in Float32/Float64Float32/Float64, limited Float16; no auto-widening; IEEE defaultsFloat16/BFloat16/Float32; no Float8 or sub-byte; backend-dependent
Runtime SIMD dispatchper call, the highest capability the CPU runs and the build holds, across x86, Arm, RISC-VApple-only, no runtime ISA selectionGPU dispatch only, no CPU ISA selection
Packed matrix, GEMM-likePackedMatrix packs once, reused across query batchesBLAS GEMM availableGEMM via graph, implicit caching
Symmetric kernels, SYRK-likedotsSymmetric, angularsSymmetric, etc. skip duplicate pairs, up to 2x speedupcblas_ssyrk available for rank-k updatesno duplicate-pair skipping
Collection-based APIworks with any RandomAccessCollection conforming typepointer-based vDSP functionsMLXArray-based
Memory modelcaller-owned buffers; Tensor/PackedMatrix own their storagecaller-managed via UnsafePointergraph-managed; implicit allocation and caching