Skip to main content

hotkernels

Faster NumPy on Apple Silicon and on x86-64 Linux, with one line and no other change to your code.

import hotkernels
hotkernels.install()

install() points NumPy at hand-written assembly kernels, ARM64 NEON or x86-64 AVX2, for the calls where NumPy is slowest. Every kernel is checked against NumPy's own output, including NaN, infinities, signed zeros and ties, and is memory-safe by test. A call no kernel handles goes to NumPy exactly as it was written.

Install

pip install hotkernels

Wheels are for macOS on Apple Silicon and for Linux on x86-64 (glibc), CPython 3.11 to 3.14, with NumPy 2.3 or a later NumPy 2. Another Python on one of those builds from source, which needs the Xcode command line tools on a Mac, or a C compiler and GNU binutils on Linux. On Linux the processor must have the x86-64-v3 instruction sets (AVX2, FMA, BMI1, BMI2, LZCNT, MOVBE, POPCNT), which Intel processors have had since 2013 and AMD's since 2015; on an older one, and on any other machine, install() does nothing and report() says why, so code that calls it stays portable.

The speed figures on this page were measured on an Apple M1 Pro. On x86-64 NumPy has vector loops of its own for some of these calls, so the gains differ: larger for some, close to none for clip and astype.

What gets faster

np.argmax, np.argmin, np.clip (on int64 for arrays of up to 4,096 elements), x[mask] (and np.compress, np.extract), x[mask] = v (and np.putmask, np.copyto(..., where=mask)), np.nonzero (and np.where(mask)), np.where(mask, a, b) on arrays of one shape, np.cumsum (on boolean masks too), np.maximum.accumulate and np.fmax.accumulate on one-dimensional arrays, np.fmax.reduceat on short runs (runs of 16 are about 3x faster than NumPy at a million elements on an Apple M1 Pro; runs of 256 or more are slower than NumPy on large arrays, by up to 1.6x on Apple Silicon), m.any(axis=1) on two-dimensional boolean arrays, np.round on float64 arrays of up to 4,096 elements, np.median on float64 arrays of up to 128 elements, x.astype(np.float32) from uint8, np.sum on uint8 and on boolean masks, np.count_nonzero, np.histogram, np.bincount (on uint8, int16 and int64), np.isin, np.searchsorted (and np.digitize, which calls it) and np.interp, for the element types each kernel covers. At a million elements, from Python, x[mask] on float32 is about 31x faster and np.histogram about 9x. On small arrays most of a NumPy call is NumPy's own call path, which hotkernels skips where it can: on 16 elements np.clip(x, -0.5, 0.5) is about 10x faster, when its bounds are plain numbers and there is no out, and np.argmax(x) about 14x. np.clip on a short int64 array, and np.round and np.median on a short float64 one, which no kernel serves, are answered by plain C loops inside hotkernels for the same reason: np.median of 16 elements about 45x faster, measured on x86-64.

Using it

import numpy as np
import hotkernels

hotkernels.install()            # NumPy now uses the kernels, in the whole process
x = np.random.standard_normal(1_000_000)
x[x > 0]                        # served by a kernel

print(hotkernels.report())      # what is installed, and how often each kernel ran
hotkernels.uninstall()          # NumPy is exactly as it was
  • hotkernels.install(inexact=True) also installs np.cumsum on float32 and float64, which are within a declared tolerance of NumPy rather than bit-identical.
  • with hotkernels.enabled(): installs for the duration of a block.

Without changing your code

python -m hotkernels my_script.py --its --own --arguments
python -m hotkernels -m pytest
python -m hotkernels --report my_script.py   # print report() to standard error at the end

Documentation, the full results and how the kernels are made: sofeikov.github.io/hotkernels and github.com/sofeikov/hotkernels.

Metadata

Release files for hotkernels 0.3.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 hotkernels 0.3.1
File Size Uploaded Provenance Actions
hotkernels-0.3.1.tar.gz 219.1 kB With provenance Details for hotkernels-0.3.1.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for hotkernels 0.3.1
File Actions
hotkernels-0.3.1-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl CPython 3.14 CPython 3.14 Linux glibc 2.28+ x86-64, Linux glibc 2.17+ x86-64 Details for hotkernels-0.3.1-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
hotkernels-0.3.1-cp314-cp314-macosx_11_0_arm64.whl CPython 3.14 CPython 3.14 macOS 11.0+ ARM64 Details for hotkernels-0.3.1-cp314-cp314-macosx_11_0_arm64.whl
hotkernels-0.3.1-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl CPython 3.13 CPython 3.13 Linux glibc 2.28+ x86-64, Linux glibc 2.17+ x86-64 Details for hotkernels-0.3.1-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
hotkernels-0.3.1-cp313-cp313-macosx_11_0_arm64.whl CPython 3.13 CPython 3.13 macOS 11.0+ ARM64 Details for hotkernels-0.3.1-cp313-cp313-macosx_11_0_arm64.whl
hotkernels-0.3.1-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.28+ x86-64, Linux glibc 2.17+ x86-64 Details for hotkernels-0.3.1-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
hotkernels-0.3.1-cp312-cp312-macosx_11_0_arm64.whl CPython 3.12 CPython 3.12 macOS 11.0+ ARM64 Details for hotkernels-0.3.1-cp312-cp312-macosx_11_0_arm64.whl
hotkernels-0.3.1-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.17+ x86-64, Linux glibc 2.28+ x86-64 Details for hotkernels-0.3.1-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
hotkernels-0.3.1-cp311-cp311-macosx_11_0_arm64.whl CPython 3.11 CPython 3.11 macOS 11.0+ ARM64 Details for hotkernels-0.3.1-cp311-cp311-macosx_11_0_arm64.whl

