--- id: numkong version: "7.8.0" license: Apache-2.0 license_treatment: permissive maintenance: active --- # numkong — Portable mixed-precision math, linear-algebra, & retrieval library with 2000+ SIMD kernels for x86, Arm, RISC-V, LoongArch, Power, & WebAssembly License: permissive · Maintenance: active · Downloads: 496.0K/mo ## What it is and what it does NumKong is a high-level Python SDK for numerical computing that bridges buffer protocol interoperability with native mixed-precision kernels and backend-specific optimizations. It targets operations where precision control matters: dot products, distances (squared Euclidean, Euclidean, angular), and element-wise reductions. Unlike standard libraries, it lets you work with low-precision dtypes (BFloat16, Float8, Float6, packed bits) while automatically widening accumulators to prevent precision loss—and it releases the GIL around native work in batched, packed, and symmetric kernels. The API provides shape-aware outputs and familiar scalar, batched, and all-pairs entrypoints with explicit control over accumulator dtype and output allocation. It supports dense, packed, and symmetric matrix operations, sparse helpers, and geometric mesh alignment across x86, ARM, RISC-V, LoongArch, Power, and WebAssembly. Pre-built wheels cover Python 3.9–3.14 on Linux, macOS, and Windows; source builds require platform-specific compiler support. Use it for: - Computing dot products and distances with automatic precision widening when input data is in low-precision formats like Float16 or BFloat16. - Batch similarity search or all-pairs distance computation where packed matrix reuse or symmetric kernel optimization reduces redundant work. - Mixed-precision inference pipelines needing fine-grained control over accumulator dtype without explicit boilerplate. - Geometric or spatial computations (mesh alignment, angular distances) where specialized kernels are needed. - High-throughput numerical workloads where GIL-free batched operations and runtime SIMD dispatch improve throughput on heterogeneous CPU hardware. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. NumKong provides mixed-precision linear algebra and distance kernels with automatic accumulator widening, GIL-free batched operations, and low-precision dtype support (BFloat16, Float8, Float6, packed bits) across x86, ARM, RISC-V, and other architectures. Yes, if you need mixed-precision linear algebra with automatic accumulator widening and GIL-free kernels. The library is actively maintained with no known vulnerabilities and supports Python 3.9–3.14 across major platforms. Install friction is moderate due to compiled wheels; pre-built binaries are available for common setups. Not necessary if you are satisfied with standard precision models or do not use low-precision dtypes. ## Install pip install numkong uv add numkong poetry add numkong ## Installing numkong Before you install: Medium install friction due to compiled wheels for many platforms and architectures. Actively maintained with a release 7 days ago and 1874 repository stars. Pre-built wheels cover Python 3.9–3.14 on Linux, macOS, and Windows; source builds require platform-specific compiler support. License in practice: Apache-2.0 permissive license allows commercial use, modification, and distribution with minimal restrictions—suitable for proprietary and open-source projects alike. Quickstart: import numkong as nk a = nk.zeros((256,), dtype='float32') b = nk.zeros((256,), dtype='float32') dot = nk.dot(a, b) # widened accumulation print(dot) Requires Python 3.9 or later; pre-built wheels available for common platforms, but source builds on RISC-V or Windows require specific compiler versions. Verify before relying: - Whether automatic SIMD dispatch at runtime on x86, ARM, RISC-V improves performance over compile-time selection in typical workloads. - Concrete performance gains from GIL release in batched/packed kernels compared to alternatives on standard hardware. - Whether MaxSim operation family and geometric mesh alignment features are documented and stable for production use. - Availability and stability of sparse helpers and symmetric kernel optimizations for real-world use cases. ## Package facts - License: Apache-2.0 (permissive) - Python support: supports_current - Install friction: medium - Maintenance: active - Downloads: 496.0K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags mixed precision linear algebra, SIMD dot products distances, low precision math kernels, precision control math library, bfloat16 float8 operations, GIL-free batch matrix operations, portable SIMD math library, mixed-precision, simd-kernels, linear-algebra [View on SkillFed](https://skillfed.io/packages/numkong) · [View on PyPI](https://pypi.org/project/numkong/)