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, 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.0

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.0
File Size Uploaded Provenance Actions
hotkernels-0.3.0.tar.gz 197.9 kB With provenance Details for hotkernels-0.3.0.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for hotkernels 0.3.0
File Actions
hotkernels-0.3.0-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.17+ x86-64, Linux glibc 2.28+ x86-64 Details for hotkernels-0.3.0-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
hotkernels-0.3.0-cp314-cp314-macosx_11_0_arm64.whl CPython 3.14 CPython 3.14 macOS 11.0+ ARM64 Details for hotkernels-0.3.0-cp314-cp314-macosx_11_0_arm64.whl
hotkernels-0.3.0-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.17+ x86-64, Linux glibc 2.28+ x86-64 Details for hotkernels-0.3.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
hotkernels-0.3.0-cp313-cp313-macosx_11_0_arm64.whl CPython 3.13 CPython 3.13 macOS 11.0+ ARM64 Details for hotkernels-0.3.0-cp313-cp313-macosx_11_0_arm64.whl
hotkernels-0.3.0-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.17+ x86-64, Linux glibc 2.28+ x86-64 Details for hotkernels-0.3.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
hotkernels-0.3.0-cp312-cp312-macosx_11_0_arm64.whl CPython 3.12 CPython 3.12 macOS 11.0+ ARM64 Details for hotkernels-0.3.0-cp312-cp312-macosx_11_0_arm64.whl
hotkernels-0.3.0-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.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
hotkernels-0.3.0-cp311-cp311-macosx_11_0_arm64.whl CPython 3.11 CPython 3.11 macOS 11.0+ ARM64 Details for hotkernels-0.3.0-cp311-cp311-macosx_11_0_arm64.whl

Total release size: 769.8 kB

Release files / hotkernels-0.3.0.tar.gz

Download URL hotkernels-0.3.0.tar.gz
Size 197.9 kB
Tags Source
SHA-256 checksum
How to use checksums
4871a75ecedb90723d431ada7a4b9d0f5ce42ab75ac3e55ee9117c2538cf9323
BLAKE2b-256 checksum
How to use checksums
80e1de4251b5c3cb1bc3808e208cb4186caba9bed50bbdd2b166e182e33adcf5
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.0-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl

Download URL hotkernels-0.3.0-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
30203b1d95142c9e9086ca59a6c95652ad1f23420cc2b923b42ba87bd8930d58
BLAKE2b-256 checksum
How to use checksums
d56bcd5d55693e884c9ec422e7fea3748e56062a1571ce1e5251d7abb6a0847b
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.0-cp314-cp314-macosx_11_0_arm64.whl

Download URL hotkernels-0.3.0-cp314-cp314-macosx_11_0_arm64.whl
Size 69.7 kB
Tags CPython 3.14 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
74581d0826f7d181d4771746183ea8c20fd94b9de729e48c4eb5c8bf89ce1303
BLAKE2b-256 checksum
How to use checksums
fa8966dce1f480b416e6a390be1b818de3a4123955565d0eabbb6c859d2de25e
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.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl

Download URL hotkernels-0.3.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Size 73.4 kB
Tags CPython 3.13 Linux glibc 2.17+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
eb9e92f4079070257f14e96246241bab4d7b06f15715fe97061d859f2c45f38f
BLAKE2b-256 checksum
How to use checksums
2efaa911a273c5a8349110052abeed5e387d64bfe13b7610898f94e7a8aba2da
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.0-cp313-cp313-macosx_11_0_arm64.whl

Download URL hotkernels-0.3.0-cp313-cp313-macosx_11_0_arm64.whl
Size 69.6 kB
Tags CPython 3.13 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
097c64c55d99e68e18a576116ef995408921e93a17bc28ef36ead02ae8f98619
BLAKE2b-256 checksum
How to use checksums
d2f3be9413b96d08f7bf77b06400b89ce4ca33ba769b0d49ee964eb887f75e97
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.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl

Download URL hotkernels-0.3.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Size 73.4 kB
Tags CPython 3.12 Linux glibc 2.17+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
44ad0d011482d955979a87e90e7d9449dbd67def3b658fad53793b6229401e04
BLAKE2b-256 checksum
How to use checksums
ca8165e4a11383d7cf20ee128ec12fa8e6e920102275b71abb443c69a241f7f7
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.0-cp312-cp312-macosx_11_0_arm64.whl

Download URL hotkernels-0.3.0-cp312-cp312-macosx_11_0_arm64.whl
Size 69.6 kB
Tags CPython 3.12 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
52bb9c19c374871ef0ab89a4ac86fcee4edec9f2cb38d5f9f52190df0227289e
BLAKE2b-256 checksum
How to use checksums
a4648ad60c246bfd73ef17ba61dbc4c328ee67d858575af9bff53775d5b69095
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.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl

Download URL hotkernels-0.3.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Size 73.2 kB
Tags CPython 3.11 Linux glibc 2.17+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
d1fe6d17ae399c63f2056b5ea91f7c25ead7372e659ba6f23bacc01de0313714
BLAKE2b-256 checksum
How to use checksums
4da91dee3906ffcc098f8c85c1c53575dafeb9c006529c1cfc5fd2a0ca758787
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.0-cp311-cp311-macosx_11_0_arm64.whl

Download URL hotkernels-0.3.0-cp311-cp311-macosx_11_0_arm64.whl
Size 69.6 kB
Tags CPython 3.11 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
f201df5d4aaed3737501e184333bd23a6dfa81f8adfbfc630b24093e0ee742a8
BLAKE2b-256 checksum
How to use checksums
1d084765bd78279d967c9454eb4baf7f6b9e3c03a66aa04542fa9fbbaa457208
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.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.

Select from 9 files

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