Total release size: 813.5 kB

Release files / hotkernels-0.3.1.tar.gz

Download URL hotkernels-0.3.1.tar.gz
Size 219.1 kB
Tags Source
SHA-256 checksum
How to use checksums
23a89c0362a2b0b845d69f044dcc51dd1e93f8ff41a3cb0ad31230621dfc37cf
BLAKE2b-256 checksum
How to use checksums
39d07c8f4a000bbfde38abb8677156daab24b15a10685f2f8e51feeaba2607c9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 19, 2026.

Transparency log

Release files / hotkernels-0.3.1-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl

Download URL hotkernels-0.3.1-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Size 73.4 kB
Tags CPython 3.14 Linux glibc 2.17+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
fe5518fbbf599e808a33f4c9f80f83b53d4e62528393995bb4e88f96d400a68e
BLAKE2b-256 checksum
How to use checksums
806c16717a47804f14d987f0ca3eafc93a3aaabf4f5320066128cdd821fa2c9e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 19, 2026.

Transparency log

Release files / hotkernels-0.3.1-cp314-cp314-macosx_11_0_arm64.whl

Download URL hotkernels-0.3.1-cp314-cp314-macosx_11_0_arm64.whl
Size 75.3 kB
Tags CPython 3.14 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
772f1ed777f455e205f2a9cb6481389ff8b54f43ba69fff10322d0f5b5c07227
BLAKE2b-256 checksum
How to use checksums
53ceb28e61ca5760f64069b1f7bd148f7fcfedcd2f03254f616fdd3803b915fb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 19, 2026.

Transparency log

Release files / hotkernels-0.3.1-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl

Download URL hotkernels-0.3.1-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Size 73.5 kB
Tags CPython 3.13 Linux glibc 2.17+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
3f90eac8edc2c80b9a1dcb37e5de0a310d45c20a4f24afc43491beeed4f0258b
BLAKE2b-256 checksum
How to use checksums
610dce520f2993dcb3085629686d9b2618c782086940985e5fc98670660d28c1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 19, 2026.

Transparency log

Release files / hotkernels-0.3.1-cp313-cp313-macosx_11_0_arm64.whl

Download URL hotkernels-0.3.1-cp313-cp313-macosx_11_0_arm64.whl
Size 75.2 kB
Tags CPython 3.13 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
e02e8589c3d387b48f8eb67f44e773461a05bd0f62a1565f850c8ef860ba159c
BLAKE2b-256 checksum
How to use checksums
eb9dfd4f9850d7dfee33e50e7ac5d285abcb5f978922bb4fdeb8a36e993e3ef1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 19, 2026.

Transparency log

Release files / hotkernels-0.3.1-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl

Download URL hotkernels-0.3.1-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Size 73.5 kB
Tags CPython 3.12 Linux glibc 2.17+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
86758317ada396f95b25f8b4f5932bcd6d4aef2748c57cec95d0f7a96411f6cc
BLAKE2b-256 checksum
How to use checksums
f2b3776b42ed344dc53c9d5e5d5e6d6470ba65c050a931e74a547229d459353e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 19, 2026.

Transparency log

Release files / hotkernels-0.3.1-cp312-cp312-macosx_11_0_arm64.whl

Download URL hotkernels-0.3.1-cp312-cp312-macosx_11_0_arm64.whl
Size 75.2 kB
Tags CPython 3.12 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
cce0f4ccfd49adb3e7f2d1e05ca90c3172f80d01da07f23e22bf2e7a92a26e4f
BLAKE2b-256 checksum
How to use checksums
bfe93689f22fa599767ade8060f053eb22286981415c65c28802e0cd95a5f4c7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 19, 2026.

Transparency log

Release files / hotkernels-0.3.1-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl

Download URL hotkernels-0.3.1-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Size 73.3 kB
Tags CPython 3.11 Linux glibc 2.17+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
990f0acee6a903ac73284c08fc1da1fb028b4dc80a13d34dbe16b3a780fe8be8
BLAKE2b-256 checksum
How to use checksums
dc0448813dd87ba7683a00898fdac0820bdc3d5e1b67301f9e7180f222b113d7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 19, 2026.

Transparency log

Release files / hotkernels-0.3.1-cp311-cp311-macosx_11_0_arm64.whl

Download URL hotkernels-0.3.1-cp311-cp311-macosx_11_0_arm64.whl
Size 75.1 kB
Tags CPython 3.11 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
a3532946d32d53fc7f9ff23317ee0fcc80d791504f510ae4afbe517218c78f16
BLAKE2b-256 checksum
How to use checksums
1c72c2cf937e0a591dffbd9ca215328e3661f925b1d93f07b723e5f90cffc962
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 19, 2026.

Transparency log

Security for hotkernels 0.3.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.

Full provenance

All 9 files in this release have been uploaded with provenance metadata.

Select from 9 files

Attestation for hotkernels-0.3.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 19, 2026.

Transparency log

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