kernox
kernox computes pairwise reductions on GPUs (Gaussian kernel sums, nearest
neighbours, log-sum-exp, softmax-weighted sums, ...) without ever building the
M×N matrix. You write the formula with symbolic variables indexed by i and
j, and kernox turns it into a single fused GPU kernel for NVIDIA (CUDA),
AMD (ROCm/HIP) or Intel (SYCL) cards. Support for other accelerators may be
added later.
kernox is a successor to PyKeOps, built on the symox symbolic engine. It works with PyTorch tensors.
- Documentation: https://keckj.github.io/kernox/
- Getting started: https://keckj.github.io/kernox/getting-started/
Why kernox
- No M×N matrix. Memory stays linear in the number of points, so each row can be reduced over millions of points.
- Three GPU vendors. One formula runs on NVIDIA, AMD and Intel GPUs.
- Formulas, not strings. Formulas are Python expressions. Derivatives are computed symbolically and run as fused reductions too.
- Predictable numerics. IEEE arithmetic by default, an explicit opt-in for
approximate
expandlog, and an explicit error instead of a silent fallback when something is not supported. - Familiar to PyKeOps users. The PyKeOps reductions and formula operations are available for PyTorch on GPUs. kernox has no NumPy interface and no CPU backend; the other differences are listed in Coming from PyKeOps.
Installation
kernox needs Python 3.10 or later, PyTorch and a supported GPU. Install PyTorch for your platform first, then kernox from PyPI (symox, its symbolic engine, comes with it as a dependency):
pip install torch --index-url https://download.pytorch.org/whl/cu126 # NVIDIA
pip install "kernox[cuda]"
python -m kernox.diagnostics --check
AMD and Intel instructions, and the details, are in Getting started.
Performance
The goal of kernox is to be at least as fast as PyKeOps wherever PyKeOps runs, and to bring the same performance to AMD and Intel GPUs, which PyKeOps does not support. On NVIDIA GPUs, kernox is already faster than PyKeOps in several cases.
LogSumExp reduction, M = N = 10⁵, FP32, on an RTX 2080 Ti; kernox with
fast_math=True, PyKeOps 2.4b in its best configuration (each kernel compiled
alone in a fresh process); median of two runs:
| Case | kernox | PyKeOps | kernox / PyKeOps |
|---|---|---|---|
| D = 2, dense | 20.1 ms | 21.9 ms | ×0.92 |
| D = 3, dense | 24.6 ms | 25.8 ms | ×0.95 |
| D = 2, block-sparse ranges | 8.4 ms | 8.9 ms | ×0.95 |
| D = 3, block-sparse ranges | 4.2 ms | 4.2 ms | ×1.01 (same within noise) |
These figures cover only the cases listed; they are not a general claim of superiority over PyKeOps on every workload or card. A case where kernox is slower than PyKeOps is treated as a bug.
Learn more
- Getting started: installation and a first reduction, step by step.
- Concepts: variables, formulas, reductions, devices and dtypes.
- How-to guides: kernel sums, nearest neighbours, log-sum-exp and Sinkhorn, gradients, linear systems and more.
- Coming from PyKeOps: a migration guide.
- Backends and hardware: what runs where, and the known limitations.
About the name and logo
symox is symbolic plus ox: a rusty ox, since symox is written in Rust. kernox is kernels plus the ox of symox, and also a nod to the redox chemistry of copper. The logo goes from orange copper (the ox) to turquoise verdigris (the trails and the compute grid), that is, from copper to its oxidation patina. And redox contains reduction, which is what kernox does: sum, min and max, as drawn in the logo.
License
At your option, MIT or Apache-2.0.
Provenance of third-party code and algorithms (KeOps, symox):
THIRD_PARTY.md.
Projects using kernox
- remblais: a faster GeomLoss (Sinkhorn divergences, kernel norms and optimal transport) on NVIDIA, AMD and Intel GPUs. Documentation: https://keckj.github.io/remblais/
Related projects
- symox, symbolic engine and code generation: https://github.com/keckj/symox
- KeOps / PyKeOps: https://github.com/getkeops/keops
Metadata
Release files for kernox 1.0.2
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 |
|---|---|---|---|---|
| kernox-1.0.2.tar.gz | 218.4 kB | With provenance | Details for kernox-1.0.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| kernox-1.0.2-py3-none-any.whl | Python 3 | none | any | Details for kernox-1.0.2-py3-none-any.whl |
Total release size: 404.6 kB
Release files / kernox-1.0.2.tar.gz
| Download URL | kernox-1.0.2.tar.gz |
|---|---|
| Size | 218.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a07fbe42b3a136c4a6009733c9a2540fae0806e0a97c7da6a7cca619a97455b6
|
|
BLAKE2b-256 checksum How to use checksums |
15d0b1c667655b7fe76304daacd06c216030bfccdfc4047b99d013a5c98af7c7
|
| 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 15, 2026.
Transparency logRelease files / kernox-1.0.2-py3-none-any.whl
| Download URL | kernox-1.0.2-py3-none-any.whl |
|---|---|
| Size | 186.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
fa6a8ff66e3b0848738148c89198d9b18de56d6930c372e059fcad170a251c98
|
|
BLAKE2b-256 checksum How to use checksums |
f1d2ca646949f461bcc799c4fb2922f8594ca662bd0886dd9a5178e020576ea2
|
| 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 15, 2026.
Transparency logSecurity for kernox 1.0.2
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
Both files in this release have been uploaded with provenance metadata.
Attestation for kernox-1.0.2.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 15, 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.