DEV.co
Vector Databases · ashvardanian

NumKong

NumKong is a high-performance SIMD-accelerated math library supporting 16+ numeric types (from 6-bit floats to 64-bit complex numbers) across multiple CPU architectures and platforms. It provides bindings for C, C++, Python, Rust, JavaScript, Swift, and Go, with a footprint of ~5 MB and reported performance gains over NumPy, PyTorch, and JAX in specific workloads.

Source: GitHub — github.com/ashvardanian/NumKong
1.8k
GitHub stars
124
Forks
C
Primary language
Apache-2.0
License (OSI-approved)

Key facts

Objective fields from the source. Values we can't verify are shown as “Unknown” rather than guessed.

FieldValue
Repositoryashvardanian/NumKong
Ownerashvardanian
Primary languageC
LicenseApache-2.0 — OSI-approved
Stars1.8k
Forks124
Open issues31
Latest releasev7.7.0 (2026-05-23)
Last updated2026-07-08
Sourcehttps://github.com/ashvardanian/NumKong

What NumKong is

A portable mixed-precision BLAS-like library with 2,000+ SIMD kernels covering vector operations (dot products, distances, similarities), matrix operations, and geospatial transforms. It uses accumulator promotion to prevent overflow (e.g., Int8→Int32, Float16→Float32) and includes validation against 118-bit extended-precision baselines across multiple ISA variants (x86, Arm NEON, RISC-V, LoongArch, Power, WASM).

Quickstart

Get the NumKong source

Clone the repository and explore it locally.

terminalbash
git clone https://github.com/ashvardanian/NumKong.gitcd NumKong# follow the project's README for install & configuration

Need it deployed, integrated, or customized instead? DEV.co ships production installs.

Best use cases

Embedded & resource-constrained vector search

5 MB binary footprint, cross-platform SIMD, no hidden allocations. Suitable for on-device similarity searches, recommendation engines, and retrieval systems where binary size and predictable memory usage matter.

Mixed-precision numerical compute with strict error bounds

Explicit accumulator promotion (Float16→Float32, Int8→Int32) prevents silent overflow. Validated against 118-bit references with documented ULP budgets per type. Strong fit for safety-critical signal processing, scientific computing, and quantized ML inference.

Multi-language systems requiring consistent numeric kernels

Unified C core with bindings to Python, Rust, JavaScript, Swift, Go. Enables consistent dot products, metrics, and transforms across polyglot stacks without reimplementing or linking multiple BLAS libraries.

Implementation considerations

  • Accumulator promotion is automatic; verify that promoted precision meets your numerical stability requirements (e.g., Float16 dot products promote to Float32).
  • Binary is small (~5 MB), but multi-language bindings require linking appropriate language runtimes; C/C++ integration is likely lowest-friction.
  • SIMD ISA selection is hardware-aware but not user-tunable from high-level API; if non-default ISA choice is needed, verify documentation or file issue.
  • Validation is claimed against 118-bit references, but reproducibility of those baselines and audit trail are not clearly documented; consider independent validation for safety-critical use.
  • Open issues (31 at time of data) and active maintenance suggest ongoing development; check issue queue for blockers in your target platforms (e.g., WASM, LoongArch).

When to avoid it — and what to weigh

  • Need production-grade cuBLAS or TPU acceleration — NumKong targets CPU SIMD (x86, Arm, RISC-V, etc.). No GPU or tensor accelerator support documented. If your workload requires CUDA, ROCm, or TPU, this is not a fit.
  • Require mature ecosystem compatibility — While bindings exist, ecosystem maturity is unproven. PyTorch, TensorFlow, and JAX have years of production use, vendor optimization, and large user bases. NumKong is younger (created 2023) and adoption is limited.
  • Throughput benchmarks are your primary metric — README shows latency (single-call) performance gains but mixed results on matrix-mult throughput vs. PyTorch+MKL and NumPy+OpenBLAS. If maximizing sustained throughput is critical, established libraries may be safer.
  • Deep integration with NumPy/SciPy ecosystem expected — NumKong is not a NumPy drop-in replacement. Switching incurs API changes and potential revalidation of numerical results. Existing codebases relying on np.dot, scipy.spatial, etc. require porting.

