Skip to main content

NumFast

Columnar compute for Python and JavaScript — native CPU and GPU, WebAssembly kernels, and browser execution.

A columnar compute engine for Python and JavaScript, with a small, NumPy- and pandas-shaped Python surface. Hand it columns; it hands you columns back. Integer columns are computed exactly in int32, NULLs are carried explicitly rather than as NaN, and a query is one lazy chain that a single planner call turns into one execution graph.

pip install numfast
pip install "numfast[pandas]"   # + pandas adapters
pip install "numfast[arrow]"    # + pyarrow adapters
pip install "numfast[gpu]"      # + wgpu, required to execute on the GPU path

Python 3.11+. numpy>=1.24 is the only hard dependency.


Quick start

import pandas as pd
import numfast as nf

orders = pd.DataFrame({
    "region":  ["emea", "apac", "emea", "amer", "apac", "emea"],
    "revenue": [120.0, 80.0, 240.5, 60.0, 95.5, 310.0],
})

result = (nf.from_pandas(orders)
          .query()
          .group("region", {"revenue": ("sum", "count")})
          .sort("revenue.sum", desc=True)
          .compile())

print(result.to_pandas())
region  revenue.sum  revenue.count
  emea        670.5              3
  apac        175.5              2
  amer         60.0              1

The vocabulary is the whole of it: query → filter / derive / group / sort / limit / reduce → compile, with expressions built from app.c("col") and app.c("col") > 10. No query language to learn, no index to declare.


Read this before you rely on it

The API is 44 names. It is small on purpose, and it is new in 0.2.1. window, or_, join, replace and fill_null are not in it. Each absence has a stated reason; Expr.or_ exists and raises rather than returning an empty frame.

Where NumFast is slower than DuckDB. On high-cardinality grouping and distinct-count shapes it is several times slower, not a few percent — a property of the CPU driver being a NumPy reference executor, not of missing effort. If your workload is high-cardinality grouping, DuckDB is the better tool today. Where NumFast wins, it wins on small aggregate-shaped queries, because one planner call replaces a fixed per-query setup: read that as low fixed cost, not as a large speedup.

This distribution quotes no wall-clock numbers. A benchmark claim is only worth reading if the artefact and the command that produced it are both in the package, and neither is: the inputs are external and too large to ship. Benchmark the operation mix you actually have.

What raises rather than guesses. A BIGINT key or literal above int32 — UserID-shaped identifiers, for instance — raises and names the column, because logical values are int32 and narrowing them silently would be a wrong answer rather than a slow one. A query needing a conditional (CASE) cannot be expressed at all: there is no such primitive.

The GPU does 15 of 33 operations, measured on one RTX 2060 over Vulkan. The other 18 run on the CPU and are listed by nf.app().gpu_capabilities(). The recorded GPU timings at the sizes measured were slower than the CPU path. The GPU backend produces the same computed results and supports batch execution, but the current API does not provide a GPU-resident Table/Series; operation results are returned to host memory. No GPU speedup is claimed. Asking for backend='gpu' on a CPU-only operation raises rather than falling back.

One known silent case. group drops a key whose measure is entirely NULL: no exception, no warning, one group missing. Check the output row count against the distinct key count. Also: to_numpy() reads an integer NULL as 0 — use to_pandas().

The complete register, with a certainty tag and a reproduction on every entry, is KNOWN_LIMITATIONS.md. It is not a short list, and it is not apologetics.


What is in the box

  • A 44-name consumer facade — filter, derive, group, sort, limit, reduce, compile, a 23-name expression vocabulary including isin, is_null, cumsum, shift and five text predicates.
  • 30 Builder Extensions forming the engine: a semantic IR of one node per column, a cost-calibrated planner, a NumPy reference CPU driver, a wgpu-py/WGSL GPU driver, and the storage layer.
  • A Rust kernel layer (numfast-native, no third-party dependencies) loaded through ctypes: sort, join, group-by, carry, segmented reduce, shortest paths, cost travel, RNG. It is kernels, not an executor — it does not schedule, stream or own memory.
  • A WebAssembly build of the same kernels (@numfast/kernels on npm): a portable kernel library, 86 function exports, one memory, zero imports, 17 typed wrappers. Not a compute core — there is no executor inside the .wasm. The .wasm is host-independent; the published npm package is Node-only and has no browser entry point.
  • Refusals you can rely on: NULL group keys, arithmetic or ordering on a text column, out-of-int32 values, BIGINT keys and literals, CPU-only operations on the GPU. Each raises and names the cause.

