skillfed

numkong

Portable mixed-precision math, linear-algebra, & retrieval library with 2000+ SIMD kernels for x86, Arm, RISC-V, LoongArch, Power, & WebAssembly

numkong v7.8.0 496.0K downloads/30d#6,339 on PyPI1,874
Permissive license Apache-2.0 Active released

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 numkong

uv

uv add numkong

poetry

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 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

Development Status :: 5 - Production/StableIntended Audience :: DevelopersIntended Audience :: Information TechnologyNatural Language :: EnglishOperating System :: MacOSOperating System :: Microsoft :: WindowsOperating System :: POSIX :: LinuxProgramming Language :: CProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.9Programming Language :: Python :: Free Threading :: 3 - StableProgramming Language :: Python :: Implementation :: CPythonTopic :: Scientific/Engineering :: Artificial IntelligenceTopic :: Scientific/Engineering :: Bio-InformaticsTopic :: Scientific/Engineering :: ChemistryTopic :: Scientific/Engineering :: Information AnalysisTopic :: Scientific/Engineering :: Mathematics

Tags

mixed precision linear algebraSIMD dot products distanceslow precision math kernelsprecision control math librarybfloat16 float8 operationsGIL-free batch matrix operationsportable SIMD math library
mixed-precisionsimd-kernelslinear-algebra

More Artificial Intelligence packages