License & commercial use

Apache License 2.0 (Apache-2.0). A permissive OSI-approved license allowing commercial use, modification, and distribution with attribution and indemnification clauses. No copyleft restrictions.

Apache-2.0 is a permissive license compatible with commercial use. No evidence of proprietary restrictions, dual licensing, or undisclosed commercial terms. However, verify compliance with your own indemnification and attribution policies. As with any open-source dependency, ensure you can sustain maintenance or have a support plan if upstream development slows.

DEV.co evaluation signals

Editorial assessment — not user reviews. Directional, with an explicit confidence level.

SignalAssessment
MaintenanceActive
DocumentationAdequate
License clarityClear
Deployment complexityLow
DEV.co fitGood
Assessment confidenceMedium
Security considerations

No published security policy or known CVEs documented in provided data. Library handles numeric data without inherent buffer-overflow or injection risk typical of C SIMD code, but assembly-heavy implementation (2000+ kernels) increases surface area for edge-case bugs. Input validation (e.g., vector bounds, NaN/Inf handling) appears to be validated but specifics not public. For production use, review source code or request a security audit, especially if processing untrusted numeric input. No mention of fuzzing, ASAN, or formal verification.

Alternatives to consider

NumPy + OpenBLAS / Intel MKL

Mature, widely adopted, extensive ecosystem (SciPy, Pandas, etc.). Larger footprint (~30 MB NumPy alone). Throughput on f32/f64 competitive or better. Lower risk for production systems; trade-off is binary size and less control over numeric precision.

PyTorch / JAX

Framework-level abstractions, GPU support, XLA compilation. Much larger (300–700 MB). Higher throughput on large batches and accelerators. Better for ML pipelines; not suitable if you need minimal footprint or CPU-only numeric kernels.

Eigen (C++)

Header-only, highly optimized for dense linear algebra. Mature, widely used in robotics and game engines. Limited to C++; no Python bindings. Mixed-precision support is less comprehensive than NumKong.

Software development agency

Build on NumKong with DEV.co software developers

If you're building resource-constrained vector search, quantized ML inference, or cross-language numeric pipelines, NumKong merits a proof-of-concept. Start with the Python API, benchmark against your baseline (NumPy/PyTorch), and validate error bounds for your precision model. Contact us if you need help integrating or evaluating SIMD-accelerated alternatives.

Talk to DEV.co

Related open-source tools

Surfaced by semantic similarity across the DEV.co open-source index.

Related on DEV.co

Explore the category and the services that help you build with it.

NumKong FAQ

Does NumKong support GPU/CUDA acceleration?
No. NumKong targets CPU SIMD (x86, Arm, RISC-V, etc.). For GPU workloads, use PyTorch, JAX, or cuBLAS.
Can I use NumKong as a drop-in replacement for NumPy?
No. API is different; requires porting code. However, core operations (dot products, distances) are available across Python, Rust, C++, JavaScript, etc.
What numeric types are supported?
17+ types: 6-bit floats (E5M2), 16-bit floats (Float16, BFloat16), 32/64-bit floats, complex numbers, and integers (4–64 bit). Specifics vary by operation and ISA.
Is there professional support or SLA?
Unknown. No support model, SLA, or commercial contact mentioned in README or repository. Community support via issues and GitHub discussions.

Custom software development services

From first prototype to production, DEV.co delivers software development services around tools like NumKong. Our software development agency staffs experienced software developers and web developers for custom software development, web development, integrations, and ongoing support across vector databases and beyond.

Evaluate NumKong for Your Numeric Workload

If you're building resource-constrained vector search, quantized ML inference, or cross-language numeric pipelines, NumKong merits a proof-of-concept. Start with the Python API, benchmark against your baseline (NumPy/PyTorch), and validate error bounds for your precision model. Contact us if you need help integrating or evaluating SIMD-accelerated alternatives.