Two wheels, one version

Artefact Native library Who gets it
py3-none-win_amd64 yes Windows x86-64
py3-none-manylinux_2_28_x86_64 yes Linux x86-64, glibc 2.28+

Linux x86-64 users get the native library live, built inside quay.io/pypa/manylinux_2_28_x86_64 and audited by auditwheel repair. On macOS there is no wheel yet: pip falls back to the sdist and the Rust-backed calls degrade to the numpy reference executor. That is visible rather than latent:

>>> import numfast as nf
>>> nf.native_info()
{'disabled': False, 'dll': None, 'dll_exists': False}

The native directory is simply absent and every Rust-backed call falls back to the NumPy CPU path — not a binary that fails to load at run time. No Linux native wheel is published; a Linux user who wants the native kernels can build them from the Corresponding Source this wheel already carries, and the installation page gives the one command. It is unsupported, and the Linux test suite is red.

Licence

AGPL-3.0-only. The wheel conveys numfast_native.dll — object code — so AGPL-3.0 §6 is discharged by construction: the Corresponding Source (47 .rs files, the crate manifest and lockfile, the cargo config, the link shims, and a SHA256SUMS over exactly those bytes) ships inside the wheel under numfast/_corresp_src/. The written-offer route is deliberately not used.

There is no "paid AGPL". A separate proprietary commercial licence is announced but its terms do not exist yet — not written, not priced, not an offer. The AGPL grant is free, unconditional and complete. Support and consulting are available now and need no further paperwork.

Full text: https://github.com/numfast/numfast/blob/main/LICENSE

Documentation


Publishing note: this file is the PyPI long description — pyproject.toml declares readme = "README_PYPI.md". Publishing to PyPI is a manual step; there is no publish workflow in this repository and no tag trigger in CI. The PyPI project name numfast also carries three earlier releases from a superseded design generation (0.0.1, yanked; 1.0.0a1; 1.0.0a2). pip install numfast selects 0.2.1; pip install numfast --pre selects 1.0.0a2, which is not this project.

Metadata

Release files for numfast 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for numfast 0.2.1
File Size Uploaded Provenance Actions
numfast-0.2.1.tar.gz 1.2 MB Without provenance Details for numfast-0.2.1.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for numfast 0.2.1
File Interpreter ABI Platform Actions
numfast-0.2.1-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details for numfast-0.2.1-py3-none-win_amd64.whl
numfast-0.2.1-py3-none-manylinux_2_28_x86_64.whl Python 3 none Linux glibc 2.28+ x86-64 Details for numfast-0.2.1-py3-none-manylinux_2_28_x86_64.whl

Total release size: 3.2 MB

Release files / numfast-0.2.1.tar.gz

Download URL numfast-0.2.1.tar.gz
Size 1.2 MB
Tags Source
SHA-256 checksum
How to use checksums
5cc2b9ab5d96a7aae9cba0a6cb363642fa844623d05625c16a2acec4d046c649
BLAKE2b-256 checksum
How to use checksums
ca70c442bf0ce24fe095003702bfce89711a6df46415a3dec9bd26e2dd691747
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.6

Release files / numfast-0.2.1-py3-none-win_amd64.whl

Download URL numfast-0.2.1-py3-none-win_amd64.whl
Size 1.1 MB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
79a3efb2494235f73e2e3ed619410a3223cf35a4be905d7dfcc5a6f495db35e1
BLAKE2b-256 checksum
How to use checksums
93e6960686a70c3d574b411d797c71d527294fa816071a161bba91c789efee5d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.6

Release files / numfast-0.2.1-py3-none-manylinux_2_28_x86_64.whl

Download URL numfast-0.2.1-py3-none-manylinux_2_28_x86_64.whl
Size 849.9 kB
Tags Linux glibc 2.28+ x86-64 Python 3
SHA-256 checksum
How to use checksums
355eb74ffbf39b40e3721233e1370afa18860583c9ae50e24f90cbec737fd3c1
BLAKE2b-256 checksum
How to use checksums
968eb8450c36da4d7f5a1c1be22252568d23d77352909e8429c9d62373438dc6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.6

Security for numfast 0.2.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page