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, x[mask] (and np.compress, np.extract), x[mask] = v (and np.putmask, np.copyto(..., where=mask)), np.nonzero (and np.where(mask)), np.cumsum, x.astype(np.float32) from uint8, np.sum on uint8, np.count_nonzero, np.histogram, np.bincount, 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.
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 installsnp.cumsumonfloat32andfloat64, 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.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| hotkernels-0.2.0.tar.gz | 154.1 kB | With provenance | Details for hotkernels-0.2.0.tar.gz |
Built distributions (wheels)
Total release size: 584.5 kB
Release files / hotkernels-0.2.0.tar.gz
| Download URL | hotkernels-0.2.0.tar.gz |
|---|---|
| Size | 154.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
81b6b22c6a81513b9e07ee12d56258f9d3ae93359abe4ddddb74c9c2586eed01
|
|
BLAKE2b-256 checksum How to use checksums |
0912227e7d0cf605ab89c6e99fa8f48a819b0b331cb12a29fa8c2ef61940cf1e
|
| 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 18, 2026.
Transparency logRelease files / hotkernels-0.2.0-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
| Download URL | hotkernels-0.2.0-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 52.7 kB |
| Tags | CPython 3.14 Linux glibc 2.17+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
b9ccb1429d1ead4cbbdc830b219876a55345181000b52a5920cac2f9db6c4238
|
|
BLAKE2b-256 checksum How to use checksums |
77d83728c3a799af09d017e256996ae53098d1ae5b554602a2b6b0e905737c59
|
| 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 18, 2026.
Transparency logRelease files / hotkernels-0.2.0-cp314-cp314-macosx_11_0_arm64.whl
| Download URL | hotkernels-0.2.0-cp314-cp314-macosx_11_0_arm64.whl |
|---|---|
| Size | 55.0 kB |
| Tags | CPython 3.14 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
94db830cbf2107b30b766052e80d2809a16ec253a5b7793bb5a2cd8b1ef3012b
|
|
BLAKE2b-256 checksum How to use checksums |
e777120fdb05e0fc645b1e5f8ee8ba3aee65b42c7c9b341d66edafaab054da5f
|
| 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 18, 2026.
Transparency logRelease files / hotkernels-0.2.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
| Download URL | hotkernels-0.2.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 52.7 kB |
| Tags | CPython 3.13 Linux glibc 2.17+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
f537bad0caa3958f25791047f74ed67948266458eb93f517fb7a24fd334ce53f
|
|
BLAKE2b-256 checksum How to use checksums |
4ae1e10a4188046c57b56799d9e0d95293cd21c655293f5d98034c2eb72c5121
|
| 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 18, 2026.
Transparency logRelease files / hotkernels-0.2.0-cp313-cp313-macosx_11_0_arm64.whl
| Download URL | hotkernels-0.2.0-cp313-cp313-macosx_11_0_arm64.whl |
|---|---|
| Size | 55.0 kB |
| Tags | CPython 3.13 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
4bb991f55b3856790ce5b3949df89ef91c8870314b788eaf5774fbc3010824ba
|
|
BLAKE2b-256 checksum How to use checksums |
e20e92e544f1a5f153ae103435ab286bedc2d5dbc8ab17cd23556c1c8f5e6970
|
| 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 18, 2026.
Transparency logRelease files / hotkernels-0.2.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
| Download URL | hotkernels-0.2.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 52.7 kB |
| Tags | CPython 3.12 Linux glibc 2.17+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
a8514d594306f087210fd5d9b9c79588ca459cec78c442af527bfe0e01e7d633
|
|
BLAKE2b-256 checksum How to use checksums |
72bfa8213106365202d819b9ab87b1a8c26b0aa2fa539d1951b58d9ac3e2cc60
|
| 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 18, 2026.
Transparency logRelease files / hotkernels-0.2.0-cp312-cp312-macosx_11_0_arm64.whl
| Download URL | hotkernels-0.2.0-cp312-cp312-macosx_11_0_arm64.whl |
|---|---|
| Size | 55.0 kB |
| Tags | CPython 3.12 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
9484c9cd991a28fc1cbc12339abb94009d488e8ed10a5f598074e2318060b009
|
|
BLAKE2b-256 checksum How to use checksums |
c871d8a77325c032aecae3d72c94bccc132ae549eb6682e78e75ffe6c239f119
|
| 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 18, 2026.
Transparency logRelease files / hotkernels-0.2.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
| Download URL | hotkernels-0.2.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 52.5 kB |
| Tags | CPython 3.11 Linux glibc 2.17+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
e7ad85d04a192d94d9161f567bde9894f62fbba3d6432e93d00560dda6b7f268
|
|
BLAKE2b-256 checksum How to use checksums |
a4cc8e75c96f9d1dd5a2b42695114337f0784e62da5006c511a2e17e1cfefedb
|
| 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 18, 2026.
Transparency logRelease files / hotkernels-0.2.0-cp311-cp311-macosx_11_0_arm64.whl
| Download URL | hotkernels-0.2.0-cp311-cp311-macosx_11_0_arm64.whl |
|---|---|
| Size | 55.0 kB |
| Tags | CPython 3.11 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
a4994bb238647cbd2a69729006c96044235df4f1f927518e2a863169bffe2032
|
|
BLAKE2b-256 checksum How to use checksums |
65b17ae05b584fd4f9855dba1bf853310e447cc82a02c6ca45691c10c46330c1
|
| 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 18, 2026.
Transparency logSecurity for hotkernels 0.2.0
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.
Attestation for hotkernels-0.2.0.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 18, 2026.
Transparency logA 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.