numkong
Portable mixed-precision math, linear-algebra, & retrieval library with 2000+ SIMD kernels for x86, Arm, RISC-V, LoongArch, Power, & WebAssembly
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 on this page — 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
numkong on PyPI
pip
pip install numkonguv
uv add numkongpoetry
poetry add numkongInstalling 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 the current Python release (>=3.9) |
| Install friction | medium — platform-specific wheel |
| Runtime dependencies | none |
| Maintenance | actively maintained — 7 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 496,013/month — #6,339 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: numkong-7.8.0-cp310-cp310-macosx_10_9_x86_64.whl; numkong-7.8.0-cp310-cp310-macosx_11_0_arm64.whl; numkong-7.8.0-cp310-cp310-manylinux2014_i686.manylinux_2_17_i686.manylinux_2_28_i686.whl; numkong-7.8.0-cp310-cp310-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl; numkong-7.8.0-cp310-cp310-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl; numkong-7.8.0-cp310-cp310-manylinux_2_28_aarch64.whl; numkong-7.8.0-cp310-cp310-manylinux_2_28_x86_64.whl; numkong-7.8.0-cp310-cp310-musllinux_1_2_aarch64.whl; numkong-7.8.0-cp310-cp310-musllinux_1_2_i686.whl; numkong-7.8.0-cp310-cp310-musllinux_1_2_ppc64le.whl; numkong-7.8.0-cp310-cp310-musllinux_1_2_s390x.whl; numkong-7.8.0-cp310-cp310-musllinux_1_2_x86_64.whl; numkong-7.8.0-cp310-cp310-win_amd64.whl; numkong-7.8.0-cp310-cp310-win_arm64.whl; numkong-7.8.0-cp311-cp311-macosx_10_9_x86_64.whl; numkong-7.8.0-cp311-cp311-macosx_11_0_arm64.whl; numkong-7.8.0-cp311-cp311-manylinux2014_i686.manylinux_2_17_i686.manylinux_2_28_i686.whl; numkong-7.8.0-cp311-cp311-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl; numkong-7.8.0-cp311-cp311-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl; numkong-7.8.0-cp311-cp311-manylinux_2_28_aarch64.whl
Tags
More Artificial Intelligence packages
LiteLLM provides a unified Python interface to…
permissive · top 100 on PyPI
huggingface-hubClient library and CLI tool for downloading,…
permissive · top 100 on PyPI
langchainLangChain provides a framework for building…
permissive · top 1,000 on PyPI
hf-xethf-xet provides chunk-based deduplication and…
permissive · top 1,000 on PyPI
tokenizersTokenizers converts raw text into token…
permissive · top 1,000 on PyPI
transformersTransformers provides a unified framework for…
permissive · top 1,000 on PyPI
ml-dtypesml_dtypes provides NumPy-compatible data types…
permissive · top 1,000 on PyPI
simsimdSimSIMD provides SIMD-optimized kernels for…
permissive · top 5,000 on PyPI
albucoreAlbucore provides optimized atomic image…
permissive · top 5,000 on PyPI
onemkl-sycl-sparseProvides C and Data Parallel C++ (DPC++)…
unclear · top 15,000 on PyPI
nvidia-cublas-cu12Provides NVIDIA CUBLAS native runtime libraries…
unclear · top 1,000 on PyPI
nvidia-cublasProvides NVIDIA CUBLAS native runtime libraries…
unclear · top 1,000 on PyPI
nvidia-cusolverProvides CUDA solver native runtime libraries…
unclear · top 1,000 on PyPI
numpy-rmsCalculates Root Mean Square (RMS) values over…
permissive · top 15,000 on PyPI
numpy-minmaxFinds the minimum and maximum values in a NumPy…
permissive · top 15,000 on PyPI
fxpmathFxpmath provides fixed-point arithmetic with…
permissive · top 15,000 on PyPI