Skip to content

🐍 Geometric Computer Vision Library for Spatial AI

perf(feature): accelerate SIFT and learned local feature pipelines (#4254)

Dmytro Mishkin39ac11908f5b
diff --git a/CHANGELOG.md b/CHANGELOG.md
index a345dbba3..da63bdf5e 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -10,6 +10,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added
+* Repeatable Oxford affine local-feature benchmarks for SIFT, SIFT-AffNet-HardNet, and
+ KeyNet-HardNet, with eager/compiled median/IQR speed, homography corner error, and JSON output;
+ historical scale-space SIFT CPU/CUDA batch-runtime comparisons and plotting. (#4254)
+
* Documented bbox/Boxes geometry-operation conventions and added executable pins for transforms,
NMS, padding, clipping, and area filtering, including known unbatched-input limitations. (#4245)
@@ -267,6 +271,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Bug fixes
+* Reduce local-feature extraction overhead by accumulating orientation histograms directly,
+ batching built-in DoG extrema refinement, selecting coordinates before combining response signs,
+ and using faster activation layouts in KeyNet and CPU HardNet. Detector settings and pretrained
+ checkpoint formats are preserved. On CUDA the orientation histogram now accumulates with atomics,
+ so identical inputs can differ at the ulp level between calls unless
+ `torch.use_deterministic_algorithms(True)` is set. (#4254)
+
* Non-maxima suppression with a window larger than `(7, 7)` no longer builds a `(k*k, 1, k, k)` one-hot
convolution to gather each neighbour into its own channel. On CPU in half precision that convolution
has no vectorized kernel and falls back to `_slow_conv2d_forward`, where it accounted for 99% of a
diff --git a/benchmarks/README.md b/benchmarks/README.md
index a65890c3b..2c87d371f 100644
--- a/benchmarks/README.md
+++ b/benchmarks/README.md
@@ -12,7 +12,7 @@ baselines. Goal: current, citable numbers with disclosed methodology — where k
| [`geometry/`](geometry/) | [`flagship.py`](geometry/flagship.py): core geometry ops vs OpenCV/torchvision v2. |
| [`filters/`](filters/) | [`flagship.py`](filters/flagship.py): core filters vs OpenCV/albumentations/torchvision v2/kornia-rs/PIL. |
| [`color/`](color/) | pytest-benchmark microbenchmarks for color conversions. |
-| [`feature/`](feature/) | Local-feature detector benchmarks incl. quality (matching) metrics; [`laf_ops.py`](feature/laf_ops.py) microbenchmarks the shared LAF operations and [`ellipse_to_laf.py`](feature/ellipse_to_laf.py) drills into one of them (both base-revision A/B — no cross-library baseline exists). |
+| [`feature/`](feature/) | Local-feature detector benchmarks incl. quality (matching) metrics; [`laf_ops.py`](feature/laf_ops.py) microbenchmarks the shared LAF operations and [`ellipse_to_laf.py`](feature/ellipse_to_laf.py) drills into one of them (both base-revision A/B — no cross-library baseline exists). [`local_features.py`](feature/local_features.py) measures Oxford graf speed and homography corner error for SIFT, SIFT-AffNet-HardNet and KeyNet-HardNet on CPU, CUDA or MPS (`--device cpu --timing-pairs 2` times the representative 1–2 pair and still scores all five); results in [`graf_benchmark.md`](feature/graf_benchmark.md). [`sift_runtime.py`](feature/sift_runtime.py) and [`plot_sift_runtime.py`](feature/plot_sift_runtime.py) chart scale-space SIFT runtime across releases and batch sizes; results in [`sift_runtime.md`](feature/sift_runtime.md). |
| [`common.py`](common.py) | Shared methodology utilities — use these in every new benchmark. |
## Methodology contract
@@ -105,6 +105,20 @@ One file per run:
the docs page and the llms digest regenerate from it automatically at the next docs build
(`python docs/generate_benchmarks.py --refresh-llms` refreshes the committed digest).
+### Comparison artefacts
+
+A base-versus-branch A/B or a cross-release comparison is not a release snapshot: it records a
+revision that is by construction not the current tree, so it does not fit
+`benchmarks/results/<kornia-version>/` and does not feed the docs performance page. Keep such
+raw JSON next to the report that cites it, as `benchmarks/<area>/<name>_results/*.json`
+(for example [`feature/graf_results/`](feature/graf_results/) and
+[`feature/sift_runtime_results/`](feature/sift_runtime_results/)), named by the compared
+revision or series. CI validates them with `results_schema.validate_artefact`: the same
+envelope, metadata, privacy and row-type rules as a release snapshot, without the filename and
+version-directory rules; `load` is optional there because a base revision's harness may predate
+it. The report states what was measured, on which commits, with which command, in the style of
+the sample-results sections below.
+
## Sample results — geometry flagship ops
Directional numbers only — reproduce on your own hardware for anything you cite. Measured
diff --git a/benchmarks/feature/graf_benchmark.md b/benchmarks/feature/graf_benchmark.md
new file mode 100644
index 000000000..2d9ff19d2
--- /dev/null
+++ b/benchmarks/feature/graf_benchmark.md
@@ -0,0 +1,212 @@
+# Oxford graf local-feature benchmark
+
+Measured 2026-09-05. Base `601b5a4a` versus optimized implementation `e8e4ec0f`.
+Original 640×800 images, 4,096 requested features, grayscale float32. The first two
+sections use eager evaluation without autocast or compilation. Pyramid levels, scales, iteration budgets, descriptors,
+weights, matching threshold, and RANSAC settings are identical between revisions.
+
+## GPU speed and quality
+
+RTX 4090, PyTorch 2.14.0+cu130, Python 3.11.14, Kornia 0.9.0rc1, WSL2 Linux.
+Times include extraction of **both** images and SNN matching; they exclude image I/O
+and RANSAC. Each table entry is the mean of the five pair-specific median times.
+The JSON files retain each median and IQR. Quality is mean L1 corner reprojection
+error in pixels against the supplied homography, using the existing benchmark metric.
+
+| Pipeline | Base ms/pair | Optimized ms/pair | Speedup | Mean corner error, base → optimized |
+| --- | ---: | ---: | ---: | ---: |
+| SIFT | 215.9 | 114.5 | 1.89× | 223.640 → 223.640 |
+| SIFT–AffNet–HardNet | 269.4 | 174.1 | 1.55× | 2.183 → 2.183 |
+| KeyNet–HardNet | 131.5 | 126.9 | 1.04× | 5.638 → 5.638 |
+
+KeyNet's roughly 4% GPU gain is smaller than the observed timing spread; it is not
+strong evidence of an end-to-end GPU speedup. SIFT and SIFT–AffNet–HardNet show much
+larger improvements. Match counts, RANSAC inlier counts, and corner errors are identical
+between the two GPU runs for every pair and every pipeline.
+
+| Pair | SIFT error px | SIFT–AffNet–HardNet error px | KeyNet–HardNet error px |
+| --- | ---: | ---: | ---: |
+| 1–2 | 1.381 | 1.325 | 2.029 |
+| 1–3 | 1.506 | 1.216 | 1.428 |
+| 1–4 | 2.777 | 0.860 | 2.531 |
+| 1–5 | 507.132 | 2.624 | 3.700 |
+| 1–6 | 605.405 | 4.891 | 18.500 |
+
+Plain SIFT already fails badly on the two largest viewpoint changes, pairs 1–5 and
+1–6. The optimization preserves those failures; the large mean error is not hidden
+by averaging only successful pairs.
+
+| Pipeline | Base peak extra CUDA MiB | Optimized peak extra CUDA MiB |
+| --- | ---: | ---: |
+| SIFT | 576.0 | 665.8 |
+| SIFT–AffNet–HardNet | 1058.3 | 1058.6 |
+| KeyNet–HardNet | 1057.7 | 1057.7 |
+
+Memory is the maximum extra allocated tensor memory during an extraction-and-match
+call, above already resident images/models/outputs; it excludes RANSAC and allocator
+reserved memory. The SIFT speed improvement trades approximately 90 MiB of extra
+peak memory for fewer refinement launches.
+
+## CPU speed and quality
+
+Intel Core i7-14700K, one CPU thread. The representative 1–2 pair is timed repeatedly;
+all five pairs are still evaluated for quality. Other pairs have `null` timing fields
+in the JSON, meaning deliberately untimed. Each cell below is median ± IQR, in seconds
+for extracting and matching both images.
+
+| Pipeline | Base s/pair | Optimized s/pair | Speedup |
+| --- | ---: | ---: | ---: |
+| SIFT | 3.861 ± 0.022 | 2.856 ± 0.051 | 1.35× |
+| SIFT–AffNet–HardNet | 16.343 ± 0.145 | 12.714 ± 0.080 | 1.29× |
+| KeyNet–HardNet | 16.368 ± 0.031 | 12.887 ± 0.113 | 1.27× |
+
+CPU match counts, inlier counts, and reprojection errors are also identical between
+revisions on every pair. CPU and GPU results differ because their adaptive refinement
+backends and numerical kernels differ; compare each device against its own baseline.
+
+| Pair | SIFT error px | SIFT–AffNet–HardNet error px | KeyNet–HardNet error px |
+| --- | ---: | ---: | ---: |
+| 1–2 | 1.247 | 1.343 | 1.263 |
+| 1–3 | 1.435 | 1.227 | 1.679 |
+| 1–4 | 2.611 | 1.548 | 1.833 |
+| 1–5 | 507.037 | 1.792 | 3.658 |
+| 1–6 | 605.427 | 11.658 | 8.828 |
+
+## Apple Silicon (MPS) speed and quality
+
+Apple M1 (8 GB), macOS 26.5.1, PyTorch 2.14.0, Python 3.11.14, Kornia 0.9.0rc1. Base `1eea5835` versus optimized `f61ea9e4`, measured back to
+back on a quiet machine with the same inputs as the CPU/CUDA runs (identical `input_sha256`).
+Every pair is timed; each table entry is the mean of the five pair-specific medians, as in
+the GPU table. The MPS harness synchronizes with `torch.mps.synchronize` inside the timed
+region and evaluates RANSAC on CPU (its batched SVD aborts the process on MPS, #4201/#4204);
+RANSAC is outside the timed region, so the timings are unaffected. `peak_extra_cuda_bytes`
+is `null` on MPS.
+
+| Pipeline | Base ms/pair | Optimized ms/pair | Speedup | Mean corner error, base → optimized |
+| --- | ---: | ---: | ---: | ---: |
+| SIFT | 1787.8 | 1068.8 | 1.67× | 223.546 → 223.546 |
+| SIFT–AffNet–HardNet | 3066.7 | 2342.2 | 1.31× | 3.741 → 3.741 |
+| KeyNet–HardNet | 2109.5 | 2118.6 | 1.00× | 3.452 → 3.452 |
+
+Match counts, RANSAC inlier counts, and corner errors are identical between the two runs
+for every pair and pipeline. KeyNet–HardNet is unchanged within noise: the channels-last
+conversion is gated to CPU and CUDA, and KeyNet uses OriNet rather than the gradient
+histogram, so on MPS that pipeline sees none of the optimized code paths.
+
+| Pair | SIFT ms, base → optimized | SIFT–AffNet–HardNet ms, base → optimized | KeyNet–HardNet ms, base → optimized |
+| --- | ---: | ---: | ---: |
+| 1–2 | 1770 ± 23 → 1059 ± 10 | 3115 ± 43 → 2353 ± 31 | 2118 ± 33 → 2120 ± 17 |
+| 1–3 | 1789 ± 10 → 1062 ± 18 | 3069 ± 20 → 2344 ± 23 | 2107 ± 6 → 2122 ± 24 |
+| 1–4 | 1778 ± 6 → 1068 ± 6 | 3067 ± 4 → 2338 ± 4 | 2107 ± 6 → 2121 ± 10 |
+| 1–5 | 1791 ± 12 → 1078 ± 2 | 3046 ± 4 → 2343 ± 2 | 2107 ± 17 → 2110 ± 9 |
+| 1–6 | 1812 ± 48 → 1076 ± 10 | 3037 ± 16 → 2334 ± 10 | 2108 ± 18 → 2120 ± 9 |
+
+Median ± IQR. Corner errors per pair:
+
+| Pair | SIFT error px | SIFT–AffNet–HardNet error px | KeyNet–HardNet error px |
+| --- | ---: | ---: | ---: |
+| 1–2 | 1.247 | 1.927 | 1.263 |
+| 1–3 | 1.435 | 1.365 | 1.679 |
+| 1–4 | 2.586 | 1.961 | 1.833 |
+| 1–5 | 507.037 | 1.792 | 3.657 |
+| 1–6 | 605.427 | 11.658 | 8.828 |
+
+## Selective compilation: CUDA
+
+Base `601b5a4a` versus `fb66de1d` (the same optimized library implementation, with a
+compiled benchmark mode). The existing factory compiles the scale-space pyramid,
+response, and subpixel modules, or KeyNet response/NMS, using `dynamic=True` and
+default Inductor settings. Descriptors, orientation, affine adaptation, matching,
+and RANSAC stay eager: this is **not whole-pipeline compilation**. The workload,
+hardware, feature budgets, and quality metric are the same as the eager pair benchmark.
+
+| Pipeline | Base compiled ms/pair | Optimized compiled ms/pair | Speedup | Mean corner error, base → optimized |
+| --- | ---: | ---: | ---: | ---: |
+| SIFT | 94.64 | 71.23 | 1.33× | 223.654 → 223.654 |
+| SIFT–AffNet–HardNet | 158.27 | 132.87 | 1.19× | 2.381 → 2.381 |
+| KeyNet–HardNet | 106.01 | 105.08 | 1.01× | 5.638 → 5.638 |
+
+Entries again average the five pair-specific medians. KeyNet's difference is timing
+noise. Match counts, inliers, feature counts, and corner errors are exactly identical
+between compiled revisions for all pairs. Compilation itself changes some scale-space
+results relative to eager, so eager and compiled quality must be compared separately.
+For example, SIFT–AffNet–HardNet's mean error is 2.381 px compiled versus 2.183 px eager.
+
+Each revision started in a separate process with a fresh `TORCHINDUCTOR_CACHE_DIR`.
+Initial calls are excluded from warmup and steady-state timing, and recorded in JSON.
+SIFT's first extraction-and-match call took 43.42 s on the base and 43.38 s optimized.
+KeyNet's first call took 15.25 s and 16.84 s. SIFT–AffNet–HardNet ran after SIFT and
+reused its already compiled detector graphs: its 0.233/0.209 s initial calls are
+**not independent cold-compilation measurements**. Initial latency includes useful
+execution and initialization as well as compilation, not compiler time alone.
+
+Maximum extra CUDA allocation: SIFT 566.9 → 690.1 MiB; SIFT–AffNet–HardNet
+1058.6 → 1058.6 MiB; KeyNet–HardNet 1057.7 → 1057.7 MiB. All five per-pair
+medians/IQRs and initial-call latencies are retained in the raw files.
+
+```bash
+.venv/bin/python -m benchmarks.feature.local_features --seq /data/graf --device cuda --compile --json graf-compiled.json
+```
+
+No compiled CPU pair comparison was run. The [historical SIFT runtime chart](sift_runtime.md)
+covers CPU eager and compiled runs of the public scale-space SIFT preset at batch one, and
+CUDA batches 1, 4, and 8.
+
+## Implementation
+
+- Accumulate each gradient pixel into its two orientation bins with `scatter_add_`,
+ replacing 36 complete patch scans. Half-precision histograms accumulate in float32.
+- Batch positive and negative response refinement for the built-in subpixel modules.
+ Keep NMS neighborhoods separate, and retain separate calls for custom modules and
+ refiners with a candidate cap. The number of refinement iterations is unchanged.
+- Gather only selected coordinates before merging positive/negative results, avoiding
+ a dense three-coordinate merge over the whole octave.
+- Use channels-last float32 activations inside KeyNet's narrow convolution block on
+ CPU/CUDA, and inside HardNet on CPU. Parameter layouts and checkpoint keys stay intact.
+
+## Reproduction
+
+Data: [Oxford affine graf archive](https://www.robots.ox.ac.uk/~vgg/research/affine/det_eval_files/graf.tar.gz),
+from the [Oxford affine evaluation dataset](https://www.robots.ox.ac.uk/~vgg/research/affine/).
+Archive SHA-256: `999871b945ee968a00a0d5f9af957d1382fb9dae1511cdee9553366817b53b5b`.
+Every input image and homography hash is also recorded in the JSON metadata.
+
+```bash
+.venv/bin/python -m benchmarks.feature.local_features --seq /data/graf --device cuda --json graf-cuda.json
+.venv/bin/python -m benchmarks.feature.local_features --seq /data/graf --device cpu --timing-pairs 2 --json graf-cpu.json
+.venv/bin/python -m benchmarks.feature.local_features --seq /data/graf --device mps --json graf-mps.json
+```
+
+For the base comparison, run the same harness using `runpy.run_path` from the base
+worktree root with the primary checkout's explicit interpreter. Confirm that the
+printed `kornia.__file__` points into that base worktree, not the editable primary
+checkout. Final benchmark processes ran sequentially, without concurrent tests.
+
+The scale-space pipelines use `ScalePyramid(3, 1.6, 32, double_image=True)` with its
+three extra levels, DoG minima/maxima, `AdaptiveQuadInterp3d` defaults, and 32-pixel
+gradient orientation patches. SIFT uses `SIFTDescriptor(32, rootsift=True)`;
+SIFT–AffNet–HardNet adds pretrained AffNet before orientation and pretrained HardNet
+afterwards. KeyNet–HardNet uses the public preset with pretrained OriNet.
+SNN ratio is 0.85. Homography RANSAC uses threshold 2.0, max_iter 10, batch_size 8196,
+confidence 0.9999, and seed 3407. Model construction uses PyTorch seed 0.
+
+The harness uses `benchmarks/common.py` timing and JSON helpers. It expands the timing
+budget to at least five warmup-call durations, so a slow CPU call does not become a
+single measured sample. CPU thread count is one, matching the shared Timer. Matmul TF32 is disabled;
+cuDNN retains its default TF32 setting, recorded in the metadata.
+
+## Raw results
+
+- [Base CUDA](graf_results/base-cuda.json)
+- [Optimized CUDA](graf_results/optimized-cuda.json)
+- [Base CPU](graf_results/base-cpu.json)
+- [Optimized CPU](graf_results/optimized-cpu.json)
+- [Base selectively compiled CUDA](graf_results/base-compiled-cuda.json)
+- [Optimized selectively compiled CUDA](graf_results/optimized-compiled-cuda.json)
+- [Base MPS](graf_results/base-mps.json)
+- [Optimized MPS](graf_results/optimized-mps.json)
+
+These are local benchmark results rather than release-wide performance guarantees. The files
+are comparison artefacts in the sense of `benchmarks/README.md` and are validated by
+`results_schema.validate_artefact` in CI. They were measured before the harness recorded the
+aggregate `load` snapshot; the runs were sequential, with no concurrent workloads.
diff --git a/benchmarks/feature/graf_results/base-compiled-cuda.json b/benchmarks/feature/graf_results/base-compiled-cuda.json
new file mode 100644
index 000000000..2a6db912f
--- /dev/null
+++ b/benchmarks/feature/graf_results/base-compiled-cuda.json
@@ -0,0 +1,341 @@
+{
+ "metadata": {
+ "albumentations": null,
+ "compile": true,
+ "compile_dynamic": true,
+ "compile_scope": "scale-space pyramid/response/subpixel; KeyNet response/NMS",
+ "corner_error": "mean L1 corner distance in pixels",
+ "cuda_device": "NVIDIA GeForce RTX 4090",
+ "cuda_version": "13.0",
+ "cudnn_allow_tf32": true,
+ "cudnn_benchmark": false,
+ "device": "cuda",
+ "git_commit": "601b5a4a",
+ "input_sha256": {
+ "H1to2p": "da5bbc066c175ce7c4a4c7737e7280ec1a2dc961e5eac52e7ac1f8bf14d60838",
+ "H1to3p": "9142503a1ffcd2457cb20cd883d819a486e2fa730118781fdb213d657b674421",
+ "H1to4p": "b05c90145964f7973e77ff9b2d200fc1823b0b46b9c4e1494c8ccc7079e994e7",
+ "H1to5p": "f545eb32e909393d6bc4416197bb4004ced0aee9739c5a3c3ea6078c66bb6149",
+ "H1to6p": "d1a5f773e727d3772d6f10a1f698c1f87e479ef804f130f6422db6b7a5f2c091",
+ "img1.ppm": "8d53092ffa5b27f5138ec458302f35e7c72a9f35d1f94078ca35944c4b3626dd",
+ "img2.ppm": "d2938d6df7c15e8e032c90f9abb5f4cb5def5acbfff98cc90f9b5f259453b6a2",
+ "img3.ppm": "188ef2abda166a50ee44f023a7ef9c87d4ca349d972db1d9a3abeb2714d4021c",
+ "img4.ppm": "6b4717b18b92d6d6b69cb3c91a800067b220d0bbbf6880f2878dbcb28108f76a",
+ "img5.ppm": "f68fdfe99de81b323a8c6a2b1351affa49742c44b1b776e3d3b5ba75a383234c",
+ "img6.ppm": "a2e03ab33c4913ccecd2a5c7109b02435b5089ad664a028b51c6807d1f7cbd46"
+ },
+ "kornia": "0.9.0rc1",
+ "kornia_rs": "0.1.10",
+ "machine": "x86_64",
+ "matching_ratio": 0.85,
+ "min_run_time": 3,
+ "num_features": 4096,
+ "numpy": "2.4.0",
+ "opencv": "4.11.0",
+ "pillow": "12.3.0",
+ "platform": "Linux-6.18.33.2-microsoft-standard-WSL2-x86_64-with-glibc2.39",
+ "python": "3.11.14",
+ "ransac_seed": 3407,
+ "seed": 0,
+ "sequence": "graf",
+ "timestamp_utc": "2026-09-05T17:20:47+00:00",
+ "timing": "extract both images + SNN, excluding RANSAC and I/O",
+ "timing_pairs": [
+ 2,
+ 3,
+ 4,
+ 5,
+ 6
+ ],
+ "torch": "2.14.0+cu130",
+ "torch_num_threads": 1,
+ "torchvision": null
+ },
+ "results": [
+ {
+ "backend": "kornia (selectively compiled)",
+ "batch": 1,
+ "corner_error_px": 1.381424069404602,
+ "dtype": "float32",
+ "features1": 4096,
+ "features2": 4096,
+ "height": 640,
+ "initial_call_seconds": 43.42254302999936,
+ "inliers": 1443,
+ "iqr_us": 6409.499750589021,
+ "matches": 1857,
+ "median_us": 95484.25300090457,
+ "op": "sift",
+ "pair": "1-2",
+ "peak_extra_cuda_bytes": 594484224,
+ "throughput_per_s": 20.945862141070034,
+ "width": 800
+ },
+ {
+ "backend": "kornia (selectively compiled)",
+ "batch": 1,
+ "corner_error_px": 1.5054197311401367,
+ "dtype": "float32",
+ "features1": 4096,
+ "features2": 4096,
+ "height": 640,
+ "initial_call_seconds": 0.09429484899737872,
+ "inliers": 525,
+ "iqr_us": 9571.43799860205,
+ "matches": 969,
+ "median_us": 93006.21100010176,
+ "op": "sift",
+ "pair": "1-3",
+ "peak_extra_cuda_bytes": 594484224,
+ "throughput_per_s": 21.503940204572057,
+ "width": 800
+ },
+ {
+ "backend": "kornia (selectively compiled)",
+ "batch": 1,
+ "corner_error_px": 2.8458313941955566,
+ "dtype": "float32",
+ "features1": 4096,
+ "features2": 4096,
+ "height": 640,
+ "initial_call_seconds": 0.0927122489993053,
+ "inliers": 142,
+ "iqr_us": 14684.044499517768,
+ "matches": 392,
+ "median_us": 91767.3490002926,
+ "op": "sift",
+ "pair": "1-4",
+ "peak_extra_cuda_bytes": 594484224,
+ "throughput_per_s": 21.794244050720295,
+ "width": 800
+ },
+ {
+ "backend": "kornia (selectively compiled)",
+ "batch": 1,
+ "corner_error_px": 507.1316223144531,
+ "dtype": "float32",
+ "features1": 4096,
+ "features2": 4096,
+ "height": 640,
+ "initial_call_seconds": 0.10957057799896575,
+ "inliers": 26,
+ "iqr_us": 16060.027002822608,
+ "matches": 228,
+ "median_us": 97234.7240021918,
+ "op": "sift",
+ "pair": "1-5",
+ "peak_extra_cuda_bytes": 594484224,
+ "throughput_per_s": 20.568783636953786,
+ "width": 800
+ },
+ {
+ "backend": "kornia (selectively compiled)",
+ "batch": 1,
+ "corner_error_px": 605.405029296875,
+ "dtype": "float32",
+ "features1": 4096,
+ "features2": 4096,
+ "height": 640,
+ "initial_call_seconds": 0.0887485889979871,
+ "inliers": 26,
+ "iqr_us": 14938.458250981057,
+ "matches": 165,
+ "median_us": 95726.20350081706,
+ "op": "sift",
+ "pair": "1-6",
+ "peak_extra_cuda_bytes": 594484224,
+ "throughput_per_s": 20.892920922983528,
+ "width": 800
+ },
+ {
+ "backend": "kornia (selectively compiled)",
+ "batch": 1,
+ "corner_error_px": 1.4250712394714355,
+ "dtype": "float32",
+ "features1": 4096,
+ "features2": 4096,
+ "height": 640,
+ "initial_call_seconds": 0.2331894849994569,
+ "inliers": 1315,
+ "iqr_us": 10063.068501040107,
+ "matches": 1637,
+ "median_us": 157405.77900214703,
+ "op": "sift_affnet_hardnet",
+ "pair": "1-2",
+ "peak_extra_cuda_bytes": 1110053376,
+ "throughput_per_s": 12.706013798722852,
+ "width": 800
+ },
+ {
+ "backend": "kornia (selectively compiled)",
+ "batch": 1,
+ "corner_error_px": 1.1573638916015625,
+ "dtype": "float32",
+ "features1": 4096,
+ "features2": 4096,
+ "height": 640,
+ "initial_call_seconds": 0.1531568860009429,
+ "inliers": 688,
+ "iqr_us": 11348.530499162734,
+ "matches": 1177,
+ "median_us": 156309.29100007052,
+ "op": "sift_affnet_hardnet",
+ "pair": "1-3",
+ "peak_extra_cuda_bytes": 1110053376,
+ "throughput_per_s": 12.795144723669035,
+ "width": 800
+ },
+ {
+ "backend": "kornia (selectively compiled)",
+ "batch": 1,
+ "corner_error_px": 1.8060579299926758,
+ "dtype": "float32",
+ "features1": 4096,
+ "features2": 4096,
+ "height": 640,
+ "initial_call_seconds": 0.15826402799939387,
+ "inliers": 385,
+ "iqr_us": 16444.219998447807,
+ "matches": 717,
+ "median_us": 163480.4390014324,
+ "op": "sift_affnet_hardnet",
+ "pair": "1-4",
+ "peak_extra_cuda_bytes": 1110053376,
+ "throughput_per_s": 12.23387955290771,
+ "width": 800
+ },
+ {
+ "backend": "kornia (selectively compiled)",
+ "batch": 1,
+ "corner_error_px": 2.6236982345581055,
+ "dtype": "float32",
+ "features1": 4096,
+ "features2": 4096,
+ "height": 640,
+ "initial_call_seconds": 0.14472477000163053,
+ "inliers": 158,
+ "iqr_us": 12834.499000746291,
+ "matches": 343,
+ "median_us": 158363.90299955383,
+ "op": "sift_affnet_hardnet",
+ "pair": "1-5",
+ "peak_extra_cuda_bytes": 1110053376,
+ "throughput_per_s": 12.629140619283895,
+ "width": 800
+ },
+ {
+ "backend": "kornia (selectively compiled)",
+ "batch": 1,
+ "corner_error_px": 4.891265869140625,
+ "dtype": "float32",
+ "features1": 4096,
+ "features2": 4096,
+ "height": 640,
+ "initial_call_seconds": 0.14599923700006912,
+ "inliers": 48,
+ "iqr_us": 17855.207501270343,
+ "matches": 190,
+ "median_us": 155803.63199842395,
+ "op": "sift_affnet_hardnet",
+ "pair": "1-6",
+ "peak_extra_cuda_bytes": 1110053376,
+ "throughput_per_s": 12.83667122740907,
+ "width": 800
+ },
+ {
+ "backend": "kornia (selectively compiled)",
+ "batch": 1,
+ "corner_error_px": 2.0286834239959717,
+ "dtype": "float32",
+ "features1": 2912,
+ "features2": 3064,
+ "height": 640,
+ "initial_call_seconds": 15.251519237001048,
+ "inliers": 1107,
+ "iqr_us": 9606.269499272457,
+ "matches": 1600,
+ "median_us": 107242.06550185045,
+ "op": "keynet_hardnet",
+ "pair": "1-2",
+ "peak_extra_cuda_bytes": 1109120000,
+ "throughput_per_s": 18.64939835540085,
+ "width": 800
+ },
+ {
+ "backend": "kornia (selectively compiled)",
+ "batch": 1,
+ "corner_error_px": 1.4283819198608398,
+ "dtype": "float32",
+ "features1": 2912,
+ "features2": 3427,
+ "height": 640,
+ "initial_call_seconds": 0.10515358300108346,
+ "inliers": 732,
+ "iqr_us": 7889.19274964428,
+ "matches": 1222,
+ "median_us": 108653.7880000833,
+ "op": "keynet_hardnet",
+ "pair": "1-3",
+ "peak_extra_cuda_bytes": 1109120000,
+ "throughput_per_s": 18.407089497868835,
+ "width": 800
+ },
+ {
+ "backend": "kornia (selectively compiled)",
+ "batch": 1,
+ "corner_error_px": 2.531064033508301,
+ "dtype": "float32",
+ "features1": 2912,
+ "features2": 3410,
+ "height": 640,
+ "initial_call_seconds": 0.10704472399811493,
+ "inliers": 266,
+ "iqr_us": 6980.662001296878,
+ "matches": 539,
+ "median_us": 106187.34899981064,
+ "op": "keynet_hardnet",
+ "pair": "1-4",
+ "peak_extra_cuda_bytes": 1109120000,
+ "throughput_per_s": 18.83463537641915,
+ "width": 800
+ },
+ {
+ "backend": "kornia (selectively compiled)",
+ "batch": 1,
+ "corner_error_px": 3.699866771697998,
+ "dtype": "float32",
+ "features1": 2912,
+ "features2": 3832,
+ "height": 640,
+ "initial_call_seconds": 0.10916313600318972,
+ "inliers": 70,
+ "iqr_us": 3508.5310009890236,
+ "matches": 199,
+ "median_us": 104477.68100129906,
+ "op": "keynet_hardnet",
+ "pair": "1-5",
+ "peak_extra_cuda_bytes": 1109120000,
+ "throughput_per_s": 19.142844489198914,
+ "width": 800
+ },
+ {
+ "backend": "kornia (selectively compiled)",
+ "batch": 1,
+ "corner_error_px": 18.499649047851562,
+ "dtype": "float32",
+ "features1": 2912,
+ "features2": 3830,
+ "height": 640,
+ "initial_call_seconds": 0.10349508600120316,
+ "inliers": 14,
+ "iqr_us": 3351.8550008011516,
+ "matches": 64,
+ "median_us": 103485.09500181535,
+ "op": "keynet_hardnet",
+ "pair": "1-6",
+ "peak_extra_cuda_bytes": 1109120000,
+ "throughput_per_s": 19.32645469345045,
+ "width": 800
+ }
+ ]
+}
diff --git a/benchmarks/feature/graf_results/base-cpu.json b/benchmarks/feature/graf_results/base-cpu.json
new file mode 100644
index 000000000..820fc84bb
--- /dev/null
+++ b/benchmarks/feature/graf_results/base-cpu.json
@@ -0,0 +1,317 @@
+{
+ "metadata": {
+ "albumentations": null,
+ "corner_error": "mean L1 corner distance in pixels",
+ "cudnn_allow_tf32": true,
+ "cudnn_benchmark": false,
+ "device": "cpu",
+ "git_commit": "601b5a4a",
+ "input_sha256": {
+ "H1to2p": "da5bbc066c175ce7c4a4c7737e7280ec1a2dc961e5eac52e7ac1f8bf14d60838",
+ "H1to3p": "9142503a1ffcd2457cb20cd883d819a486e2fa730118781fdb213d657b674421",
+ "H1to4p": "b05c90145964f7973e77ff9b2d200fc1823b0b46b9c4e1494c8ccc7079e994e7",
+ "H1to5p": "f545eb32e909393d6bc4416197bb4004ced0aee9739c5a3c3ea6078c66bb6149",
+ "H1to6p": "d1a5f773e727d3772d6f10a1f698c1f87e479ef804f130f6422db6b7a5f2c091",
+ "img1.ppm": "8d53092ffa5b27f5138ec458302f35e7c72a9f35d1f94078ca35944c4b3626dd",
+ "img2.ppm": "d2938d6df7c15e8e032c90f9abb5f4cb5def5acbfff98cc90f9b5f259453b6a2",
+ "img3.ppm": "188ef2abda166a50ee44f023a7ef9c87d4ca349d972db1d9a3abeb2714d4021c",
+ "img4.ppm": "6b4717b18b92d6d6b69cb3c91a800067b220d0bbbf6880f2878dbcb28108f76a",
+ "img5.ppm": "f68fdfe99de81b323a8c6a2b1351affa49742c44b1b776e3d3b5ba75a383234c",
+ "img6.ppm": "a2e03ab33c4913ccecd2a5c7109b02435b5089ad664a028b51c6807d1f7cbd46"
+ },
+ "kornia": "0.9.0rc1",
+ "kornia_rs": "0.1.10",
+ "machine": "x86_64",
+ "matching_ratio": 0.85,
+ "min_run_time": 3.0,
+ "num_features": 4096,
+ "numpy": "2.4.0",
+ "opencv": "4.11.0",
+ "pillow": "12.3.0",
+ "platform": "Linux-6.18.33.2-microsoft-standard-WSL2-x86_64-with-glibc2.39",
+ "python": "3.11.14",
+ "ransac_seed": 3407,
+ "seed": 0,
+ "sequence": "graf",
+ "timestamp_utc": "2026-09-05T14:09:59+00:00",
+ "timing": "extract both images + SNN, excluding RANSAC and I/O",
+ "timing_pairs": [
+ 2
+ ],
+ "torch": "2.14.0+cu130",
+ "torch_num_threads": 1,
+ "torchvision": null
+ },
+ "results": [
+ {
+ "backend": "kornia (eager)",
+ "batch": 1,
+ "corner_error_px": 1.2472425699234009,
+ "dtype": "float32",
+ "features1": 4096,
+ "features2": 4096,
+ "height": 640,
+ "inliers": 1473,
+ "iqr_us": 21896.34025125997,
+ "matches": 1857,
+ "median_us": 3860686.2955002724,
+ "op": "sift",
+ "pair": "1-2",
+ "peak_extra_cuda_bytes": null,
+ "throughput_per_s": 0.5180426087276375,
+ "width": 800
+ },
+ {
+ "backend": "kornia (eager)",
+ "batch": 1,
+ "corner_error_px": 1.4351511001586914,
+ "dtype": "float32",
+ "features1": 4096,
+ "features2": 4096,
+ "height": 640,
+ "inliers": 522,
+ "iqr_us": null,
+ "matches": 969,
+ "median_us": null,
+ "op": "sift",
+ "pair": "1-3",
+ "peak_extra_cuda_bytes": null,
+ "throughput_per_s": null,
+ "width": 800
+ },
+ {
+ "backend": "kornia (eager)",
+ "batch": 1,
+ "corner_error_px": 2.6106362342834473,
+ "dtype": "float32",
+ "features1": 4096,
+ "features2": 4096,
+ "height": 640,
+ "inliers": 143,
+ "iqr_us": null,
+ "matches": 391,
+ "median_us": null,
+ "op": "sift",
+ "pair": "1-4",
+ "peak_extra_cuda_bytes": null,
+ "throughput_per_s": null,
+ "width": 800
+ },
+ {
+ "backend": "kornia (eager)",
+ "batch": 1,
+ "corner_error_px": 507.036865234375,
+ "dtype": "float32",
+ "features1": 4096,
+ "features2": 4096,
+ "height": 640,
+ "inliers": 27,
+ "iqr_us": null,
+ "matches": 228,
+ "median_us": null,
+ "op": "sift",
+ "pair": "1-5",
+ "peak_extra_cuda_bytes": null,
+ "throughput_per_s": null,
+ "width": 800
+ },
+ {
+ "backend": "kornia (eager)",
+ "batch": 1,
+ "corner_error_px": 605.4273071289062,
+ "dtype": "float32",
+ "features1": 4096,
+ "features2": 4096,
+ "height": 640,
+ "inliers": 26,
+ "iqr_us": null,
+ "matches": 165,
+ "median_us": null,
+ "op": "sift",
+ "pair": "1-6",
+ "peak_extra_cuda_bytes": null,
+ "throughput_per_s": null,
+ "width": 800
+ },
+ {
+ "backend": "kornia (eager)",
+ "batch": 1,
+ "corner_error_px": 1.343464970588684,
+ "dtype": "float32",
+ "features1": 4096,
+ "features2": 4096,
+ "height": 640,
+ "inliers": 1294,
+ "iqr_us": 144900.2292492878,
+ "matches": 1636,
+ "median_us": 16343259.125500482,
+ "op": "sift_affnet_hardnet",
+ "pair": "1-2",
+ "peak_extra_cuda_bytes": null,
+ "throughput_per_s": 0.12237461234885448,
+ "width": 800
+ },
+ {
+ "backend": "kornia (eager)",
+ "batch": 1,
+ "corner_error_px": 1.2266035079956055,
+ "dtype": "float32",
+ "features1": 4096,
+ "features2": 4096,
+ "height": 640,
+ "inliers": 685,
+ "iqr_us": null,
+ "matches": 1176,
+ "median_us": null,
+ "op": "sift_affnet_hardnet",
+ "pair": "1-3",
+ "peak_extra_cuda_bytes": null,
+ "throughput_per_s": null,
+ "width": 800
+ },
+ {
+ "backend": "kornia (eager)",
+ "batch": 1,
+ "corner_error_px": 1.5475249290466309,
+ "dtype": "float32",
+ "features1": 4096,
+ "features2": 4096,
+ "height": 640,
+ "inliers": 389,
+ "iqr_us": null,
+ "matches": 716,
+ "median_us": null,
+ "op": "sift_affnet_hardnet",
+ "pair": "1-4",
+ "peak_extra_cuda_bytes": null,
+ "throughput_per_s": null,
+ "width": 800
+ },
+ {
+ "backend": "kornia (eager)",
+ "batch": 1,
+ "corner_error_px": 1.7917404174804688,
+ "dtype": "float32",
+ "features1": 4096,
+ "features2": 4096,
+ "height": 640,
+ "inliers": 163,
+ "iqr_us": null,
+ "matches": 343,
+ "median_us": null,
+ "op": "sift_affnet_hardnet",
+ "pair": "1-5",
+ "peak_extra_cuda_bytes": null,
+ "throughput_per_s": null,
+ "width": 800
+ },
+ {
+ "backend": "kornia (eager)",
+ "batch": 1,
+ "corner_error_px": 11.65833854675293,
+ "dtype": "float32",
+ "features1": 4096,
+ "features2": 4096,
+ "height": 640,
+ "inliers": 41,
+ "iqr_us": null,
+ "matches": 190,
+ "median_us": null,
+ "op": "sift_affnet_hardnet",
+ "pair": "1-6",
+ "peak_extra_cuda_bytes": null,
+ "throughput_per_s": null,
+ "width": 800
+ },
+ {
+ "backend": "kornia (eager)",
+ "batch": 1,
+ "corner_error_px": 1.2629008293151855,
+ "dtype": "float32",
+ "features1": 2911,
+ "features2": 3064,
+ "height": 640,
+ "inliers": 1101,
+ "iqr_us": 31360.908246824692,
+ "matches": 1601,
+ "median_us": 16368097.78099814,
+ "op": "keynet_hardnet",
+ "pair": "1-2",
+ "peak_extra_cuda_bytes": null,
+ "throughput_per_s": 0.12218890837283587,
+ "width": 800
+ },
+ {
+ "backend": "kornia (eager)",
+ "batch": 1,
+ "corner_error_px": 1.6788702011108398,
+ "dtype": "float32",
+ "features1": 2911,
+ "features2": 3426,
+ "height": 640,
+ "inliers": 732,
+ "iqr_us": null,
+ "matches": 1222,
+ "median_us": null,
+ "op": "keynet_hardnet",
+ "pair": "1-3",
+ "peak_extra_cuda_bytes": null,
+ "throughput_per_s": null,
+ "width": 800
+ },
+ {
+ "backend": "kornia (eager)",
+ "batch": 1,
+ "corner_error_px": 1.8329229354858398,
+ "dtype": "float32",
+ "features1": 2911,
+ "features2": 3409,
+ "height": 640,
+ "inliers": 266,
+ "iqr_us": null,
+ "matches": 534,
+ "median_us": null,
+ "op": "keynet_hardnet",
+ "pair": "1-4",
+ "peak_extra_cuda_bytes": null,
+ "throughput_per_s": null,
+ "width": 800
+ },
+ {
+ "backend": "kornia (eager)",
+ "batch": 1,
+ "corner_error_px": 3.657532215118408,
+ "dtype": "float32",
+ "features1": 2911,
+ "features2": 3832,
+ "height": 640,
+ "inliers": 75,
+ "iqr_us": null,
+ "matches": 199,
+ "median_us": null,
+ "op": "keynet_hardnet",
+ "pair": "1-5",
+ "peak_extra_cuda_bytes": null,
+ "throughput_per_s": null,
+ "width": 800
+ },
+ {
+ "backend": "kornia (eager)",
+ "batch": 1,
+ "corner_error_px": 8.82778549194336,
+ "dtype": "float32",
+ "features1": 2911,
+ "features2": 3831,
+ "height": 640,
+ "inliers": 12,
+ "iqr_us": null,
+ "matches": 63,
+ "median_us": null,
+ "op": "keynet_hardnet",
+ "pair": "1-6",
+ "peak_extra_cuda_bytes": null,
+ "throughput_per_s": null,
+ "width": 800
+ }
+ ]
+}
diff --git a/benchmarks/feature/graf_results/base-cuda.json b/benchmarks/feature/graf_results/base-cuda.json
new file mode 100644
index 000000000..0f0f5c1ef
--- /dev/null
+++ b/benchmarks/feature/graf_results/base-cuda.json
@@ -0,0 +1,323 @@
+{
+ "metadata": {
+ "albumentations": null,
+ "corner_error": "mean L1 corner distance in pixels",
+ "cuda_device": "NVIDIA GeForce RTX 4090",
+ "cuda_version": "13.0",
+ "cudnn_allow_tf32": true,
+ "cudnn_benchmark": false,
+ "device": "cuda",
+ "git_commit": "601b5a4a",
+ "input_sha256": {
+ "H1to2p": "da5bbc066c175ce7c4a4c7737e7280ec1a2dc961e5eac52e7ac1f8bf14d60838",
+ "H1to3p": "9142503a1ffcd2457cb20cd883d819a486e2fa730118781fdb213d657b674421",
+ "H1to4p": "b05c90145964f7973e77ff9b2d200fc1823b0b46b9c4e1494c8ccc7079e994e7",
+ "H1to5p": "f545eb32e909393d6bc4416197bb4004ced0aee9739c5a3c3ea6078c66bb6149",
+ "H1to6p": "d1a5f773e727d3772d6f10a1f698c1f87e479ef804f130f6422db6b7a5f2c091",
+ "img1.ppm": "8d53092ffa5b27f5138ec458302f35e7c72a9f35d1f94078ca35944c4b3626dd",
+ "img2.ppm": "d2938d6df7c15e8e032c90f9abb5f4cb5def5acbfff98cc90f9b5f259453b6a2",
+ "img3.ppm": "188ef2abda166a50ee44f023a7ef9c87d4ca349d972db1d9a3abeb2714d4021c",
+ "img4.ppm": "6b4717b18b92d6d6b69cb3c91a800067b220d0bbbf6880f2878dbcb28108f76a",
+ "img5.ppm": "f68fdfe99de81b323a8c6a2b1351affa49742c44b1b776e3d3b5ba75a383234c",
+ "img6.ppm": "a2e03ab33c4913ccecd2a5c7109b02435b5089ad664a028b51c6807d1f7cbd46"
+ },
+ "kornia": "0.9.0rc1",
+ "kornia_rs": "0.1.10",
+ "machine": "x86_64",
+ "matching_ratio": 0.85,
+ "min_run_time": 3.0,
+ "num_features": 4096,
+ "numpy": "2.4.0",
+ "opencv": "4.11.0",
+ "pillow": "12.3.0",
+ "platform": "Linux-6.18.33.2-microsoft-standard-WSL2-x86_64-with-glibc2.39",
+ "python": "3.11.14",
+ "ransac_seed": 3407,
+ "seed": 0,
+ "sequence": "graf",
+ "timestamp_utc": "2026-09-05T14:05:10+00:00",
+ "timing": "extract both images + SNN, excluding RANSAC and I/O",
+ "timing_pairs": [
+ 2,
+ 3,
+ 4,
+ 5,
+ 6
+ ],
+ "torch": "2.14.0+cu130",
+ "torch_num_threads": 1,
+ "torchvision": null
+ },
+ "results": [
+ {
+ "backend": "kornia (eager)",
+ "batch": 1,
+ "corner_error_px": 1.3814700841903687,
+ "dtype": "float32",
+ "features1": 4096,
+ "features2": 4096,
+ "height": 640,
+ "inliers": 1443,
+ "iqr_us": 32030.762250542466,
+ "matches": 1857,
+ "median_us": 223719.6745008987,
+ "op": "sift",
+ "pair": "1-2",
+ "peak_extra_cuda_bytes": 603986944,
+ "throughput_per_s": 8.939759118020556,
+ "width": 800
+ },
+ {
+ "backend": "kornia (eager)",
+ "batch": 1,
+ "corner_error_px": 1.505549430847168,
+ "dtype": "float32",
+ "features1": 4096,
+ "features2": 4096,
+ "height": 640,
+ "inliers": 525,
+ "iqr_us": 24596.849249974184,
+ "matches": 969,
+ "median_us": 222677.8194999497,
+ "op": "sift",
+ "pair": "1-3",
+ "peak_extra_cuda_bytes": 595467264,
+ "throughput_per_s": 8.981586062281574,
+ "width": 800
+ },
+ {
+ "backend": "kornia (eager)",
+ "batch": 1,
+ "corner_error_px": 2.7768054008483887,
+ "dtype": "float32",
+ "features1": 4096,
+ "features2": 4096,
+ "height": 640,
+ "inliers": 145,
+ "iqr_us": 32927.37349966046,
+ "matches": 391,
+ "median_us": 201389.58700044896,
+ "op": "sift",
+ "pair": "1-4",
+ "peak_extra_cuda_bytes": 595467264,
+ "throughput_per_s": 9.931000057096007,
+ "width": 800
+ },
+ {
+ "backend": "kornia (eager)",
+ "batch": 1,
+ "corner_error_px": 507.1316223144531,
+ "dtype": "float32",
+ "features1": 4096,
+ "features2": 4096,
+ "height": 640,
+ "inliers": 26,
+ "iqr_us": 33032.751498467405,
+ "matches": 228,
+ "median_us": 213483.49549953127,
+ "op": "sift",
+ "pair": "1-5",
+ "peak_extra_cuda_bytes": 595467264,
+ "throughput_per_s": 9.368405718297746,
+ "width": 800
+ },
+ {
+ "backend": "kornia (eager)",
+ "batch": 1,
+ "corner_error_px": 605.405029296875,
+ "dtype": "float32",
+ "features1": 4096,
+ "features2": 4096,
+ "height": 640,
+ "inliers": 26,
+ "iqr_us": 32180.993749534537,
+ "matches": 165,
+ "median_us": 218442.87000021723,
+ "op": "sift",
+ "pair": "1-6",
+ "peak_extra_cuda_bytes": 595467264,
+ "throughput_per_s": 9.155711971729776,
+ "width": 800
+ },
+ {
+ "backend": "kornia (eager)",
+ "batch": 1,
+ "corner_error_px": 1.3246439695358276,
+ "dtype": "float32",
+ "features1": 4096,
+ "features2": 4096,
+ "height": 640,
+ "inliers": 1301,
+ "iqr_us": 24599.22900015954,
+ "matches": 1636,
+ "median_us": 278160.05400018184,
+ "op": "sift_affnet_hardnet",
+ "pair": "1-2",
+ "peak_extra_cuda_bytes": 1109758464,
+ "throughput_per_s": 7.190105017734475,
+ "width": 800
+ },
+ {
+ "backend": "kornia (eager)",
+ "batch": 1,
+ "corner_error_px": 1.215592384338379,
+ "dtype": "float32",
+ "features1": 4096,
+ "features2": 4096,
+ "height": 640,
+ "inliers": 685,
+ "iqr_us": 30513.6009983471,
+ "matches": 1176,
+ "median_us": 266582.4369996699,
+ "op": "sift_affnet_hardnet",
+ "pair": "1-3",
+ "peak_extra_cuda_bytes": 1109758464,
+ "throughput_per_s": 7.502369707883181,
+ "width": 800
+ },
+ {
+ "backend": "kornia (eager)",
+ "batch": 1,
+ "corner_error_px": 0.8598418235778809,
+ "dtype": "float32",
+ "features1": 4096,
+ "features2": 4096,
+ "height": 640,
+ "inliers": 384,
+ "iqr_us": 23752.627247631608,
+ "matches": 716,
+ "median_us": 269528.12100171286,
+ "op": "sift_affnet_hardnet",
+ "pair": "1-4",
+ "peak_extra_cuda_bytes": 1109758464,
+ "throughput_per_s": 7.420375998492899,
+ "width": 800
+ },
+ {
+ "backend": "kornia (eager)",
+ "batch": 1,
+ "corner_error_px": 2.6237640380859375,
+ "dtype": "float32",
+ "features1": 4096,
+ "features2": 4096,
+ "height": 640,
+ "inliers": 158,
+ "iqr_us": 43317.84050009446,
+ "matches": 343,
+ "median_us": 261790.54300155258,
+ "op": "sift_affnet_hardnet",
+ "pair": "1-5",
+ "peak_extra_cuda_bytes": 1109758464,
+ "throughput_per_s": 7.639695372755076,
+ "width": 800
+ },
+ {
+ "backend": "kornia (eager)",
+ "batch": 1,
+ "corner_error_px": 4.890989303588867,
+ "dtype": "float32",
+ "features1": 4096,
+ "features2": 4096,
+ "height": 640,
+ "inliers": 48,
+ "iqr_us": 19285.922002381994,
+ "matches": 190,
+ "median_us": 271007.0309985895,
+ "op": "sift_affnet_hardnet",
+ "pair": "1-6",
+ "peak_extra_cuda_bytes": 1109758464,
+ "throughput_per_s": 7.379882332316351,
+ "width": 800
+ },
+ {
+ "backend": "kornia (eager)",
+ "batch": 1,
+ "corner_error_px": 2.0286834239959717,
+ "dtype": "float32",
+ "features1": 2912,
+ "features2": 3064,
+ "height": 640,
+ "inliers": 1107,
+ "iqr_us": 11300.918999040732,
+ "matches": 1600,
+ "median_us": 129784.45499902591,
+ "op": "keynet_hardnet",
+ "pair": "1-2",
+ "peak_extra_cuda_bytes": 1109120000,
+ "throughput_per_s": 15.410166032711782,
+ "width": 800
+ },
+ {
+ "backend": "kornia (eager)",
+ "batch": 1,
+ "corner_error_px": 1.4283819198608398,
+ "dtype": "float32",
+ "features1": 2912,
+ "features2": 3427,
+ "height": 640,
+ "inliers": 732,
+ "iqr_us": 11857.967501782696,
+ "matches": 1222,
+ "median_us": 128719.39499746077,
+ "op": "keynet_hardnet",
+ "pair": "1-3",
+ "peak_extra_cuda_bytes": 1109120000,
+ "throughput_per_s": 15.53767402371223,
+ "width": 800
+ },
+ {
+ "backend": "kornia (eager)",
+ "batch": 1,
+ "corner_error_px": 2.531064033508301,
+ "dtype": "float32",
+ "features1": 2912,
+ "features2": 3410,
+ "height": 640,
+ "inliers": 266,
+ "iqr_us": 16923.031997066573,
+ "matches": 539,
+ "median_us": 136152.4259991711,
+ "op": "keynet_hardnet",
+ "pair": "1-4",
+ "peak_extra_cuda_bytes": 1109120000,
+ "throughput_per_s": 14.689418754919402,
+ "width": 800
+ },
+ {
+ "backend": "kornia (eager)",
+ "batch": 1,
+ "corner_error_px": 3.699866771697998,
+ "dtype": "float32",
+ "features1": 2912,
+ "features2": 3832,
+ "height": 640,
+ "inliers": 70,
+ "iqr_us": 11423.193000155152,
+ "matches": 199,
+ "median_us": 125763.79999882192,
+ "op": "keynet_hardnet",
+ "pair": "1-5",
+ "peak_extra_cuda_bytes": 1109120000,
+ "throughput_per_s": 15.902827363825956,
+ "width": 800
+ },
+ {
+ "backend": "kornia (eager)",
+ "batch": 1,
+ "corner_error_px": 18.499649047851562,
+ "dtype": "float32",
+ "features1": 2912,
+ "features2": 3830,
+ "height": 640,
+ "inliers": 14,
+ "iqr_us": 18750.405749415222,
+ "matches": 64,
+ "median_us": 136921.50300084904,
+ "op": "keynet_hardnet",
+ "pair": "1-6",
+ "peak_extra_cuda_bytes": 1109120000,
+ "throughput_per_s": 14.606909478546974,
+ "width": 800
+ }
+ ]
+}
diff --git a/benchmarks/feature/graf_results/base-mps.json b/benchmarks/feature/graf_results/base-mps.json
new file mode 100644
index 000000000..bacc5c7e9
--- /dev/null
+++ b/benchmarks/feature/graf_results/base-mps.json
@@ -0,0 +1,340 @@
+{
+ "metadata": {
+ "albumentations": null,
+ "compile": false,
+ "compile_dynamic": null,
+ "compile_scope": null,
+ "corner_error": "mean L1 corner distance in pixels",
+ "cudnn_allow_tf32": true,
+ "cudnn_benchmark": false,
+ "device": "mps",
+ "git_commit": "1eea5835",
+ "input_sha256": {
+ "H1to2p": "da5bbc066c175ce7c4a4c7737e7280ec1a2dc961e5eac52e7ac1f8bf14d60838",
+ "H1to3p": "9142503a1ffcd2457cb20cd883d819a486e2fa730118781fdb213d657b674421",
+ "H1to4p": "b05c90145964f7973e77ff9b2d200fc1823b0b46b9c4e1494c8ccc7079e994e7",
+ "H1to5p": "f545eb32e909393d6bc4416197bb4004ced0aee9739c5a3c3ea6078c66bb6149",
+ "H1to6p": "d1a5f773e727d3772d6f10a1f698c1f87e479ef804f130f6422db6b7a5f2c091",
+ "img1.ppm": "8d53092ffa5b27f5138ec458302f35e7c72a9f35d1f94078ca35944c4b3626dd",
+ "img2.ppm": "d2938d6df7c15e8e032c90f9abb5f4cb5def5acbfff98cc90f9b5f259453b6a2",
+ "img3.ppm": "188ef2abda166a50ee44f023a7ef9c87d4ca349d972db1d9a3abeb2714d4021c",
+ "img4.ppm": "6b4717b18b92d6d6b69cb3c91a800067b220d0bbbf6880f2878dbcb28108f76a",
+ "img5.ppm": "f68fdfe99de81b323a8c6a2b1351affa49742c44b1b776e3d3b5ba75a383234c",
+ "img6.ppm": "a2e03ab33c4913ccecd2a5c7109b02435b5089ad664a028b51c6807d1f7cbd46"
+ },
+ "kornia": "0.9.0rc1",
+ "kornia_rs": "0.1.10",
+ "machine": "arm64",
+ "matching_ratio": 0.85,
+ "min_run_time": 5.0,
+ "num_features": 4096,
+ "numpy": "2.4.0",
+ "opencv": "4.11.0",
+ "pillow": "12.3.0",
+ "platform": "macOS-26.5.1-arm64-arm-64bit",
+ "python": "3.11.14",
+ "ransac_device": "cpu",
+ "ransac_seed": 3407,
+ "seed": 0,
+ "sequence": "graf",
+ "timestamp_utc": "2026-09-05T18:38:01+00:00",
+ "timing": "extract both images + SNN, excluding RANSAC and I/O",
+ "timing_pairs": [
+ 2,
+ 3,
+ 4,
+ 5,
+ 6
+ ],
+ "torch": "2.14.0",
+ "torch_num_threads": 1,
+ "torchvision": null
+ },
+ "results": [
+ {
+ "backend": "kornia (eager)",
+ "batch": 1,
+ "corner_error_px": 1.2472444772720337,
+ "dtype": "float32",
+ "features1": 4096,
+ "features2": 4096,
+ "height": 640,
+ "initial_call_seconds": null,
+ "inliers": 1473,
+ "iqr_us": 22948.957000153314,
+ "matches": 1857,
+ "median_us": 1770119.7080004932,
+ "op": "sift",
+ "pair": "1-2",
+ "peak_extra_cuda_bytes": null,
+ "throughput_per_s": 1.1298670880621835,
+ "width": 800
+ },
+ {
+ "backend": "kornia (eager)",
+ "batch": 1,
+ "corner_error_px": 1.434676170349121,
+ "dtype": "float32",
+ "features1": 4096,
+ "features2": 4096,
+ "height": 640,
+ "initial_call_seconds": null,
+ "inliers": 522,
+ "iqr_us": 10281.708000547951,
+ "matches": 969,
+ "median_us": 1788762.0000001334,
+ "op": "sift",
+ "pair": "1-3",
+ "peak_extra_cuda_bytes": null,
+ "throughput_per_s": 1.1180917304816689,
+ "width": 800
+ },
+ {
+ "backend": "kornia (eager)",
+ "batch": 1,
+ "corner_error_px": 2.5855250358581543,
+ "dtype": "float32",
+ "features1": 4096,
+ "features2": 4096,
+ "height": 640,
+ "initial_call_seconds": null,
+ "inliers": 142,
+ "iqr_us": 5601.0829994193045,
+ "matches": 392,
+ "median_us": 1777527.375000318,
+ "op": "sift",
+ "pair": "1-4",
+ "peak_extra_cuda_bytes": null,
+ "throughput_per_s": 1.1251584803298134,
+ "width": 800
+ },
+ {
+ "backend": "kornia (eager)",
+ "batch": 1,
+ "corner_error_px": 507.036865234375,
+ "dtype": "float32",
+ "features1": 4096,
+ "features2": 4096,
+ "height": 640,
+ "initial_call_seconds": null,
+ "inliers": 27,
+ "iqr_us": 12279.16700008791,
+ "matches": 228,
+ "median_us": 1791002.2500000196,
+ "op": "sift",
+ "pair": "1-5",
+ "peak_extra_cuda_bytes": null,
+ "throughput_per_s": 1.1166931811503744,
+ "width": 800
+ },
+ {
+ "backend": "kornia (eager)",
+ "batch": 1,
+ "corner_error_px": 605.4273071289062,
+ "dtype": "float32",
+ "features1": 4096,
+ "features2": 4096,
+ "height": 640,
+ "initial_call_seconds": null,
+ "inliers": 26,
+ "iqr_us": 47714.3750003961,
+ "matches": 165,
+ "median_us": 1811770.5409995324,
+ "op": "sift",
+ "pair": "1-6",
+ "peak_extra_cuda_bytes": null,
+ "throughput_per_s": 1.1038925486097282,
+ "width": 800
+ },
+ {
+ "backend": "kornia (eager)",
+ "batch": 1,
+ "corner_error_px": 1.926998257637024,
+ "dtype": "float32",
+ "features1": 4096,
+ "features2": 4096,
+ "height": 640,
+ "initial_call_seconds": null,
+ "inliers": 1310,
+ "iqr_us": 42856.45900108648,
+ "matches": 1637,
+ "median_us": 3115188.124999804,
+ "op": "sift_affnet_hardnet",
+ "pair": "1-2",
+ "peak_extra_cuda_bytes": null,
+ "throughput_per_s": 0.6420158012126879,
+ "width": 800
+ },
+ {
+ "backend": "kornia (eager)",
+ "batch": 1,
+ "corner_error_px": 1.3654212951660156,
+ "dtype": "float32",
+ "features1": 4096,
+ "features2": 4096,
+ "height": 640,
+ "initial_call_seconds": null,
+ "inliers": 687,
+ "iqr_us": 19791.542000348272,
+ "matches": 1177,
+ "median_us": 3068669.292000777,
+ "op": "sift_affnet_hardnet",
+ "pair": "1-3",
+ "peak_extra_cuda_bytes": null,
+ "throughput_per_s": 0.6517483018497562,
+ "width": 800
+ },
+ {
+ "backend": "kornia (eager)",
+ "batch": 1,
+ "corner_error_px": 1.9606666564941406,
+ "dtype": "float32",
+ "features1": 4096,
+ "features2": 4096,
+ "height": 640,
+ "initial_call_seconds": null,
+ "inliers": 384,
+ "iqr_us": 4069.5409998079413,
+ "matches": 717,
+ "median_us": 3067416.833000607,
+ "op": "sift_affnet_hardnet",
+ "pair": "1-4",
+ "peak_extra_cuda_bytes": null,
+ "throughput_per_s": 0.652014417630864,
+ "width": 800
+ },
+ {
+ "backend": "kornia (eager)",
+ "batch": 1,
+ "corner_error_px": 1.79166841506958,
+ "dtype": "float32",
+ "features1": 4096,
+ "features2": 4096,
+ "height": 640,
+ "initial_call_seconds": null,
+ "inliers": 163,
+ "iqr_us": 3684.3759999101167,
+ "matches": 343,
+ "median_us": 3045735.5409998856,
+ "op": "sift_affnet_hardnet",
+ "pair": "1-5",
+ "peak_extra_cuda_bytes": null,
+ "throughput_per_s": 0.656655830119584,
+ "width": 800
+ },
+ {
+ "backend": "kornia (eager)",
+ "batch": 1,
+ "corner_error_px": 11.658452987670898,
+ "dtype": "float32",
+ "features1": 4096,
+ "features2": 4096,
+ "height": 640,
+ "initial_call_seconds": null,
+ "inliers": 41,
+ "iqr_us": 16409.083000326063,
+ "matches": 190,
+ "median_us": 3036582.458000339,
+ "op": "sift_affnet_hardnet",
+ "pair": "1-6",
+ "peak_extra_cuda_bytes": null,
+ "throughput_per_s": 0.6586351688658068,
+ "width": 800
+ },
+ {
+ "backend": "kornia (eager)",
+ "batch": 1,
+ "corner_error_px": 1.2628076076507568,
+ "dtype": "float32",
+ "features1": 2911,
+ "features2": 3064,
+ "height": 640,
+ "initial_call_seconds": null,
+ "inliers": 1101,
+ "iqr_us": 32863.625498976035,
+ "matches": 1601,
+ "median_us": 2117955.3124998165,
+ "op": "keynet_hardnet",
+ "pair": "1-2",
+ "peak_extra_cuda_bytes": null,
+ "throughput_per_s": 0.9443069871192918,
+ "width": 800
+ },
+ {
+ "backend": "kornia (eager)",
+ "batch": 1,
+ "corner_error_px": 1.679056167602539,
+ "dtype": "float32",
+ "features1": 2911,
+ "features2": 3426,
+ "height": 640,
+ "initial_call_seconds": null,
+ "inliers": 732,
+ "iqr_us": 6174.572750751395,
+ "matches": 1222,
+ "median_us": 2106588.124999689,
+ "op": "keynet_hardnet",
+ "pair": "1-3",
+ "peak_extra_cuda_bytes": null,
+ "throughput_per_s": 0.9494024846457801,
+ "width": 800
+ },
+ {
+ "backend": "kornia (eager)",
+ "batch": 1,
+ "corner_error_px": 1.832970142364502,
+ "dtype": "float32",
+ "features1": 2911,
+ "features2": 3409,
+ "height": 640,
+ "initial_call_seconds": null,
+ "inliers": 266,
+ "iqr_us": 5745.677749928291,
+ "matches": 534,
+ "median_us": 2107188.729500194,
+ "op": "keynet_hardnet",
+ "pair": "1-4",
+ "peak_extra_cuda_bytes": null,
+ "throughput_per_s": 0.9491318798361178,
+ "width": 800
+ },
+ {
+ "backend": "kornia (eager)",
+ "batch": 1,
+ "corner_error_px": 3.6574039459228516,
+ "dtype": "float32",
+ "features1": 2911,
+ "features2": 3832,
+ "height": 640,
+ "initial_call_seconds": null,
+ "inliers": 75,
+ "iqr_us": 16774.062499962383,
+ "matches": 199,
+ "median_us": 2107387.208000091,
+ "op": "keynet_hardnet",
+ "pair": "1-5",
+ "peak_extra_cuda_bytes": null,
+ "throughput_per_s": 0.9490424884461545,
+ "width": 800
+ },
+ {
+ "backend": "kornia (eager)",
+ "batch": 1,
+ "corner_error_px": 8.827790260314941,
+ "dtype": "float32",
+ "features1": 2911,
+ "features2": 3831,
+ "height": 640,
+ "initial_call_seconds": null,
+ "inliers": 12,
+ "iqr_us": 17593.3122495735,
+ "matches": 63,
+ "median_us": 2108327.854500203,
+ "op": "keynet_hardnet",
+ "pair": "1-6",
+ "peak_extra_cuda_bytes": null,
+ "throughput_per_s": 0.9486190659251699,
+ "width": 800
+ }
+ ]
+}
diff --git a/benchmarks/feature/graf_results/optimized-compiled-cuda.json b/benchmarks/feature/graf_results/optimized-compiled-cuda.json
new file mode 100644
index 000000000..007c27252
--- /dev/null
+++ b/benchmarks/feature/graf_results/optimized-compiled-cuda.json
@@ -0,0 +1,341 @@
+{
+ "metadata": {
+ "albumentations": null,
+ "compile": true,
+ "compile_dynamic": true,
+ "compile_scope": "scale-space pyramid/response/subpixel; KeyNet response/NMS",
+ "corner_error": "mean L1 corner distance in pixels",
+ "cuda_device": "NVIDIA GeForce RTX 4090",
+ "cuda_version": "13.0",
+ "cudnn_allow_tf32": true,
+ "cudnn_benchmark": false,
+ "device": "cuda",
+ "git_commit": "fb66de1d",
+ "input_sha256": {
+ "H1to2p": "da5bbc066c175ce7c4a4c7737e7280ec1a2dc961e5eac52e7ac1f8bf14d60838",
+ "H1to3p": "9142503a1ffcd2457cb20cd883d819a486e2fa730118781fdb213d657b674421",
+ "H1to4p": "b05c90145964f7973e77ff9b2d200fc1823b0b46b9c4e1494c8ccc7079e994e7",
+ "H1to5p": "f545eb32e909393d6bc4416197bb4004ced0aee9739c5a3c3ea6078c66bb6149",
+ "H1to6p": "d1a5f773e727d3772d6f10a1f698c1f87e479ef804f130f6422db6b7a5f2c091",
+ "img1.ppm": "8d53092ffa5b27f5138ec458302f35e7c72a9f35d1f94078ca35944c4b3626dd",
+ "img2.ppm": "d2938d6df7c15e8e032c90f9abb5f4cb5def5acbfff98cc90f9b5f259453b6a2",
+ "img3.ppm": "188ef2abda166a50ee44f023a7ef9c87d4ca349d972db1d9a3abeb2714d4021c",
+ "img4.ppm": "6b4717b18b92d6d6b69cb3c91a800067b220d0bbbf6880f2878dbcb28108f76a",
+ "img5.ppm": "f68fdfe99de81b323a8c6a2b1351affa49742c44b1b776e3d3b5ba75a383234c",
+ "img6.ppm": "a2e03ab33c4913ccecd2a5c7109b02435b5089ad664a028b51c6807d1f7cbd46"
+ },
+ "kornia": "0.9.0rc1",
+ "kornia_rs": "0.1.10",
+ "machine": "x86_64",
+ "matching_ratio": 0.85,
+ "min_run_time": 3,
+ "num_features": 4096,
+ "numpy": "2.4.0",
+ "opencv": "4.11.0",
+ "pillow": "12.3.0",
+ "platform": "Linux-6.18.33.2-microsoft-standard-WSL2-x86_64-with-glibc2.39",
+ "python": "3.11.14",
+ "ransac_seed": 3407,
+ "seed": 0,
+ "sequence": "graf",
+ "timestamp_utc": "2026-09-05T17:23:20+00:00",
+ "timing": "extract both images + SNN, excluding RANSAC and I/O",
+ "timing_pairs": [
+ 2,
+ 3,
+ 4,
+ 5,
+ 6
+ ],
+ "torch": "2.14.0+cu130",
+ "torch_num_threads": 1,
+ "torchvision": null
+ },
+ "results": [
+ {
+ "backend": "kornia (selectively compiled)",
+ "batch": 1,
+ "corner_error_px": 1.381424069404602,
+ "dtype": "float32",
+ "features1": 4096,
+ "features2": 4096,
+ "height": 640,
+ "initial_call_seconds": 43.38124697500098,
+ "inliers": 1443,
+ "iqr_us": 12079.665499186376,
+ "matches": 1857,
+ "median_us": 67427.03999771038,
+ "op": "sift",
+ "pair": "1-2",
+ "peak_extra_cuda_bytes": 723493376,
+ "throughput_per_s": 29.661690622455236,
+ "width": 800
+ },
+ {
+ "backend": "kornia (selectively compiled)",
+ "batch": 1,
+ "corner_error_px": 1.5054197311401367,
+ "dtype": "float32",
+ "features1": 4096,
+ "features2": 4096,
+ "height": 640,
+ "initial_call_seconds": 0.06245729099828168,
+ "inliers": 525,
+ "iqr_us": 20708.129251033824,
+ "matches": 969,
+ "median_us": 71329.23249992018,
+ "op": "sift",
+ "pair": "1-3",
+ "peak_extra_cuda_bytes": 723549696,
+ "throughput_per_s": 28.03899509226092,
+ "width": 800
+ },
+ {
+ "backend": "kornia (selectively compiled)",
+ "batch": 1,
+ "corner_error_px": 2.8458313941955566,
+ "dtype": "float32",
+ "features1": 4096,
+ "features2": 4096,
+ "height": 640,
+ "initial_call_seconds": 0.07158406800226658,
+ "inliers": 142,
+ "iqr_us": 17208.37124867103,
+ "matches": 392,
+ "median_us": 70892.05100055551,
+ "op": "sift",
+ "pair": "1-4",
+ "peak_extra_cuda_bytes": 723541504,
+ "throughput_per_s": 28.211907707174785,
+ "width": 800
+ },
+ {
+ "backend": "kornia (selectively compiled)",
+ "batch": 1,
+ "corner_error_px": 507.1316223144531,
+ "dtype": "float32",
+ "features1": 4096,
+ "features2": 4096,
+ "height": 640,
+ "initial_call_seconds": 0.06656795500020962,
+ "inliers": 26,
+ "iqr_us": 18947.886004752945,
+ "matches": 228,
+ "median_us": 71085.62799840001,
+ "op": "sift",
+ "pair": "1-5",
+ "peak_extra_cuda_bytes": 723581440,
+ "throughput_per_s": 28.135082383249337,
+ "width": 800
+ },
+ {
+ "backend": "kornia (selectively compiled)",
+ "batch": 1,
+ "corner_error_px": 605.405029296875,
+ "dtype": "float32",
+ "features1": 4096,
+ "features2": 4096,
+ "height": 640,
+ "initial_call_seconds": 0.08264513999893097,
+ "inliers": 26,
+ "iqr_us": 16256.11024974205,
+ "matches": 165,
+ "median_us": 75415.07799942337,
+ "op": "sift",
+ "pair": "1-6",
+ "peak_extra_cuda_bytes": 723649536,
+ "throughput_per_s": 26.51989566350766,
+ "width": 800
+ },
+ {
+ "backend": "kornia (selectively compiled)",
+ "batch": 1,
+ "corner_error_px": 1.4250712394714355,
+ "dtype": "float32",
+ "features1": 4096,
+ "features2": 4096,
+ "height": 640,
+ "initial_call_seconds": 0.20946509200075525,
+ "inliers": 1315,
+ "iqr_us": 21460.887747707602,
+ "matches": 1637,
+ "median_us": 134627.32300104108,
+ "op": "sift_affnet_hardnet",
+ "pair": "1-2",
+ "peak_extra_cuda_bytes": 1110053376,
+ "throughput_per_s": 14.85582536603312,
+ "width": 800
+ },
+ {
+ "backend": "kornia (selectively compiled)",
+ "batch": 1,
+ "corner_error_px": 1.1573638916015625,
+ "dtype": "float32",
+ "features1": 4096,
+ "features2": 4096,
+ "height": 640,
+ "initial_call_seconds": 0.13678586999958497,
+ "inliers": 688,
+ "iqr_us": 13184.826497308677,
+ "matches": 1177,
+ "median_us": 131069.61499943282,
+ "op": "sift_affnet_hardnet",
+ "pair": "1-3",
+ "peak_extra_cuda_bytes": 1110053376,
+ "throughput_per_s": 15.25906671816084,
+ "width": 800
+ },
+ {
+ "backend": "kornia (selectively compiled)",
+ "batch": 1,
+ "corner_error_px": 1.8060579299926758,
+ "dtype": "float32",
+ "features1": 4096,
+ "features2": 4096,
+ "height": 640,
+ "initial_call_seconds": 0.1429948869990767,
+ "inliers": 385,
+ "iqr_us": 12668.55699941516,
+ "matches": 717,
+ "median_us": 134554.39699828275,
+ "op": "sift_affnet_hardnet",
+ "pair": "1-4",
+ "peak_extra_cuda_bytes": 1110053376,
+ "throughput_per_s": 14.863876949524919,
+ "width": 800
+ },
+ {
+ "backend": "kornia (selectively compiled)",
+ "batch": 1,
+ "corner_error_px": 2.6236982345581055,
+ "dtype": "float32",
+ "features1": 4096,
+ "features2": 4096,
+ "height": 640,
+ "initial_call_seconds": 0.122091814999294,
+ "inliers": 158,
+ "iqr_us": 11802.698996689287,
+ "matches": 343,
+ "median_us": 131025.50400071777,
+ "op": "sift_affnet_hardnet",
+ "pair": "1-5",
+ "peak_extra_cuda_bytes": 1110053376,
+ "throughput_per_s": 15.264203830034829,
+ "width": 800
+ },
+ {
+ "backend": "kornia (selectively compiled)",
+ "batch": 1,
+ "corner_error_px": 4.891265869140625,
+ "dtype": "float32",
+ "features1": 4096,
+ "features2": 4096,
+ "height": 640,
+ "initial_call_seconds": 0.12418506900212378,
+ "inliers": 48,
+ "iqr_us": 18284.875999597716,
+ "matches": 190,
+ "median_us": 133056.80900157313,
+ "op": "sift_affnet_hardnet",
+ "pair": "1-6",
+ "peak_extra_cuda_bytes": 1110053376,
+ "throughput_per_s": 15.03117363934644,
+ "width": 800
+ },
+ {
+ "backend": "kornia (selectively compiled)",
+ "batch": 1,
+ "corner_error_px": 2.0286834239959717,
+ "dtype": "float32",
+ "features1": 2912,
+ "features2": 3064,
+ "height": 640,
+ "initial_call_seconds": 16.83849643600115,
+ "inliers": 1107,
+ "iqr_us": 10054.193502583075,
+ "matches": 1600,
+ "median_us": 108467.65700080141,
+ "op": "keynet_hardnet",
+ "pair": "1-2",
+ "peak_extra_cuda_bytes": 1109120000,
+ "throughput_per_s": 18.438676148275455,
+ "width": 800
+ },
+ {
+ "backend": "kornia (selectively compiled)",
+ "batch": 1,
+ "corner_error_px": 1.4283819198608398,
+ "dtype": "float32",
+ "features1": 2912,
+ "features2": 3427,
+ "height": 640,
+ "initial_call_seconds": 0.10404478700002073,
+ "inliers": 732,
+ "iqr_us": 7606.623003084678,
+ "matches": 1222,
+ "median_us": 101359.59499893943,
+ "op": "keynet_hardnet",
+ "pair": "1-3",
+ "peak_extra_cuda_bytes": 1109120000,
+ "throughput_per_s": 19.7317284073691,
+ "width": 800
+ },
+ {
+ "backend": "kornia (selectively compiled)",
+ "batch": 1,
+ "corner_error_px": 2.531064033508301,
+ "dtype": "float32",
+ "features1": 2912,
+ "features2": 3410,
+ "height": 640,
+ "initial_call_seconds": 0.10250263899797574,
+ "inliers": 266,
+ "iqr_us": 10454.119001224171,
+ "matches": 539,
+ "median_us": 103292.25199893699,
+ "op": "keynet_hardnet",
+ "pair": "1-4",
+ "peak_extra_cuda_bytes": 1109120000,
+ "throughput_per_s": 19.3625365048734,
+ "width": 800
+ },
+ {
+ "backend": "kornia (selectively compiled)",
+ "batch": 1,
+ "corner_error_px": 3.699866771697998,
+ "dtype": "float32",
+ "features1": 2912,
+ "features2": 3832,
+ "height": 640,
+ "initial_call_seconds": 0.10789985399969737,
+ "inliers": 70,
+ "iqr_us": 10047.198748907249,
+ "matches": 199,
+ "median_us": 106722.67600057239,
+ "op": "keynet_hardnet",
+ "pair": "1-5",
+ "peak_extra_cuda_bytes": 1109120000,
+ "throughput_per_s": 18.740159776252924,
+ "width": 800
+ },
+ {
+ "backend": "kornia (selectively compiled)",
+ "batch": 1,
+ "corner_error_px": 18.499649047851562,
+ "dtype": "float32",
+ "features1": 2912,
+ "features2": 3830,
+ "height": 640,
+ "initial_call_seconds": 0.10506594900289201,
+ "inliers": 14,
+ "iqr_us": 10784.646747197257,
+ "matches": 64,
+ "median_us": 105573.9095008903,
+ "op": "keynet_hardnet",
+ "pair": "1-6",
+ "peak_extra_cuda_bytes": 1109120000,
+ "throughput_per_s": 18.944074435200623,
+ "width": 800
+ }
+ ]
+}
diff --git a/benchmarks/feature/graf_results/optimized-cpu.json b/benchmarks/feature/graf_results/optimized-cpu.json
new file mode 100644
index 000000000..fab0885d7
--- /dev/null
+++ b/benchmarks/feature/graf_results/optimized-cpu.json
@@ -0,0 +1,317 @@
+{
+ "metadata": {
+ "albumentations": null,
+ "corner_error": "mean L1 corner distance in pixels",
+ "cudnn_allow_tf32": true,
+ "cudnn_benchmark": false,
+ "device": "cpu",
+ "git_commit": "e8e4ec0f",
+ "input_sha256": {
+ "H1to2p": "da5bbc066c175ce7c4a4c7737e7280ec1a2dc961e5eac52e7ac1f8bf14d60838",
+ "H1to3p": "9142503a1ffcd2457cb20cd883d819a486e2fa730118781fdb213d657b674421",
+ "H1to4p": "b05c90145964f7973e77ff9b2d200fc1823b0b46b9c4e1494c8ccc7079e994e7",
+ "H1to5p": "f545eb32e909393d6bc4416197bb4004ced0aee9739c5a3c3ea6078c66bb6149",
+ "H1to6p": "d1a5f773e727d3772d6f10a1f698c1f87e479ef804f130f6422db6b7a5f2c091",
+ "img1.ppm": "8d53092ffa5b27f5138ec458302f35e7c72a9f35d1f94078ca35944c4b3626dd",
+ "img2.ppm": "d2938d6df7c15e8e032c90f9abb5f4cb5def5acbfff98cc90f9b5f259453b6a2",
+ "img3.ppm": "188ef2abda166a50ee44f023a7ef9c87d4ca349d972db1d9a3abeb2714d4021c",
+ "img4.ppm": "6b4717b18b92d6d6b69cb3c91a800067b220d0bbbf6880f2878dbcb28108f76a",
+ "img5.ppm": "f68fdfe99de81b323a8c6a2b1351affa49742c44b1b776e3d3b5ba75a383234c",
+ "img6.ppm": "a2e03ab33c4913ccecd2a5c7109b02435b5089ad664a028b51c6807d1f7cbd46"
+ },
+ "kornia": "0.9.0rc1",
+ "kornia_rs": "0.1.10",
+ "machine": "x86_64",
+ "matching_ratio": 0.85,
+ "min_run_time": 3.0,
+ "num_features": 4096,
+ "numpy": "2.4.0",
+ "opencv": "4.11.0",
+ "pillow": "12.3.0",
+ "platform": "Linux-6.18.33.2-microsoft-standard-WSL2-x86_64-with-glibc2.39",
+ "python": "3.11.14",
+ "ransac_seed": 3407,
+ "seed": 0,
+ "sequence": "graf",
+ "timestamp_utc": "2026-09-05T14:17:47+00:00",
+ "timing": "extract both images + SNN, excluding RANSAC and I/O",
+ "timing_pairs": [
+ 2
+ ],
+ "torch": "2.14.0+cu130",
+ "torch_num_threads": 1,
+ "torchvision": null
+ },
+ "results": [
+ {
+ "backend": "kornia (eager)",
+ "batch": 1,
+ "corner_error_px": 1.2472425699234009,
+ "dtype": "float32",
+ "features1": 4096,
+ "features2": 4096,
+ "height": 640,
+ "inliers": 1473,
+ "iqr_us": 51260.40825234668,
+ "matches": 1857,
+ "median_us": 2855695.5450021634,
+ "op": "sift",
+ "pair": "1-2",
+ "peak_extra_cuda_bytes": null,
+ "throughput_per_s": 0.7003547711870961,
+ "width": 800
+ },
+ {
+ "backend": "kornia (eager)",
+ "batch": 1,
+ "corner_error_px": 1.4351511001586914,
+ "dtype": "float32",
+ "features1": 4096,
+ "features2": 4096,
+ "height": 640,
+ "inliers": 522,
+ "iqr_us": null,
+ "matches": 969,
+ "median_us": null,
+ "op": "sift",
+ "pair": "1-3",
+ "peak_extra_cuda_bytes": null,
+ "throughput_per_s": null,
+ "width": 800
+ },
+ {
+ "backend": "kornia (eager)",
+ "batch": 1,
+ "corner_error_px": 2.6106362342834473,
+ "dtype": "float32",
+ "features1": 4096,
+ "features2": 4096,
+ "height": 640,
+ "inliers": 143,
+ "iqr_us": null,
+ "matches": 391,
+ "median_us": null,
+ "op": "sift",
+ "pair": "1-4",
+ "peak_extra_cuda_bytes": null,
+ "throughput_per_s": null,
+ "width": 800
+ },
+ {
+ "backend": "kornia (eager)",
+ "batch": 1,
+ "corner_error_px": 507.036865234375,
+ "dtype": "float32",
+ "features1": 4096,
+ "features2": 4096,
+ "height": 640,
+ "inliers": 27,
+ "iqr_us": null,
+ "matches": 228,
+ "median_us": null,
+ "op": "sift",
+ "pair": "1-5",
+ "peak_extra_cuda_bytes": null,
+ "throughput_per_s": null,
+ "width": 800
+ },
+ {
+ "backend": "kornia (eager)",
+ "batch": 1,
+ "corner_error_px": 605.4273071289062,
+ "dtype": "float32",
+ "features1": 4096,
+ "features2": 4096,
+ "height": 640,
+ "inliers": 26,
+ "iqr_us": null,
+ "matches": 165,
+ "median_us": null,
+ "op": "sift",
+ "pair": "1-6",
+ "peak_extra_cuda_bytes": null,
+ "throughput_per_s": null,
+ "width": 800
+ },
+ {
+ "backend": "kornia (eager)",
+ "batch": 1,
+ "corner_error_px": 1.343464970588684,
+ "dtype": "float32",
+ "features1": 4096,
+ "features2": 4096,
+ "height": 640,
+ "inliers": 1294,
+ "iqr_us": 80226.44300217507,
+ "matches": 1636,
+ "median_us": 12714482.67499727,
+ "op": "sift_affnet_hardnet",
+ "pair": "1-2",
+ "peak_extra_cuda_bytes": null,
+ "throughput_per_s": 0.15730093399182907,
+ "width": 800
+ },
+ {
+ "backend": "kornia (eager)",
+ "batch": 1,
+ "corner_error_px": 1.2266035079956055,
+ "dtype": "float32",
+ "features1": 4096,
+ "features2": 4096,
+ "height": 640,
+ "inliers": 685,
+ "iqr_us": null,
+ "matches": 1176,
+ "median_us": null,
+ "op": "sift_affnet_hardnet",
+ "pair": "1-3",
+ "peak_extra_cuda_bytes": null,
+ "throughput_per_s": null,
+ "width": 800
+ },
+ {
+ "backend": "kornia (eager)",
+ "batch": 1,
+ "corner_error_px": 1.5475249290466309,
+ "dtype": "float32",
+ "features1": 4096,
+ "features2": 4096,
+ "height": 640,
+ "inliers": 389,
+ "iqr_us": null,
+ "matches": 716,
+ "median_us": null,
+ "op": "sift_affnet_hardnet",
+ "pair": "1-4",
+ "peak_extra_cuda_bytes": null,
+ "throughput_per_s": null,
+ "width": 800
+ },
+ {
+ "backend": "kornia (eager)",
+ "batch": 1,
+ "corner_error_px": 1.7917404174804688,
+ "dtype": "float32",
+ "features1": 4096,
+ "features2": 4096,
+ "height": 640,
+ "inliers": 163,
+ "iqr_us": null,
+ "matches": 343,
+ "median_us": null,
+ "op": "sift_affnet_hardnet",
+ "pair": "1-5",
+ "peak_extra_cuda_bytes": null,
+ "throughput_per_s": null,
+ "width": 800
+ },
+ {
+ "backend": "kornia (eager)",
+ "batch": 1,
+ "corner_error_px": 11.65833854675293,
+ "dtype": "float32",
+ "features1": 4096,
+ "features2": 4096,
+ "height": 640,
+ "inliers": 41,
+ "iqr_us": null,
+ "matches": 190,
+ "median_us": null,
+ "op": "sift_affnet_hardnet",
+ "pair": "1-6",
+ "peak_extra_cuda_bytes": null,
+ "throughput_per_s": null,
+ "width": 800
+ },
+ {
+ "backend": "kornia (eager)",
+ "batch": 1,
+ "corner_error_px": 1.2629008293151855,
+ "dtype": "float32",
+ "features1": 2911,
+ "features2": 3064,
+ "height": 640,
+ "inliers": 1101,
+ "iqr_us": 113240.81024940824,
+ "matches": 1601,
+ "median_us": 12886662.610000713,
+ "op": "keynet_hardnet",
+ "pair": "1-2",
+ "peak_extra_cuda_bytes": null,
+ "throughput_per_s": 0.155199221127113,
+ "width": 800
+ },
+ {
+ "backend": "kornia (eager)",
+ "batch": 1,
+ "corner_error_px": 1.6788702011108398,
+ "dtype": "float32",
+ "features1": 2911,
+ "features2": 3426,
+ "height": 640,
+ "inliers": 732,
+ "iqr_us": null,
+ "matches": 1222,
+ "median_us": null,
+ "op": "keynet_hardnet",
+ "pair": "1-3",
+ "peak_extra_cuda_bytes": null,
+ "throughput_per_s": null,
+ "width": 800
+ },
+ {
+ "backend": "kornia (eager)",
+ "batch": 1,
+ "corner_error_px": 1.8329229354858398,
+ "dtype": "float32",
+ "features1": 2911,
+ "features2": 3409,
+ "height": 640,
+ "inliers": 266,
+ "iqr_us": null,
+ "matches": 534,
+ "median_us": null,
+ "op": "keynet_hardnet",
+ "pair": "1-4",
+ "peak_extra_cuda_bytes": null,
+ "throughput_per_s": null,
+ "width": 800
+ },
+ {
+ "backend": "kornia (eager)",
+ "batch": 1,
+ "corner_error_px": 3.657532215118408,
+ "dtype": "float32",
+ "features1": 2911,
+ "features2": 3832,
+ "height": 640,
+ "inliers": 75,
+ "iqr_us": null,
+ "matches": 199,
+ "median_us": null,
+ "op": "keynet_hardnet",
+ "pair": "1-5",
+ "peak_extra_cuda_bytes": null,
+ "throughput_per_s": null,
+ "width": 800
+ },
+ {
+ "backend": "kornia (eager)",
+ "batch": 1,
+ "corner_error_px": 8.82778549194336,
+ "dtype": "float32",
+ "features1": 2911,
+ "features2": 3831,
+ "height": 640,
+ "inliers": 12,
+ "iqr_us": null,
+ "matches": 63,
+ "median_us": null,
+ "op": "keynet_hardnet",
+ "pair": "1-6",
+ "peak_extra_cuda_bytes": null,
+ "throughput_per_s": null,
+ "width": 800
+ }
+ ]
+}
diff --git a/benchmarks/feature/graf_results/optimized-cuda.json b/benchmarks/feature/graf_results/optimized-cuda.json
new file mode 100644
index 000000000..ec768d7cd
--- /dev/null
+++ b/benchmarks/feature/graf_results/optimized-cuda.json
@@ -0,0 +1,323 @@
+{
+ "metadata": {
+ "albumentations": null,
+ "corner_error": "mean L1 corner distance in pixels",
+ "cuda_device": "NVIDIA GeForce RTX 4090",
+ "cuda_version": "13.0",
+ "cudnn_allow_tf32": true,
+ "cudnn_benchmark": false,
+ "device": "cuda",
+ "git_commit": "e8e4ec0f",
+ "input_sha256": {
+ "H1to2p": "da5bbc066c175ce7c4a4c7737e7280ec1a2dc961e5eac52e7ac1f8bf14d60838",
+ "H1to3p": "9142503a1ffcd2457cb20cd883d819a486e2fa730118781fdb213d657b674421",
+ "H1to4p": "b05c90145964f7973e77ff9b2d200fc1823b0b46b9c4e1494c8ccc7079e994e7",
+ "H1to5p": "f545eb32e909393d6bc4416197bb4004ced0aee9739c5a3c3ea6078c66bb6149",
+ "H1to6p": "d1a5f773e727d3772d6f10a1f698c1f87e479ef804f130f6422db6b7a5f2c091",
+ "img1.ppm": "8d53092ffa5b27f5138ec458302f35e7c72a9f35d1f94078ca35944c4b3626dd",
+ "img2.ppm": "d2938d6df7c15e8e032c90f9abb5f4cb5def5acbfff98cc90f9b5f259453b6a2",
+ "img3.ppm": "188ef2abda166a50ee44f023a7ef9c87d4ca349d972db1d9a3abeb2714d4021c",
+ "img4.ppm": "6b4717b18b92d6d6b69cb3c91a800067b220d0bbbf6880f2878dbcb28108f76a",
+ "img5.ppm": "f68fdfe99de81b323a8c6a2b1351affa49742c44b1b776e3d3b5ba75a383234c",
+ "img6.ppm": "a2e03ab33c4913ccecd2a5c7109b02435b5089ad664a028b51c6807d1f7cbd46"
+ },
+ "kornia": "0.9.0rc1",
+ "kornia_rs": "0.1.10",
+ "machine": "x86_64",
+ "matching_ratio": 0.85,
+ "min_run_time": 3.0,
+ "num_features": 4096,
+ "numpy": "2.4.0",
+ "opencv": "4.11.0",
+ "pillow": "12.3.0",
+ "platform": "Linux-6.18.33.2-microsoft-standard-WSL2-x86_64-with-glibc2.39",
+ "python": "3.11.14",
+ "ransac_seed": 3407,
+ "seed": 0,
+ "sequence": "graf",
+ "timestamp_utc": "2026-09-05T14:06:59+00:00",
+ "timing": "extract both images + SNN, excluding RANSAC and I/O",
+ "timing_pairs": [
+ 2,
+ 3,
+ 4,
+ 5,
+ 6
+ ],
+ "torch": "2.14.0+cu130",
+ "torch_num_threads": 1,
+ "torchvision": null
+ },
+ "results": [
+ {
+ "backend": "kornia (eager)",
+ "batch": 1,
+ "corner_error_px": 1.3814700841903687,
+ "dtype": "float32",
+ "features1": 4096,
+ "features2": 4096,
+ "height": 640,
+ "inliers": 1443,
+ "iqr_us": 3618.4949985909043,
+ "matches": 1857,
+ "median_us": 114498.83400200633,
+ "op": "sift",
+ "pair": "1-2",
+ "peak_extra_cuda_bytes": 693980672,
+ "throughput_per_s": 17.46742678589159,
+ "width": 800
+ },
+ {
+ "backend": "kornia (eager)",
+ "batch": 1,
+ "corner_error_px": 1.505549430847168,
+ "dtype": "float32",
+ "features1": 4096,
+ "features2": 4096,
+ "height": 640,
+ "inliers": 525,
+ "iqr_us": 7519.236500229454,
+ "matches": 969,
+ "median_us": 114694.55000042217,
+ "op": "sift",
+ "pair": "1-3",
+ "peak_extra_cuda_bytes": 689945088,
+ "throughput_per_s": 17.437620183283673,
+ "width": 800
+ },
+ {
+ "backend": "kornia (eager)",
+ "batch": 1,
+ "corner_error_px": 2.7768054008483887,
+ "dtype": "float32",
+ "features1": 4096,
+ "features2": 4096,
+ "height": 640,
+ "inliers": 145,
+ "iqr_us": 5090.791499242187,
+ "matches": 391,
+ "median_us": 114726.81899977033,
+ "op": "sift",
+ "pair": "1-4",
+ "peak_extra_cuda_bytes": 689381376,
+ "throughput_per_s": 17.43271553623398,
+ "width": 800
+ },
+ {
+ "backend": "kornia (eager)",
+ "batch": 1,
+ "corner_error_px": 507.1316223144531,
+ "dtype": "float32",
+ "features1": 4096,
+ "features2": 4096,
+ "height": 640,
+ "inliers": 26,
+ "iqr_us": 6069.205502171826,
+ "matches": 228,
+ "median_us": 113548.42450055003,
+ "op": "sift",
+ "pair": "1-5",
+ "peak_extra_cuda_bytes": 692001280,
+ "throughput_per_s": 17.61363056156109,
+ "width": 800
+ },
+ {
+ "backend": "kornia (eager)",
+ "batch": 1,
+ "corner_error_px": 605.405029296875,
+ "dtype": "float32",
+ "features1": 4096,
+ "features2": 4096,
+ "height": 640,
+ "inliers": 26,
+ "iqr_us": 7337.071000620199,
+ "matches": 165,
+ "median_us": 114961.47999969253,
+ "op": "sift",
+ "pair": "1-6",
+ "peak_extra_cuda_bytes": 698105856,
+ "throughput_per_s": 17.397131630571817,
+ "width": 800
+ },
+ {
+ "backend": "kornia (eager)",
+ "batch": 1,
+ "corner_error_px": 1.3246439695358276,
+ "dtype": "float32",
+ "features1": 4096,
+ "features2": 4096,
+ "height": 640,
+ "inliers": 1301,
+ "iqr_us": 2644.1792515470297,
+ "matches": 1636,
+ "median_us": 170597.16700168792,
+ "op": "sift_affnet_hardnet",
+ "pair": "1-2",
+ "peak_extra_cuda_bytes": 1110053376,
+ "throughput_per_s": 11.72352410740919,
+ "width": 800
+ },
+ {
+ "backend": "kornia (eager)",
+ "batch": 1,
+ "corner_error_px": 1.215592384338379,
+ "dtype": "float32",
+ "features1": 4096,
+ "features2": 4096,
+ "height": 640,
+ "inliers": 685,
+ "iqr_us": 5809.055249301309,
+ "matches": 1176,
+ "median_us": 171601.94149983,
+ "op": "sift_affnet_hardnet",
+ "pair": "1-3",
+ "peak_extra_cuda_bytes": 1110053376,
+ "throughput_per_s": 11.65487979051788,
+ "width": 800
+ },
+ {
+ "backend": "kornia (eager)",
+ "batch": 1,
+ "corner_error_px": 0.8598418235778809,
+ "dtype": "float32",
+ "features1": 4096,
+ "features2": 4096,
+ "height": 640,
+ "inliers": 384,
+ "iqr_us": 4997.109499527141,
+ "matches": 716,
+ "median_us": 172645.88299985917,
+ "op": "sift_affnet_hardnet",
+ "pair": "1-4",
+ "peak_extra_cuda_bytes": 1110053376,
+ "throughput_per_s": 11.584405983209177,
+ "width": 800
+ },
+ {
+ "backend": "kornia (eager)",
+ "batch": 1,
+ "corner_error_px": 2.6237640380859375,
+ "dtype": "float32",
+ "features1": 4096,
+ "features2": 4096,
+ "height": 640,
+ "inliers": 158,
+ "iqr_us": 7859.596247726586,
+ "matches": 343,
+ "median_us": 172187.66549922293,
+ "op": "sift_affnet_hardnet",
+ "pair": "1-5",
+ "peak_extra_cuda_bytes": 1110053376,
+ "throughput_per_s": 11.615233845010959,
+ "width": 800
+ },
+ {
+ "backend": "kornia (eager)",
+ "batch": 1,
+ "corner_error_px": 4.890989303588867,
+ "dtype": "float32",
+ "features1": 4096,
+ "features2": 4096,
+ "height": 640,
+ "inliers": 48,
+ "iqr_us": 32013.090997679683,
+ "matches": 190,
+ "median_us": 183711.60000060627,
+ "op": "sift_affnet_hardnet",
+ "pair": "1-6",
+ "peak_extra_cuda_bytes": 1110053376,
+ "throughput_per_s": 10.886628824708945,
+ "width": 800
+ },
+ {
+ "backend": "kornia (eager)",
+ "batch": 1,
+ "corner_error_px": 2.0286834239959717,
+ "dtype": "float32",
+ "features1": 2912,
+ "features2": 3064,
+ "height": 640,
+ "inliers": 1107,
+ "iqr_us": 14421.137997487676,
+ "matches": 1600,
+ "median_us": 130645.79699857859,
+ "op": "keynet_hardnet",
+ "pair": "1-2",
+ "peak_extra_cuda_bytes": 1109120000,
+ "throughput_per_s": 15.308567485119784,
+ "width": 800
+ },
+ {
+ "backend": "kornia (eager)",
+ "batch": 1,
+ "corner_error_px": 1.4283819198608398,
+ "dtype": "float32",
+ "features1": 2912,
+ "features2": 3427,
+ "height": 640,
+ "inliers": 732,
+ "iqr_us": 15542.801498668268,
+ "matches": 1222,
+ "median_us": 129888.51500267629,
+ "op": "keynet_hardnet",
+ "pair": "1-3",
+ "peak_extra_cuda_bytes": 1109120000,
+ "throughput_per_s": 15.39782019956723,
+ "width": 800
+ },
+ {
+ "backend": "kornia (eager)",
+ "batch": 1,
+ "corner_error_px": 2.531064033508301,
+ "dtype": "float32",
+ "features1": 2912,
+ "features2": 3410,
+ "height": 640,
+ "inliers": 266,
+ "iqr_us": 9045.714000421867,
+ "matches": 539,
+ "median_us": 122400.38150048349,
+ "op": "keynet_hardnet",
+ "pair": "1-4",
+ "peak_extra_cuda_bytes": 1109120000,
+ "throughput_per_s": 16.339818352544103,
+ "width": 800
+ },
+ {
+ "backend": "kornia (eager)",
+ "batch": 1,
+ "corner_error_px": 3.699866771697998,
+ "dtype": "float32",
+ "features1": 2912,
+ "features2": 3832,
+ "height": 640,
+ "inliers": 70,
+ "iqr_us": 17065.026001546357,
+ "matches": 199,
+ "median_us": 121856.84900214255,
+ "op": "keynet_hardnet",
+ "pair": "1-5",
+ "peak_extra_cuda_bytes": 1109120000,
+ "throughput_per_s": 16.41270077453615,
+ "width": 800
+ },
+ {
+ "backend": "kornia (eager)",
+ "batch": 1,
+ "corner_error_px": 18.499649047851562,
+ "dtype": "float32",
+ "features1": 2912,
+ "features2": 3830,
+ "height": 640,
+ "inliers": 14,
+ "iqr_us": 20650.590000514057,
+ "matches": 64,
+ "median_us": 129755.09100215277,
+ "op": "keynet_hardnet",
+ "pair": "1-6",
+ "peak_extra_cuda_bytes": 1109120000,
+ "throughput_per_s": 15.413653403139442,
+ "width": 800
+ }
+ ]
+}
diff --git a/benchmarks/feature/graf_results/optimized-mps.json b/benchmarks/feature/graf_results/optimized-mps.json
new file mode 100644
index 000000000..708eb64fc
--- /dev/null
+++ b/benchmarks/feature/graf_results/optimized-mps.json
@@ -0,0 +1,340 @@
+{
+ "metadata": {
+ "albumentations": null,
+ "compile": false,
+ "compile_dynamic": null,
+ "compile_scope": null,
+ "corner_error": "mean L1 corner distance in pixels",
+ "cudnn_allow_tf32": true,
+ "cudnn_benchmark": false,
+ "device": "mps",
+ "git_commit": "f61ea9e4",
+ "input_sha256": {
+ "H1to2p": "da5bbc066c175ce7c4a4c7737e7280ec1a2dc961e5eac52e7ac1f8bf14d60838",
+ "H1to3p": "9142503a1ffcd2457cb20cd883d819a486e2fa730118781fdb213d657b674421",
+ "H1to4p": "b05c90145964f7973e77ff9b2d200fc1823b0b46b9c4e1494c8ccc7079e994e7",
+ "H1to5p": "f545eb32e909393d6bc4416197bb4004ced0aee9739c5a3c3ea6078c66bb6149",
+ "H1to6p": "d1a5f773e727d3772d6f10a1f698c1f87e479ef804f130f6422db6b7a5f2c091",
+ "img1.ppm": "8d53092ffa5b27f5138ec458302f35e7c72a9f35d1f94078ca35944c4b3626dd",
+ "img2.ppm": "d2938d6df7c15e8e032c90f9abb5f4cb5def5acbfff98cc90f9b5f259453b6a2",
+ "img3.ppm": "188ef2abda166a50ee44f023a7ef9c87d4ca349d972db1d9a3abeb2714d4021c",
+ "img4.ppm": "6b4717b18b92d6d6b69cb3c91a800067b220d0bbbf6880f2878dbcb28108f76a",
+ "img5.ppm": "f68fdfe99de81b323a8c6a2b1351affa49742c44b1b776e3d3b5ba75a383234c",
+ "img6.ppm": "a2e03ab33c4913ccecd2a5c7109b02435b5089ad664a028b51c6807d1f7cbd46"
+ },
+ "kornia": "0.9.0rc1",
+ "kornia_rs": "0.1.10",
+ "machine": "arm64",
+ "matching_ratio": 0.85,
+ "min_run_time": 5.0,
+ "num_features": 4096,
+ "numpy": "2.4.0",
+ "opencv": "4.11.0",
+ "pillow": "12.3.0",
+ "platform": "macOS-26.5.1-arm64-arm-64bit",
+ "python": "3.11.14",
+ "ransac_device": "cpu",
+ "ransac_seed": 3407,
+ "seed": 0,
+ "sequence": "graf",
+ "timestamp_utc": "2026-09-05T18:33:47+00:00",
+ "timing": "extract both images + SNN, excluding RANSAC and I/O",
+ "timing_pairs": [
+ 2,
+ 3,
+ 4,
+ 5,
+ 6
+ ],
+ "torch": "2.14.0",
+ "torch_num_threads": 1,
+ "torchvision": null
+ },
+ "results": [
+ {
+ "backend": "kornia (eager)",
+ "batch": 1,
+ "corner_error_px": 1.2472444772720337,
+ "dtype": "float32",
+ "features1": 4096,
+ "features2": 4096,
+ "height": 640,
+ "initial_call_seconds": null,
+ "inliers": 1473,
+ "iqr_us": 10304.041500148742,
+ "matches": 1857,
+ "median_us": 1059291.0210002628,
+ "op": "sift",
+ "pair": "1-2",
+ "peak_extra_cuda_bytes": null,
+ "throughput_per_s": 1.8880552750380613,
+ "width": 800
+ },
+ {
+ "backend": "kornia (eager)",
+ "batch": 1,
+ "corner_error_px": 1.434676170349121,
+ "dtype": "float32",
+ "features1": 4096,
+ "features2": 4096,
+ "height": 640,
+ "initial_call_seconds": null,
+ "inliers": 522,
+ "iqr_us": 17601.864249627397,
+ "matches": 969,
+ "median_us": 1062336.1869998006,
+ "op": "sift",
+ "pair": "1-3",
+ "peak_extra_cuda_bytes": null,
+ "throughput_per_s": 1.8826432013469343,
+ "width": 800
+ },
+ {
+ "backend": "kornia (eager)",
+ "batch": 1,
+ "corner_error_px": 2.5855250358581543,
+ "dtype": "float32",
+ "features1": 4096,
+ "features2": 4096,
+ "height": 640,
+ "initial_call_seconds": null,
+ "inliers": 142,
+ "iqr_us": 6240.072749733372,
+ "matches": 392,
+ "median_us": 1068004.1249997886,
+ "op": "sift",
+ "pair": "1-4",
+ "peak_extra_cuda_bytes": null,
+ "throughput_per_s": 1.8726519431752155,
+ "width": 800
+ },
+ {
+ "backend": "kornia (eager)",
+ "batch": 1,
+ "corner_error_px": 507.036865234375,
+ "dtype": "float32",
+ "features1": 4096,
+ "features2": 4096,
+ "height": 640,
+ "initial_call_seconds": null,
+ "inliers": 27,
+ "iqr_us": 2116.124999929525,
+ "matches": 228,
+ "median_us": 1078312.3955002339,
+ "op": "sift",
+ "pair": "1-5",
+ "peak_extra_cuda_bytes": null,
+ "throughput_per_s": 1.8547500783130582,
+ "width": 800
+ },
+ {
+ "backend": "kornia (eager)",
+ "batch": 1,
+ "corner_error_px": 605.4273071289062,
+ "dtype": "float32",
+ "features1": 4096,
+ "features2": 4096,
+ "height": 640,
+ "initial_call_seconds": null,
+ "inliers": 26,
+ "iqr_us": 10287.458000675542,
+ "matches": 165,
+ "median_us": 1075935.4579995489,
+ "op": "sift",
+ "pair": "1-6",
+ "peak_extra_cuda_bytes": null,
+ "throughput_per_s": 1.8588475592379246,
+ "width": 800
+ },
+ {
+ "backend": "kornia (eager)",
+ "batch": 1,
+ "corner_error_px": 1.926998257637024,
+ "dtype": "float32",
+ "features1": 4096,
+ "features2": 4096,
+ "height": 640,
+ "initial_call_seconds": null,
+ "inliers": 1310,
+ "iqr_us": 30888.687500009837,
+ "matches": 1637,
+ "median_us": 2352825.292000034,
+ "op": "sift_affnet_hardnet",
+ "pair": "1-2",
+ "peak_extra_cuda_bytes": null,
+ "throughput_per_s": 0.8500418653268927,
+ "width": 800
+ },
+ {
+ "backend": "kornia (eager)",
+ "batch": 1,
+ "corner_error_px": 1.3654212951660156,
+ "dtype": "float32",
+ "features1": 4096,
+ "features2": 4096,
+ "height": 640,
+ "initial_call_seconds": null,
+ "inliers": 687,
+ "iqr_us": 22579.499750008836,
+ "matches": 1177,
+ "median_us": 2343714.146500133,
+ "op": "sift_affnet_hardnet",
+ "pair": "1-3",
+ "peak_extra_cuda_bytes": null,
+ "throughput_per_s": 0.8533463873939571,
+ "width": 800
+ },
+ {
+ "backend": "kornia (eager)",
+ "batch": 1,
+ "corner_error_px": 1.9606666564941406,
+ "dtype": "float32",
+ "features1": 4096,
+ "features2": 4096,
+ "height": 640,
+ "initial_call_seconds": null,
+ "inliers": 384,
+ "iqr_us": 3821.2494998788316,
+ "matches": 717,
+ "median_us": 2338247.437500286,
+ "op": "sift_affnet_hardnet",
+ "pair": "1-4",
+ "peak_extra_cuda_bytes": null,
+ "throughput_per_s": 0.8553414698224193,
+ "width": 800
+ },
+ {
+ "backend": "kornia (eager)",
+ "batch": 1,
+ "corner_error_px": 1.79166841506958,
+ "dtype": "float32",
+ "features1": 4096,
+ "features2": 4096,
+ "height": 640,
+ "initial_call_seconds": null,
+ "inliers": 163,
+ "iqr_us": 2226.5830002652365,
+ "matches": 343,
+ "median_us": 2342692.2090002336,
+ "op": "sift_affnet_hardnet",
+ "pair": "1-5",
+ "peak_extra_cuda_bytes": null,
+ "throughput_per_s": 0.8537186371800499,
+ "width": 800
+ },
+ {
+ "backend": "kornia (eager)",
+ "batch": 1,
+ "corner_error_px": 11.658452987670898,
+ "dtype": "float32",
+ "features1": 4096,
+ "features2": 4096,
+ "height": 640,
+ "initial_call_seconds": null,
+ "inliers": 41,
+ "iqr_us": 10081.833000185725,
+ "matches": 190,
+ "median_us": 2333732.0840000757,
+ "op": "sift_affnet_hardnet",
+ "pair": "1-6",
+ "peak_extra_cuda_bytes": null,
+ "throughput_per_s": 0.8569964023342171,
+ "width": 800
+ },
+ {
+ "backend": "kornia (eager)",
+ "batch": 1,
+ "corner_error_px": 1.2628076076507568,
+ "dtype": "float32",
+ "features1": 2911,
+ "features2": 3064,
+ "height": 640,
+ "initial_call_seconds": null,
+ "inliers": 1101,
+ "iqr_us": 16833.061999932397,
+ "matches": 1601,
+ "median_us": 2119693.7919994527,
+ "op": "keynet_hardnet",
+ "pair": "1-2",
+ "peak_extra_cuda_bytes": null,
+ "throughput_per_s": 0.94353250811451,
+ "width": 800
+ },
+ {
+ "backend": "kornia (eager)",
+ "batch": 1,
+ "corner_error_px": 1.679056167602539,
+ "dtype": "float32",
+ "features1": 2911,
+ "features2": 3426,
+ "height": 640,
+ "initial_call_seconds": null,
+ "inliers": 732,
+ "iqr_us": 24024.60449980026,
+ "matches": 1222,
+ "median_us": 2121727.3334996207,
+ "op": "keynet_hardnet",
+ "pair": "1-3",
+ "peak_extra_cuda_bytes": null,
+ "throughput_per_s": 0.9426281918615617,
+ "width": 800
+ },
+ {
+ "backend": "kornia (eager)",
+ "batch": 1,
+ "corner_error_px": 1.832970142364502,
+ "dtype": "float32",
+ "features1": 2911,
+ "features2": 3409,
+ "height": 640,
+ "initial_call_seconds": null,
+ "inliers": 266,
+ "iqr_us": 9900.791999825742,
+ "matches": 534,
+ "median_us": 2121020.8750003404,
+ "op": "keynet_hardnet",
+ "pair": "1-4",
+ "peak_extra_cuda_bytes": null,
+ "throughput_per_s": 0.9429421575116176,
+ "width": 800
+ },
+ {
+ "backend": "kornia (eager)",
+ "batch": 1,
+ "corner_error_px": 3.6574039459228516,
+ "dtype": "float32",
+ "features1": 2911,
+ "features2": 3832,
+ "height": 640,
+ "initial_call_seconds": null,
+ "inliers": 75,
+ "iqr_us": 9377.551999477873,
+ "matches": 199,
+ "median_us": 2110363.625500213,
+ "op": "keynet_hardnet",
+ "pair": "1-5",
+ "peak_extra_cuda_bytes": null,
+ "throughput_per_s": 0.9477039766196436,
+ "width": 800
+ },
+ {
+ "backend": "kornia (eager)",
+ "batch": 1,
+ "corner_error_px": 8.827790260314941,
+ "dtype": "float32",
+ "features1": 2911,
+ "features2": 3831,
+ "height": 640,
+ "initial_call_seconds": null,
+ "inliers": 12,
+ "iqr_us": 9047.083000041312,
+ "matches": 63,
+ "median_us": 2120245.4590002163,
+ "op": "keynet_hardnet",
+ "pair": "1-6",
+ "peak_extra_cuda_bytes": null,
+ "throughput_per_s": 0.94328701024224,
+ "width": 800
+ }
+ ]
+}
diff --git a/benchmarks/feature/local_features.py b/benchmarks/feature/local_features.py
new file mode 100644
index 000000000..cecb4cb47
--- /dev/null
+++ b/benchmarks/feature/local_features.py
@@ -0,0 +1,242 @@
+# LICENSE HEADER MANAGED BY add-license-header
+#
+# Copyright 2018 Kornia Team
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+"""Repeatable local-feature speed and homography quality on Oxford affine sequences.
+
+Run from the checkout root, using its interpreter::
+
+ .venv/bin/python -m benchmarks.feature.local_features --seq /data/graf --device cuda --json graf.json
+
+Compares revisions of public Kornia pipelines, without a cross-library baseline. All
+images retain their original resolution; inputs are grayscale float32, batch one,
+with 4096 requested features. SIFT uses the existing scale-space harness defaults
+(DoG, AdaptiveQuadInterp3d, doubled image, three levels, sigma 1.6, RootSIFT), with
+gradient orientation. SIFT-AffNet-HardNet adds pretrained AffNet and HardNet.
+KeyNet-HardNet uses its public preset, including pretrained OriNet.
+
+Timings are warmed median/IQR wall times, including device synchronization, for
+extracting BOTH images and SNN matching (ratio 0.85), excluding I/O and RANSAC.
+Image 1 is deliberately re-extracted for every pair. Quality is the existing
+mean L1 corner reprojection error against the supplied H1toKp homography, with
+fixed-seed Kornia RANSAC. Original Oxford PPM images are preferred; a PNG is used
+only when no PPM exists (converted copies can decode to different pixels).
+CPU timings use one thread, as does common.time_us's Timer. ``--device mps`` times
+with ``torch.mps.synchronize`` inside the timed region and evaluates RANSAC on CPU,
+because its batched SVD aborts the process on MPS; RANSAC is outside the timed region. Optional --compile uses
+the existing factory's selective compilation: scale-space pyramid/response/subpixel
+modules, or KeyNet response/NMS, with dynamic=True and the default Inductor mode.
+Descriptors, orientation, affine adaptation, matching, and RANSAC remain eager.
+Initial calls (including any compilation/cache loading) are recorded separately,
+outside warmup and steady-state timing. No autocast or pipeline settings change.
+
+The JSON written by ``--json`` uses the shared metadata/results envelope, including the
+aggregate ``load`` snapshot, and is a comparison artefact in the sense of
+``benchmarks/results_schema.validate_artefact``: each row is one image pair's timing and
+reprojection error, not a throughput cell, so it is not a ``--contribute`` release snapshot.
+"""
+
+from __future__ import annotations
+
+import argparse
+import hashlib
+import importlib.util
+import math
+import sys
+import time
+from pathlib import Path
+
+import numpy as np
+import torch
+
+import kornia
+import kornia.feature as KF
+from kornia.geometry import RANSAC
+
+if importlib.util.find_spec("cv2") is None:
+ raise SystemExit("SKIP: this benchmark requires the optional opencv-python package")
+
+sys.path.insert(0, str(Path(__file__).resolve().parents[1]))
+from common import collect_load_metrics, print_preflight, run_metadata, save_json, time_us, versions_line
+
+from benchmarks.feature.scale_space_detector import build_extractor, get_MAE_imgcorners, load_gray
+
+
+def image_path(seq: Path, index: int) -> Path:
+ for ext in ("ppm", "png"):
+ path = seq / f"img{index}.{ext}"
+ if path.is_file():
+ return path
+ raise FileNotFoundError(f"No img{index}.png or img{index}.ppm in {seq}")
+
+
+def evaluate(args: argparse.Namespace) -> None:
+ torch.manual_seed(0)
+ # NumPy only reads ground-truth files; all stochastic work uses PyTorch.
+ torch.set_num_threads(1)
+ torch.backends.cuda.matmul.allow_tf32 = False
+ device = torch.device(args.device)
+ # blocked_autorange synchronizes CUDA itself; MPS needs an explicit sync inside the timed region.
+ sync = {"cuda": torch.cuda.synchronize, "mps": torch.mps.synchronize}.get(device.type, lambda: None)
+ # Homography RANSAC batches an SVD that aborts the process on MPS (#4201, #4204); it is
+ # outside the timed region, so evaluating it on CPU leaves the timings untouched.
+ ransac_device = torch.device("cpu") if device.type == "mps" else device
+ meta = run_metadata(device)
+ meta["load"] = collect_load_metrics()
+ meta.update(
+ sequence=args.seq.name,
+ num_features=args.nf,
+ seed=0,
+ ransac_seed=3407,
+ matching_ratio=0.85,
+ timing="extract both images + SNN, excluding RANSAC and I/O",
+ corner_error="mean L1 corner distance in pixels",
+ timing_pairs=args.timing_pairs,
+ min_run_time=args.min_run_time,
+ ransac_device=str(ransac_device),
+ cudnn_allow_tf32=torch.backends.cudnn.allow_tf32,
+ cudnn_benchmark=torch.backends.cudnn.benchmark,
+ compile=args.compile,
+ compile_scope="scale-space pyramid/response/subpixel; KeyNet response/NMS" if args.compile else None,
+ compile_dynamic=True if args.compile else None,
+ input_sha256={
+ p.name: hashlib.sha256(p.read_bytes()).hexdigest()
+ for p in [image_path(args.seq, i) for i in range(1, 7)] + [args.seq / f"H1to{i}p" for i in range(2, 7)]
+ },
+ )
+ print(f"# {meta['git_commit']} | {meta['platform']} | {meta.get('cuda_device', device)}", flush=True)
+ print(versions_line(meta), flush=True)
+ print(f"# interpreter: {sys.executable}\n# kornia: {kornia.__file__}", flush=True)
+ print_preflight(meta["load"])
+ images = [load_gray(str(image_path(args.seq, i)), device) for i in range(1, 7)]
+ rows = []
+ for name in args.methods:
+ torch.manual_seed(0)
+ method, desc, ori, aff = {
+ "sift": ("scalespace", "sift", "lap", "none"),
+ "sift_affnet_hardnet": ("scalespace", "hardnet", "lap", "affnet"),
+ "keynet_hardnet": ("keynet", "hardnet", "orinet", "none"),
+ }[name]
+ extractor = build_extractor(
+ method, "dog", "adaptive", desc, ori, aff, device, args.nf, compile_modules=args.compile
+ ).eval()
+ print(f"\n# {name}\n# pair median ms IQR ms corner L1 px inliers matches", flush=True)
+
+ def extract_match(
+ img2: torch.Tensor, extractor: torch.nn.Module = extractor
+ ) -> tuple[torch.Tensor, torch.Tensor, torch.Tensor]:
+ kp1, d1, _ = extractor(images[0])
+ kp2, d2, _ = extractor(img2)
+ _, indices = KF.match_snn(d1, d2, 0.85)
+ return kp1, kp2, indices
+
+ for k, img2 in enumerate(images[1:], 2):
+ # Never use a potentially minutes-long compilation call to size the
+ # steady-state timing budget. Warm every pair before measuring it.
+ initial_call_seconds = None
+ if args.compile:
+ sync()
+ start = time.perf_counter()
+ extract_match(img2)
+ sync()
+ initial_call_seconds = time.perf_counter() - start
+ print(f"# 1-{k} initial compiled call: {initial_call_seconds:.3f} s", flush=True)
+ sync()
+ if device.type == "cuda":
+ torch.cuda.reset_peak_memory_stats(device)
+ memory_before = torch.cuda.memory_allocated(device)
+ start = time.perf_counter()
+ kp1, kp2, indices = extract_match(img2)
+ sync()
+ peak_bytes = torch.cuda.max_memory_allocated(device) - memory_before if device.type == "cuda" else None
+ warmup_seconds = time.perf_counter() - start
+ median, iqr = float("nan"), float("nan")
+ if k in args.timing_pairs:
+ # A CPU call can take longer than the time budget. Extend it using
+ # the warmup so blocked_autorange collects several samples there too.
+ median, iqr = time_us(
+ lambda img2=img2: extract_match(img2),
+ min_run_time=max(args.min_run_time, 5 * warmup_seconds),
+ sync=sync if device.type == "mps" else None,
+ )
+ if not math.isfinite(median):
+ raise RuntimeError(f"Timing failed for {name}, pair 1-{k}")
+ ransac = RANSAC("homography", inl_th=2.0, max_iter=10, batch_size=8196, confidence=0.9999, seed=3407)
+ error, inliers = float("nan"), 0
+ if len(indices) >= 4:
+ H, mask = ransac(kp1[indices[:, 0]].to(ransac_device), kp2[indices[:, 1]].to(ransac_device))
+ inliers = int(mask.sum())
+ if inliers >= 4:
+ error = get_MAE_imgcorners(
+ *images[0].shape[-2:], np.loadtxt(args.seq / f"H1to{k}p"), H.cpu().numpy()
+ )
+ row = {
+ "op": name,
+ "backend": "kornia (selectively compiled)" if args.compile else "kornia (eager)",
+ "batch": 1,
+ "height": img2.shape[-2],
+ "width": img2.shape[-1],
+ "dtype": "float32",
+ "pair": f"1-{k}",
+ "median_us": median,
+ "iqr_us": iqr,
+ "throughput_per_s": 2e6 / median,
+ "corner_error_px": error,
+ "inliers": inliers,
+ "matches": len(indices),
+ "features1": len(kp1),
+ "features2": len(kp2),
+ "peak_extra_cuda_bytes": peak_bytes,
+ "initial_call_seconds": initial_call_seconds,
+ }
+ rows.append(row)
+ print(
+ f" 1-{k} {median / 1000:11.2f} {iqr / 1000:8.2f} {error:14.3f} {inliers:9d} {len(indices):9d}",
+ flush=True,
+ )
+ if args.json:
+ save_json(args.json, meta, rows)
+ if args.profile:
+ activities = [torch.profiler.ProfilerActivity.CPU]
+ if device.type == "cuda":
+ activities.append(torch.profiler.ProfilerActivity.CUDA)
+ with torch.profiler.profile(activities=activities, record_shapes=True) as prof:
+ extractor(images[0])
+ sort_by = "self_cuda_time_total" if device.type == "cuda" else "self_cpu_time_total"
+ print(prof.key_averages().table(sort_by=sort_by, row_limit=25), flush=True)
+
+
+def main() -> None:
+ parser = argparse.ArgumentParser(description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter)
+ parser.add_argument("--seq", type=Path, required=True)
+ parser.add_argument("--device", choices=("cpu", "cuda", "mps"), default="cpu")
+ parser.add_argument("--nf", type=int, default=4096)
+ parser.add_argument("--min-run-time", type=float, default=3.0)
+ parser.add_argument("--timing-pairs", nargs="+", type=int, choices=range(2, 7), default=[2, 3, 4, 5, 6])
+ parser.add_argument("--json", type=Path)
+ parser.add_argument("--profile", action="store_true")
+ parser.add_argument("--compile", action="store_true", help="Selectively compile detector modules (see above)")
+ parser.add_argument(
+ "--methods",
+ nargs="+",
+ choices=("sift", "sift_affnet_hardnet", "keynet_hardnet"),
+ default=["sift", "sift_affnet_hardnet", "keynet_hardnet"],
+ )
+ evaluate(parser.parse_args())
+
+
+if __name__ == "__main__":
+ main()
diff --git a/benchmarks/feature/plot_sift_runtime.py b/benchmarks/feature/plot_sift_runtime.py
new file mode 100644
index 000000000..991df71e4
--- /dev/null
+++ b/benchmarks/feature/plot_sift_runtime.py
@@ -0,0 +1,307 @@
+# LICENSE HEADER MANAGED BY add-license-header
+#
+# Copyright 2018 Kornia Team
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+"""Render the Oxford graf SIFT runtime comparison as native PNG and SVG charts.
+
+Usage::
+
+ python benchmarks/feature/plot_sift_runtime.py \\
+ --inputs /tmp/sift-runtime-*.json --output /tmp/sift-runtime
+
+Inputs use ``common.save_json``'s metadata/results envelope. Each result records
+``op``, ``series``, ``device``, ``batch``, ``median_us`` and ``iqr_us``; timings
+are raw batch latencies, normalized here to milliseconds per image. Feature
+counts and CUDA memory measurements remain in the source JSON. Only CPU batch
+one and CUDA batches one, four and eight belong in this fixed comparison.
+
+The historical versions use their native presets, so quality differs. This is
+a runtime comparison, not an assertion of equivalent detections. OpenCV is a
+CPU-only baseline, including its dashed reference across the CUDA categories.
+Error bars represent median +/- half the IQR, not confidence intervals.
+"""
+
+from __future__ import annotations
+
+import argparse
+import json
+import math
+from pathlib import Path
+from typing import Any
+
+SERIES = ("0.8.2", "0.8.3", "current", "current + compile", "OpenCV")
+COLORS = ("#2549e8", "#7972c5", "#ffae00", "#a71920", "#228b32")
+GROUPS = (("cpu", 1), ("cuda", 1), ("cuda", 4), ("cuda", 8))
+GROUP_LABELS = ("CPU (BS=1)", "CUDA BS=1", "CUDA BS=4", "CUDA BS=8")
+
+
+def normalize_timing(row: dict[str, Any]) -> tuple[float, float]:
+ """Validate raw batch timings and return median and IQR in ms/image."""
+ batch = row.get("batch")
+ if isinstance(batch, bool) or not isinstance(batch, int) or batch <= 0:
+ raise ValueError(f"batch must be a positive integer, got {batch!r}")
+ values = []
+ for name in ("median_us", "iqr_us"):
+ value = row.get(name)
+ if isinstance(value, bool) or not isinstance(value, (int, float)) or not math.isfinite(value):
+ raise ValueError(f"{name} must be finite numeric data, got {value!r}")
+ if value < 0 or (name == "median_us" and value == 0):
+ raise ValueError(f"{name} must be {'positive' if name == 'median_us' else 'nonnegative'}, got {value}")
+ values.append(value / batch / 1000.0)
+ return values[0], values[1]
+
+
+def load_rows(paths: list[Path]) -> dict[tuple[str, str, int], tuple[float, float]]:
+ """Load measurements, rejecting ambiguous duplicates and incompatible rows."""
+ timings: dict[tuple[str, str, int], tuple[float, float]] = {}
+ for path in paths:
+ document = json.loads(path.read_text())
+ if not isinstance(document, dict) or not isinstance(document.get("metadata"), dict):
+ raise ValueError(f"{path}: expected a metadata/results JSON object")
+ if not isinstance(document.get("results"), list):
+ raise ValueError(f"{path}: results must be a list")
+ if document["metadata"].get("num_features") != 4096:
+ raise ValueError(f"{path}: this chart requires metadata num_features=4096")
+ for index, row in enumerate(document["results"]):
+ context = f"{path}: results[{index}]"
+ if not isinstance(row, dict):
+ raise ValueError(f"{context}: expected an object")
+ if (row.get("height"), row.get("width")) != (640, 800):
+ raise ValueError(f"{context}: this chart requires height=640, width=800")
+ series, device, batch = row.get("series"), row.get("device"), row.get("batch")
+ if series not in SERIES:
+ raise ValueError(f"{context}: unsupported series {series!r}")
+ expected_op = "OpenCV SIFT" if series == "OpenCV" else "SIFTFeatureScaleSpace"
+ if row.get("op") != expected_op:
+ raise ValueError(f"{context}: expected op={expected_op!r}")
+ try:
+ timing = normalize_timing(row)
+ except ValueError as error:
+ raise ValueError(f"{context}: {error}") from error
+ if (device, batch) not in GROUPS:
+ raise ValueError(f"{context}: unsupported device/batch combination {(device, batch)!r}")
+ if series == "OpenCV" and (device, batch) != ("cpu", 1):
+ raise ValueError(f"{context}: OpenCV must be CPU batch one")
+ key = (series, device, batch)
+ if key in timings:
+ raise ValueError(f"{context}: duplicate measurement {key!r}")
+ timings[key] = timing
+ if not timings:
+ raise ValueError("No SIFT runtime measurements found")
+ return timings
+
+
+def describe_environment(paths: list[Path], cpu_label: str | None = None) -> str:
+ """Build a hardware subtitle and reject mixed GPU or PyTorch environments."""
+ metadata = [json.loads(path.read_text())["metadata"] for path in paths]
+ for key in ("python", "input_sha256", "torch_num_threads", "opencv_num_threads"):
+ values = {str(meta.get(key)) for meta in metadata}
+ if len(values) != 1 or "None" in values:
+ raise ValueError(f"Input metadata must agree on {key}")
+ labels = []
+ for key in ("cuda_device", "cpu_model", "torch"):
+ values = {str(meta[key]) for meta in metadata if meta.get(key)}
+ if len(values) > 1:
+ raise ValueError(f"Cannot combine different {key} environments: {sorted(values)}")
+ value = next(iter(values), None)
+ if key == "cpu_model":
+ labels.append(cpu_label or value or "CPU model not recorded")
+ elif key == "torch":
+ if value is None:
+ raise ValueError("Input metadata must record the PyTorch version")
+ labels.append(f"PyTorch {value.split('+')[0].split('.dev')[0]}")
+ elif value:
+ labels.append(value)
+ return " · ".join(labels)
+
+
+def describe_outputs(paths: list[Path]) -> str:
+ """Disclose returned work, without calling historical LAF slots valid detections."""
+ counts: dict[str, set[int]] = {"Kornia": set(), "OpenCV": set()}
+ for path in paths:
+ for row in json.loads(path.read_text())["results"]:
+ label = "OpenCV" if row["series"] == "OpenCV" else "Kornia"
+ values = row.get("features_per_image")
+ if not isinstance(values, list) or len(values) != row["batch"]:
+ raise ValueError(f"{path}: expected one output count per image")
+ if any(isinstance(value, bool) or not isinstance(value, int) or value < 0 for value in values):
+ raise ValueError(f"{path}: output counts must be nonnegative integers")
+ counts[label].update(values)
+ labels = []
+ for label, values in counts.items():
+ if values:
+ count = str(min(values)) if len(values) == 1 else f"{min(values)}\N{EN DASH}{max(values)}"
+ unit = "keypoints" if label == "OpenCV" else "nonzero LAF/descriptor slots"
+ labels.append(f"{label}: {count} {unit}/image")
+ return "; ".join(labels) + ". RootSIFT enabled; native detection/filtering differ."
+
+
+def plot_runtime(
+ timings: dict[tuple[str, str, int], tuple[float, float]],
+ output: Path,
+ environment: str = "",
+ output_note: str = "",
+) -> None:
+ """Write a grouped logarithmic chart with explicit missing measurements."""
+ import matplotlib as mpl
+
+ mpl.use("Agg")
+ import matplotlib.pyplot as plt
+ from matplotlib.lines import Line2D
+ from matplotlib.patches import Patch
+ from matplotlib.ticker import LogLocator, NullFormatter, ScalarFormatter
+
+ low = min(median for median, _ in timings.values()) / 2.2
+ high = max(median + iqr / 2 for median, iqr in timings.values()) * 2.4
+ clipped = any(median - iqr / 2 < low for median, iqr in timings.values())
+ with plt.rc_context({"font.family": "DejaVu Sans", "font.size": 11, "svg.fonttype": "none"}):
+ fig, ax = plt.subplots(figsize=(12, 7.5))
+ fig.subplots_adjust(left=0.085, right=0.975, bottom=0.30, top=0.77)
+ ax.set_yscale("log")
+ ax.set_ylim(low, high)
+ ax.set_xlim(-0.57, 3.57)
+ ax.set_axisbelow(True)
+ ax.grid(axis="y", which="major", color="#b9bec5", linewidth=0.8)
+ ax.grid(axis="y", which="minor", color="#d9dde1", linewidth=0.6, linestyle=":")
+ ax.yaxis.set_major_locator(LogLocator(base=10))
+ ax.yaxis.set_major_formatter(ScalarFormatter())
+ ax.yaxis.set_minor_formatter(NullFormatter())
+ for boundary in (0.5, 1.5, 2.5):
+ ax.axvline(boundary, color="#e0e3e6", linewidth=0.8)
+
+ width = 0.158
+ for group_index, (device, batch) in enumerate(GROUPS):
+ group_series = SERIES if device == "cpu" else SERIES[:-1]
+ for series_index, series in enumerate(group_series):
+ x = group_index + (series_index - (len(group_series) - 1) / 2) * width
+ color = COLORS[series_index]
+ timing = timings.get((series, device, batch))
+ if timing is None:
+ ax.text(
+ x,
+ 0.025,
+ "not measured",
+ transform=ax.get_xaxis_transform(),
+ rotation=90,
+ ha="center",
+ va="bottom",
+ color=color,
+ fontsize=8,
+ )
+ continue
+ median, iqr = timing
+ ax.bar(x, median, width=width * 0.92, color=color, zorder=3)
+ ax.errorbar(
+ x,
+ median,
+ yerr=[[min(iqr / 2, median - low)], [iqr / 2]],
+ fmt="none",
+ ecolor="#30343a",
+ elinewidth=0.9,
+ capsize=2,
+ zorder=4,
+ )
+ label = f"{median:,.2f}" if median >= 0.01 else f"{median:.2g}"
+ ax.annotate(
+ label,
+ (x, median + iqr / 2),
+ xytext=(0, 5),
+ textcoords="offset points",
+ ha="left",
+ va="bottom",
+ rotation=35,
+ rotation_mode="anchor",
+ fontsize=8.5,
+ fontweight="medium",
+ zorder=5,
+ )
+
+ handles = [
+ Patch(facecolor=color, label=series if series != "OpenCV" else "OpenCV (CPU only)")
+ for series, color in zip(SERIES, COLORS)
+ ]
+ opencv = timings.get(("OpenCV", "cpu", 1))
+ if opencv is not None:
+ ax.axhline(opencv[0], color=COLORS[-1], linestyle="--", linewidth=1.2, zorder=4)
+ handles.append(Line2D([0], [0], color=COLORS[-1], linestyle="--", label="OpenCV CPU reference"))
+ fig.legend(
+ handles=handles,
+ loc="upper center",
+ bbox_to_anchor=(0.53, 0.835),
+ ncol=3,
+ frameon=False,
+ fontsize=10,
+ columnspacing=2.1,
+ handlelength=2,
+ )
+ ax.set_xticks(range(len(GROUPS)), GROUP_LABELS)
+ ax.tick_params(axis="x", length=0, pad=10)
+ ax.set_ylabel("Median runtime [ms/image] · log scale", labelpad=10)
+ ax.spines[["top", "right"]].set_visible(False)
+ fig.suptitle(
+ "SIFT (DoG + SIFT descriptor) runtime", x=0.085, y=0.97, ha="left", fontsize=19, fontweight="semibold"
+ )
+ fig.text(
+ 0.085,
+ 0.905,
+ "Oxford graf img1 · 640\N{MULTIPLICATION SIGN}800 · 4096 requested features · lower is faster",
+ fontsize=11,
+ color="#51565d",
+ )
+ fig.text(0.085, 0.867, environment, fontsize=10, color="#51565d")
+ caption = (
+ "True batches of a repeated image; batch latency divided by batch size. CPU: one thread. "
+ "GPU: transfers excluded.\n"
+ "Historical source versions run on the same PyTorch stack; native presets differ in detection quality.\n"
+ "Current + compile: detector pyramid, response and refinement only.\n"
+ "Whiskers: median ± IQR/2 (spread, not confidence intervals). "
+ "OpenCV is measured on CPU only."
+ )
+ if clipped:
+ caption += "\nLower whiskers clipped at the logarithmic axis floor."
+ if output_note:
+ caption += "\n" + output_note
+ fig.text(0.085, 0.19, caption, ha="left", va="top", fontsize=9.2, linespacing=1.65, color="#51565d")
+ output.parent.mkdir(parents=True, exist_ok=True)
+ for suffix in (".png", ".svg"):
+ path = output.with_suffix(suffix)
+ fig.savefig(path, dpi=200, facecolor="white")
+ print(path)
+ plt.close(fig)
+
+
+def main() -> None:
+ parser = argparse.ArgumentParser(description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter)
+ parser.add_argument("--inputs", type=Path, nargs="+", required=True, help="Runtime benchmark JSON files")
+ parser.add_argument("--output", type=Path, required=True, help="Output basename; writes .png and .svg")
+ parser.add_argument("--cpu-label", help="CPU model label if absent from the benchmark metadata")
+ args = parser.parse_args()
+ try:
+ timings = load_rows(args.inputs)
+ environment = describe_environment(args.inputs, args.cpu_label)
+ output_note = describe_outputs(args.inputs)
+ except (OSError, ValueError) as error:
+ parser.error(str(error))
+ try:
+ plot_runtime(timings, args.output, environment, output_note)
+ except ModuleNotFoundError as error:
+ if error.name and error.name.startswith("matplotlib"):
+ print("SKIP: Matplotlib is not installed; install the project's plotting dependencies to render charts.")
+ return
+ raise
+
+
+if __name__ == "__main__":
+ main()
diff --git a/benchmarks/feature/sift_runtime.md b/benchmarks/feature/sift_runtime.md
new file mode 100644
index 000000000..39424bd54
--- /dev/null
+++ b/benchmarks/feature/sift_runtime.md
@@ -0,0 +1,133 @@
+# SIFT runtime across releases and batch sizes
+
+Measured 2026-09-05 on an RTX 4090 and Intel Core i7-14700K, WSL2 Linux,
+Python 3.11.14, PyTorch 2.14.0+cu130, OpenCV 4.11.0. CPU and OpenCV use one thread.
+All historical Kornia sources run on this **same current dependency stack**, not
+their original release environments.
+
+![SIFT runtime across releases and batch sizes](sift_runtime.png)
+
+[Vector SVG](sift_runtime.svg) · [Raw JSON measurements](sift_runtime_results/)
+
+## Results
+
+Median runtime in **milliseconds per image**, lower is faster. CUDA batch timings
+are divided by batch size. Each cell is median ± IQR; chart whiskers show ± IQR/2
+as a spread indicator, not a confidence interval.
+
+| Version/backend | CPU, BS=1 | CUDA, BS=1 | CUDA, BS=4 | CUDA, BS=8 |
+| --- | ---: | ---: | ---: | ---: |
+| 0.8.2 | 4810.53 ± 139.17 | 126.64 ± 16.35 | 112.10 ± 3.72 | 111.83 ± 1.64 |
+| 0.8.3 | 2389.58 ± 20.53 | 107.70 ± 9.46 | 53.80 ± 2.26 | 44.92 ± 1.55 |
+| Current | 1567.26 ± 25.61 | 60.43 ± 16.58 | 28.66 ± 4.20 | 23.20 ± 1.26 |
+| Current + compile | 2091.50 ± 27.13 | 36.56 ± 9.63 | 22.99 ± 0.53 | 21.67 ± 1.08 |
+| OpenCV, CPU only | 87.03 ± 3.45 | — | — | — |
+
+Batching matters: current eager runtime per image falls by 2.60× from CUDA batch
+one to batch eight; compiled runtime falls by 1.69×. Compilation's additional gain
+shrinks as batch size grows: approximately 1.65×, 1.25×, and 1.07× at batches one,
+four, and eight. The small batch-eight difference deserves caution given timing
+spread. The older 0.8.2 implementation barely benefits from batching here.
+
+Compilation is **1.33× slower on CPU** for this preset and machine. The chart keeps
+that regression. These observations establish the measured batching relationship,
+not the cause of the CPU compiler regression; a causal attribution would need
+component-level ablations.
+
+OpenCV is a CPU reference line across the CUDA categories, not an OpenCV CUDA
+measurement. Its native detector returns **2,678 keypoints**, while all Kornia
+runs return **4,096 nonzero LAF/descriptor slots**, despite the same requested cap.
+Historical nonzero slots are not necessarily valid detections: older versions
+could retain LAFs whose response had been rejected. This comparison exposes the
+native workloads; it does not assert equal detection quality or descriptor work.
+
+## Workload and provenance
+
+- One original Oxford graf `img1.ppm`, 640×800, repeated into a contiguous tensor
+ batch of one, four, or eight. It is a **true batch**, not a loop over GPU images.
+ Repetition controls image content while isolating the effect of batch size.
+- Public `SIFTFeatureScaleSpace(num_features=4096, upright=False, rootsift=True)`
+ from each source revision. Each native preset retains its detector/refiner,
+ including changes introduced between releases. Common settings include three
+ pyramid levels plus three extra levels, sigma 1.6, doubled image, minimum octave
+ size 32, measurement-region factor 6, 19-pixel orientation patches, and 41-pixel
+ RootSIFT descriptor patches. No settings were reduced to make a faster bar.
+- The chart differs from the earlier [graf pair benchmark](graf_benchmark.md): it
+ uses the public preset's `ConvQuadInterp3d`, not `AdaptiveQuadInterp3d` with
+ 32-pixel descriptor patches, and times extraction only rather than two extractions
+ plus matching. Do not compare the absolute timings between those two workloads.
+- Current compilation uses `compile_modules=["scale_pyr", "resp", "subpix"]`,
+ `dynamic=True`, default Inductor mode. Orientation, patch description, and the
+ surrounding pipeline remain eager. No autocast; matmul TF32 is disabled, with
+ cuDNN defaults recorded in JSON.
+- OpenCV uses `SIFT_create(nfeatures=4096, nOctaveLayers=3, contrastThreshold=0.04,
+ edgeThreshold=10, sigma=1.6)`, `detectAndCompute`, then NumPy RootSIFT normalization.
+ Its native contrast/edge filtering differs from Kornia. OpenCV receives resident
+ grayscale uint8 input; Kornia receives resident grayscale float32 input in [0,1].
+- Timed region: extraction only, excluding input preparation/transfer, compilation,
+ matching, and RANSAC. `common.time_us` supplies warmed repeated, CUDA-synchronized
+ median/IQR timings; the budget is at least five warm-call durations for slow CPU runs.
+- All 17 configurations completed successfully, in sequential independent processes.
+ Every run prints the explicit interpreter and asserts the expected imported
+ checkout, preventing editable-install mistakes. Source hashes, input SHA-256,
+ complete model representations, output counts, and memory are in the raw JSON.
+
+| Label | Source revision |
+| --- | --- |
+| 0.8.2 | `v0.8.2`, `856fd1ae` |
+| 0.8.3 | `v0.8.3`, `d6bb4bf0` |
+| Current / current + compile | `0dbcad81`, the optimization branch |
+| OpenCV | 4.11.0; harness revision `15d548fb` |
+
+Each compiled configuration used a fresh Inductor cache. First calls, including
+compilation and initialization, took 78.23 s on CPU and 44.82/55.83/57.72 s on CUDA
+at batch sizes one/four/eight. These are excluded from the plotted steady-state
+times, and are not pure compiler-time measurements.
+
+At CUDA batch eight, peak extra allocated tensor memory is approximately 14,610 MiB
+for 0.8.2, 4,487 MiB for 0.8.3, 5,171 MiB for current eager, and 5,510 MiB for current
+compiled. This is above resident inputs/models, not allocator-reserved memory.
+
+## Reproduction
+
+Use the [graf dataset and archive hash](graf_benchmark.md#reproduction). Run one
+configuration per process; select CPU batch one and CUDA batches one, four, eight:
+
+```bash
+.venv/bin/python -m benchmarks.feature.sift_runtime \
+ --image /data/graf/img1.ppm --expected-checkout "$PWD" \
+ --device cuda --batch 8 --series current --json current-cuda-8.json
+.venv/bin/python -m benchmarks.feature.sift_runtime \
+ --image /data/graf/img1.ppm --expected-checkout "$PWD" \
+ --device cuda --batch 8 --series 'current + compile' --json compiled-cuda-8.json
+.venv/bin/python -m benchmarks.feature.sift_runtime \
+ --image /data/graf/img1.ppm --expected-checkout "$PWD" \
+ --device cpu --batch 1 --series OpenCV --json opencv-cpu-1.json
+```
+
+For historical revisions, create detached worktrees and invoke the shared harness
+from stdin in each worktree root. Substitute your primary checkout's absolute path:
+
+```bash
+git worktree add --detach /tmp/kornia-sift-0.8.2 v0.8.2
+cd /tmp/kornia-sift-0.8.2
+/absolute/primary/.venv/bin/python - \
+ --image /data/graf/img1.ppm --expected-checkout "$PWD" \
+ --device cuda --batch 8 --series 0.8.2 --json /tmp/0.8.2-cuda-8.json <<'PY'
+import runpy
+runpy.run_path('/absolute/primary/benchmarks/feature/sift_runtime.py', run_name='__main__')
+PY
+```
+
+Repeat for tag `v0.8.3` and the other device/batch combinations. Re-render the
+committed measurements from the primary checkout:
+
+```bash
+.venv/bin/python -m benchmarks.feature.plot_sift_runtime \
+ --inputs benchmarks/feature/sift_runtime_results/*.json \
+ --output benchmarks/feature/sift_runtime --cpu-label 'Intel Core i7-14700K'
+```
+
+The renderer checks shapes, feature budget, source-input hash, Python/PyTorch,
+thread settings, and GPU metadata before combining results. Missing measurements
+are marked explicitly rather than plotted as zero. Matplotlib is optional.
diff --git a/benchmarks/feature/sift_runtime.png b/benchmarks/feature/sift_runtime.png
new file mode 100644
index 000000000..8c633d714
Binary files /dev/null and b/benchmarks/feature/sift_runtime.png differ
diff --git a/benchmarks/feature/sift_runtime.py b/benchmarks/feature/sift_runtime.py
new file mode 100644
index 000000000..9b5cad5df
--- /dev/null
+++ b/benchmarks/feature/sift_runtime.py
@@ -0,0 +1,178 @@
+# LICENSE HEADER MANAGED BY add-license-header
+#
+# Copyright 2018 Kornia Team
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+"""Historical public scale-space SIFT runtime, including true CUDA image batches.
+
+Run one configuration per process from the checkout being measured. For old
+worktrees, invoke this file with runpy from stdin (see graf_benchmark.md), so the
+editable install cannot silently replace the historical Kornia import.
+
+Uses each release's native SIFTFeatureScaleSpace preset with 4096 features,
+orientation and RootSIFT enabled. Historical refinement algorithms differ; this
+is a release comparison, not an isolated ablation or a quality-equivalence claim.
+The input is Oxford graf img1 repeated into a contiguous batch. CPU uses one
+thread. Transfers, initialization, compilation, matching, and RANSAC are outside
+steady-state timing. Raw median/IQR are BATCH latency; divide by B for ms/image.
+OpenCV is a one-thread uint8 CPU detectAndCompute call plus RootSIFT normalization,
+using its native contrast/edge filtering. It is not a GPU or batched baseline.
+The features_per_image field counts nonzero LAF output slots for Kornia, not
+verified valid detections: historical releases could retain rejected LAFs.
+"""
+
+from __future__ import annotations
+
+import argparse
+import hashlib
+import importlib.util
+import math
+import sys
+import time
+from pathlib import Path
+
+import numpy as np
+import torch
+
+import kornia
+from kornia.feature import SIFTFeatureScaleSpace
+
+sys.path.insert(0, str(Path(__file__).resolve().parents[1]))
+from common import collect_load_metrics, run_metadata, save_json, time_us, versions_line
+
+
+def main() -> None:
+ parser = argparse.ArgumentParser(description=__doc__)
+ parser.add_argument("--image", type=Path, required=True)
+ parser.add_argument("--expected-checkout", type=Path, required=True)
+ parser.add_argument("--device", choices=("cpu", "cuda"), default="cpu")
+ parser.add_argument("--batch", type=int, choices=(1, 4, 8), default=1)
+ parser.add_argument("--series", choices=("0.8.2", "0.8.3", "current", "current + compile", "OpenCV"), required=True)
+ parser.add_argument("--nf", type=int, default=4096)
+ parser.add_argument("--min-run-time", type=float, default=5.0)
+ parser.add_argument("--json", type=Path, required=True)
+ args = parser.parse_args()
+ if importlib.util.find_spec("cv2") is None:
+ raise SystemExit("SKIP: this benchmark requires the optional opencv-python package")
+ import cv2
+
+ imported_root = Path(kornia.__file__).resolve().parents[1]
+ print(f"# interpreter: {sys.executable}\n# kornia: {kornia.__file__}", flush=True)
+ if imported_root != args.expected_checkout.resolve():
+ raise RuntimeError(f"Wrong Kornia checkout: {imported_root}")
+ if args.device == "cpu" and args.batch != 1:
+ parser.error("CPU comparisons use batch one")
+ if args.series == "OpenCV" and (args.device != "cpu" or args.batch != 1):
+ parser.error("OpenCV is a CPU batch-one reference")
+ torch.manual_seed(0)
+ torch.set_num_threads(1)
+ cv2.setNumThreads(1)
+ torch.backends.cuda.matmul.allow_tf32 = False
+ device = torch.device(args.device)
+ pixels = cv2.imread(str(args.image), cv2.IMREAD_GRAYSCALE)
+ if pixels is None:
+ raise FileNotFoundError(args.image)
+ meta = run_metadata(device)
+ meta["load"] = collect_load_metrics()
+ compiled = args.series == "current + compile"
+ meta.update(
+ series=args.series,
+ seed=0,
+ image=args.image.name,
+ input_sha256=hashlib.sha256(args.image.read_bytes()).hexdigest(),
+ num_features=args.nf,
+ compile=compiled,
+ compile_scope=["scale_pyr", "resp", "subpix"] if compiled else [],
+ compile_dynamic=True if compiled else None,
+ timing="feature extraction only; raw batch latency; transfers/compilation/matching/RANSAC excluded",
+ batch_regime="same graf image repeated as a true tensor batch",
+ opencv_num_threads=cv2.getNumThreads(),
+ cudnn_allow_tf32=torch.backends.cudnn.allow_tf32,
+ cudnn_benchmark=torch.backends.cudnn.benchmark,
+ historical_presets="native release defaults; refinement algorithms and quality differ",
+ min_run_time=args.min_run_time,
+ )
+ print(f"# {meta['git_commit']} | {args.series} | {device} | B={args.batch}", flush=True)
+ print(versions_line(meta), flush=True)
+ if args.series == "OpenCV":
+ model = cv2.SIFT_create(nfeatures=args.nf, nOctaveLayers=3, contrastThreshold=0.04, edgeThreshold=10, sigma=1.6)
+
+ def run():
+ keypoints, descriptors = model.detectAndCompute(pixels, None)
+ if descriptors is not None:
+ descriptors = np.sqrt(descriptors / (np.abs(descriptors).sum(axis=1, keepdims=True) + 1e-8))
+ return keypoints, descriptors
+
+ else:
+ kwargs = {"compile_modules": ["scale_pyr", "resp", "subpix"]} if compiled else {}
+ model = SIFTFeatureScaleSpace(
+ num_features=args.nf, upright=False, rootsift=True, device=device, **kwargs
+ ).eval()
+ inputs = torch.from_numpy(pixels).to(device=device, dtype=torch.float32)[None, None].div(255)
+ inputs = inputs.repeat(args.batch, 1, 1, 1)
+ meta["model_repr"] = repr(model)
+
+ def run():
+ return model(inputs)
+
+ if device.type == "cuda":
+ torch.cuda.synchronize()
+ start = time.perf_counter()
+ run()
+ if device.type == "cuda":
+ torch.cuda.synchronize()
+ initial_seconds = time.perf_counter() - start
+ print(f"# Initial call (including any compilation): {initial_seconds:.3f} s", flush=True)
+ if device.type == "cuda":
+ torch.cuda.reset_peak_memory_stats(device)
+ memory_before = torch.cuda.memory_allocated(device)
+ start = time.perf_counter()
+ output = run()
+ if device.type == "cuda":
+ torch.cuda.synchronize()
+ warm_seconds = time.perf_counter() - start
+ peak_bytes = torch.cuda.max_memory_allocated(device) - memory_before if device.type == "cuda" else None
+ features = (
+ [len(output[0])] if args.series == "OpenCV" else output[0].ne(0).any(dim=-1).any(dim=-1).sum(dim=-1).tolist()
+ )
+ del output
+ median, iqr = time_us(run, min_run_time=max(args.min_run_time, 5 * warm_seconds))
+ if not math.isfinite(median):
+ raise RuntimeError(f"Timing failed: {args.series}, {device}, B={args.batch}")
+ row = {
+ "op": "OpenCV SIFT" if args.series == "OpenCV" else "SIFTFeatureScaleSpace",
+ "series": args.series,
+ "backend": "opencv"
+ if args.series == "OpenCV"
+ else ("kornia (selectively compiled)" if compiled else "kornia (eager)"),
+ "device": args.device,
+ "batch": args.batch,
+ "height": pixels.shape[0],
+ "width": pixels.shape[1],
+ "dtype": "uint8 input/float32 descriptor" if args.series == "OpenCV" else "float32",
+ "median_us": median,
+ "iqr_us": iqr,
+ "throughput_per_s": args.batch * 1e6 / median,
+ "features_per_image": features,
+ "peak_extra_cuda_bytes": peak_bytes,
+ "initial_call_seconds": initial_seconds,
+ }
+ save_json(args.json, meta, [row])
+ print(f"# {median / args.batch / 1000:.3f} ms/image, IQR {iqr / args.batch / 1000:.3f} ms/image", flush=True)
+ print(f"# features/image: {features}", flush=True)
+
+
+if __name__ == "__main__":
+ main()
diff --git a/benchmarks/feature/sift_runtime.svg b/benchmarks/feature/sift_runtime.svg
new file mode 100644
index 000000000..dcea6b7b6
--- /dev/null
+++ b/benchmarks/feature/sift_runtime.svg
@@ -0,0 +1,995 @@
+<?xml version="1.0" encoding="utf-8" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
+ "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+<svg xmlns:xlink="http://www.w3.org/1999/xlink" width="864pt" height="540pt" viewBox="0 0 864 540" xmlns="http://www.w3.org/2000/svg" version="1.1">
+ <metadata>
+ <rdf:RDF xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://creativecommons.org/ns#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
+ <cc:Work>
+ <dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/>
+ <dc:date>2026-09-05T19:47:54.726777</dc:date>
+ <dc:format>image/svg+xml</dc:format>
+ <dc:creator>
+ <cc:Agent>
+ <dc:title>Matplotlib v3.10.8, https://matplotlib.org/</dc:title>
+ </cc:Agent>
+ </dc:creator>
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <defs>
+ <style type="text/css">*{stroke-linejoin: round; stroke-linecap: butt}</style>
+ </defs>
+ <g id="figure_1">
+ <g id="patch_1">
+ <path d="M 0 540
+L 864 540
+L 864 0
+L 0 0
+z
+" style="fill: #ffffff"/>
+ </g>
+ <g id="axes_1">
+ <g id="patch_2">
+ <path d="M 73.44 378
+L 842.4 378
+L 842.4 124.2
+L 73.44 124.2
+z
+" style="fill: #ffffff"/>
+ </g>
+ <g id="matplotlib.axis_1">
+ <g id="xtick_1">
+ <g id="line2d_1"/>
+ <g id="text_1">
+ <text style="font-size: 11px; font-family: 'DejaVu Sans'; text-anchor: middle" x="179.311304" y="396.358281" transform="rotate(-0 179.311304 396.358281)">CPU (BS=1)</text>
+ </g>
+ </g>
+ <g id="xtick_2">
+ <g id="line2d_2"/>
+ <g id="text_2">
+ <text style="font-size: 11px; font-family: 'DejaVu Sans'; text-anchor: middle" x="365.050435" y="396.358281" transform="rotate(-0 365.050435 396.358281)">CUDA BS=1</text>
+ </g>
+ </g>
+ <g id="xtick_3">
+ <g id="line2d_3"/>
+ <g id="text_3">
+ <text style="font-size: 11px; font-family: 'DejaVu Sans'; text-anchor: middle" x="550.789565" y="396.358281" transform="rotate(-0 550.789565 396.358281)">CUDA BS=4</text>
+ </g>
+ </g>
+ <g id="xtick_4">
+ <g id="line2d_4"/>
+ <g id="text_4">
+ <text style="font-size: 11px; font-family: 'DejaVu Sans'; text-anchor: middle" x="736.528696" y="396.358281" transform="rotate(-0 736.528696 396.358281)">CUDA BS=8</text>
+ </g>
+ </g>
+ </g>
+ <g id="matplotlib.axis_2">
+ <g id="ytick_1">
+ <g id="line2d_5">
+ <path d="M 73.44 377.454129
+L 842.4 377.454129
+" clip-path="url(#pa8a8fb88de)" style="fill: none; stroke: #b9bec5; stroke-width: 0.8; stroke-linecap: square"/>
+ </g>
+ <g id="line2d_6">
+ <defs>
+ <path id="maf34acee87" d="M 0 0
+L -3.5 0
+" style="stroke: #000000; stroke-width: 0.8"/>
+ </defs>
+ <g>
+ <use xlink:href="#maf34acee87" x="73.44" y="377.454129" style="stroke: #000000; stroke-width: 0.8"/>
+ </g>
+ </g>
+ <g id="text_5">
+ <text style="font-size: 11px; font-family: 'DejaVu Sans'; text-anchor: end" x="66.44" y="381.63327" transform="rotate(-0 66.44 381.63327)">10</text>
+ </g>
+ </g>
+ <g id="ytick_2">
+ <g id="line2d_7">
+ <path d="M 73.44 294.924397
+L 842.4 294.924397
+" clip-path="url(#pa8a8fb88de)" style="fill: none; stroke: #b9bec5; stroke-width: 0.8; stroke-linecap: square"/>
+ </g>
+ <g id="line2d_8">
+ <g>
+ <use xlink:href="#maf34acee87" x="73.44" y="294.924397" style="stroke: #000000; stroke-width: 0.8"/>
+ </g>
+ </g>
+ <g id="text_6">
+ <text style="font-size: 11px; font-family: 'DejaVu Sans'; text-anchor: end" x="66.44" y="299.103538" transform="rotate(-0 66.44 299.103538)">100</text>
+ </g>
+ </g>
+ <g id="ytick_3">
+ <g id="line2d_9">
+ <path d="M 73.44 212.394665
+L 842.4 212.394665
+" clip-path="url(#pa8a8fb88de)" style="fill: none; stroke: #b9bec5; stroke-width: 0.8; stroke-linecap: square"/>
+ </g>
+ <g id="line2d_10">
+ <g>
+ <use xlink:href="#maf34acee87" x="73.44" y="212.394665" style="stroke: #000000; stroke-width: 0.8"/>
+ </g>
+ </g>
+ <g id="text_7">
+ <text style="font-size: 11px; font-family: 'DejaVu Sans'; text-anchor: end" x="66.44" y="216.573806" transform="rotate(-0 66.44 216.573806)">1000</text>
+ </g>
+ </g>
+ <g id="ytick_4">
+ <g id="line2d_11">
+ <path d="M 73.44 129.864934
+L 842.4 129.864934
+" clip-path="url(#pa8a8fb88de)" style="fill: none; stroke: #b9bec5; stroke-width: 0.8; stroke-linecap: square"/>
+ </g>
+ <g id="line2d_12">
+ <g>
+ <use xlink:href="#maf34acee87" x="73.44" y="129.864934" style="stroke: #000000; stroke-width: 0.8"/>
+ </g>
+ </g>
+ <g id="text_8">
+ <text style="font-size: 11px; font-family: 'DejaVu Sans'; text-anchor: end" x="66.44" y="134.044074" transform="rotate(-0 66.44 134.044074)">10000</text>
+ </g>
+ </g>
+ <g id="ytick_5">
+ <g id="line2d_13">
+ <path d="M 73.44 352.610204
+L 842.4 352.610204
+" clip-path="url(#pa8a8fb88de)" style="fill: none; stroke-dasharray: 0.6,0.99; stroke-dashoffset: 0; stroke: #d9dde1; stroke-width: 0.6"/>
+ </g>
+ <g id="line2d_14">
+ <defs>
+ <path id="m39818b2826" d="M 0 0
+L -2 0
+" style="stroke: #000000; stroke-width: 0.6"/>
+ </defs>
+ <g>
+ <use xlink:href="#m39818b2826" x="73.44" y="352.610204" style="stroke: #000000; stroke-width: 0.6"/>
+ </g>
+ </g>
+ </g>
+ <g id="ytick_6">
+ <g id="line2d_15">
+ <path d="M 73.44 338.07744
+L 842.4 338.07744
+" clip-path="url(#pa8a8fb88de)" style="fill: none; stroke-dasharray: 0.6,0.99; stroke-dashoffset: 0; stroke: #d9dde1; stroke-width: 0.6"/>
+ </g>
+ <g id="line2d_16">
+ <g>
+ <use xlink:href="#m39818b2826" x="73.44" y="338.07744" style="stroke: #000000; stroke-width: 0.6"/>
+ </g>
+ </g>
+ </g>
+ <g id="ytick_7">
+ <g id="line2d_17">
+ <path d="M 73.44 327.766279
+L 842.4 327.766279
+" clip-path="url(#pa8a8fb88de)" style="fill: none; stroke-dasharray: 0.6,0.99; stroke-dashoffset: 0; stroke: #d9dde1; stroke-width: 0.6"/>
+ </g>
+ <g id="line2d_18">
+ <g>
+ <use xlink:href="#m39818b2826" x="73.44" y="327.766279" style="stroke: #000000; stroke-width: 0.6"/>
+ </g>
+ </g>
+ </g>
+ <g id="ytick_8">
+ <g id="line2d_19">
+ <path d="M 73.44 319.768322
+L 842.4 319.768322
+" clip-path="url(#pa8a8fb88de)" style="fill: none; stroke-dasharray: 0.6,0.99; stroke-dashoffset: 0; stroke: #d9dde1; stroke-width: 0.6"/>
+ </g>
+ <g id="line2d_20">
+ <g>
+ <use xlink:href="#m39818b2826" x="73.44" y="319.768322" style="stroke: #000000; stroke-width: 0.6"/>
+ </g>
+ </g>
+ </g>
+ <g id="ytick_9">
+ <g id="line2d_21">
+ <path d="M 73.44 313.233515
+L 842.4 313.233515
+" clip-path="url(#pa8a8fb88de)" style="fill: none; stroke-dasharray: 0.6,0.99; stroke-dashoffset: 0; stroke: #d9dde1; stroke-width: 0.6"/>
+ </g>
+ <g id="line2d_22">
+ <g>
+ <use xlink:href="#m39818b2826" x="73.44" y="313.233515" style="stroke: #000000; stroke-width: 0.6"/>
+ </g>
+ </g>
+ </g>
+ <g id="ytick_10">
+ <g id="line2d_23">
+ <path d="M 73.44 307.708414
+L 842.4 307.708414
+" clip-path="url(#pa8a8fb88de)" style="fill: none; stroke-dasharray: 0.6,0.99; stroke-dashoffset: 0; stroke: #d9dde1; stroke-width: 0.6"/>
+ </g>
+ <g id="line2d_24">
+ <g>
+ <use xlink:href="#m39818b2826" x="73.44" y="307.708414" style="stroke: #000000; stroke-width: 0.6"/>
+ </g>
+ </g>
+ </g>
+ <g id="ytick_11">
+ <g id="line2d_25">
+ <path d="M 73.44 302.922355
+L 842.4 302.922355
+" clip-path="url(#pa8a8fb88de)" style="fill: none; stroke-dasharray: 0.6,0.99; stroke-dashoffset: 0; stroke: #d9dde1; stroke-width: 0.6"/>
+ </g>
+ <g id="line2d_26">
+ <g>
+ <use xlink:href="#m39818b2826" x="73.44" y="302.922355" style="stroke: #000000; stroke-width: 0.6"/>
+ </g>
+ </g>
+ </g>
+ <g id="ytick_12">
+ <g id="line2d_27">
+ <path d="M 73.44 298.700751
+L 842.4 298.700751
+" clip-path="url(#pa8a8fb88de)" style="fill: none; stroke-dasharray: 0.6,0.99; stroke-dashoffset: 0; stroke: #d9dde1; stroke-width: 0.6"/>
+ </g>
+ <g id="line2d_28">
+ <g>
+ <use xlink:href="#m39818b2826" x="73.44" y="298.700751" style="stroke: #000000; stroke-width: 0.6"/>
+ </g>
+ </g>
+ </g>
+ <g id="ytick_13">
+ <g id="line2d_29">
+ <path d="M 73.44 270.080472
+L 842.4 270.080472
+" clip-path="url(#pa8a8fb88de)" style="fill: none; stroke-dasharray: 0.6,0.99; stroke-dashoffset: 0; stroke: #d9dde1; stroke-width: 0.6"/>
+ </g>
+ <g id="line2d_30">
+ <g>
+ <use xlink:href="#m39818b2826" x="73.44" y="270.080472" style="stroke: #000000; stroke-width: 0.6"/>
+ </g>
+ </g>
+ </g>
+ <g id="ytick_14">
+ <g id="line2d_31">
+ <path d="M 73.44 255.547708
+L 842.4 255.547708
+" clip-path="url(#pa8a8fb88de)" style="fill: none; stroke-dasharray: 0.6,0.99; stroke-dashoffset: 0; stroke: #d9dde1; stroke-width: 0.6"/>
+ </g>
+ <g id="line2d_32">
+ <g>
+ <use xlink:href="#m39818b2826" x="73.44" y="255.547708" style="stroke: #000000; stroke-width: 0.6"/>
+ </g>
+ </g>
+ </g>
+ <g id="ytick_15">
+ <g id="line2d_33">
+ <path d="M 73.44 245.236548
+L 842.4 245.236548
+" clip-path="url(#pa8a8fb88de)" style="fill: none; stroke-dasharray: 0.6,0.99; stroke-dashoffset: 0; stroke: #d9dde1; stroke-width: 0.6"/>
+ </g>
+ <g id="line2d_34">
+ <g>
+ <use xlink:href="#m39818b2826" x="73.44" y="245.236548" style="stroke: #000000; stroke-width: 0.6"/>
+ </g>
+ </g>
+ </g>
+ <g id="ytick_16">
+ <g id="line2d_35">
+ <path d="M 73.44 237.23859
+L 842.4 237.23859
+" clip-path="url(#pa8a8fb88de)" style="fill: none; stroke-dasharray: 0.6,0.99; stroke-dashoffset: 0; stroke: #d9dde1; stroke-width: 0.6"/>
+ </g>
+ <g id="line2d_36">
+ <g>
+ <use xlink:href="#m39818b2826" x="73.44" y="237.23859" style="stroke: #000000; stroke-width: 0.6"/>
+ </g>
+ </g>
+ </g>
+ <g id="ytick_17">
+ <g id="line2d_37">
+ <path d="M 73.44 230.703783
+L 842.4 230.703783
+" clip-path="url(#pa8a8fb88de)" style="fill: none; stroke-dasharray: 0.6,0.99; stroke-dashoffset: 0; stroke: #d9dde1; stroke-width: 0.6"/>
+ </g>
+ <g id="line2d_38">
+ <g>
+ <use xlink:href="#m39818b2826" x="73.44" y="230.703783" style="stroke: #000000; stroke-width: 0.6"/>
+ </g>
+ </g>
+ </g>
+ <g id="ytick_18">
+ <g id="line2d_39">
+ <path d="M 73.44 225.178683
+L 842.4 225.178683
+" clip-path="url(#pa8a8fb88de)" style="fill: none; stroke-dasharray: 0.6,0.99; stroke-dashoffset: 0; stroke: #d9dde1; stroke-width: 0.6"/>
+ </g>
+ <g id="line2d_40">
+ <g>
+ <use xlink:href="#m39818b2826" x="73.44" y="225.178683" style="stroke: #000000; stroke-width: 0.6"/>
+ </g>
+ </g>
+ </g>
+ <g id="ytick_19">
+ <g id="line2d_41">
+ <path d="M 73.44 220.392623
+L 842.4 220.392623
+" clip-path="url(#pa8a8fb88de)" style="fill: none; stroke-dasharray: 0.6,0.99; stroke-dashoffset: 0; stroke: #d9dde1; stroke-width: 0.6"/>
+ </g>
+ <g id="line2d_42">
+ <g>
+ <use xlink:href="#m39818b2826" x="73.44" y="220.392623" style="stroke: #000000; stroke-width: 0.6"/>
+ </g>
+ </g>
+ </g>
+ <g id="ytick_20">
+ <g id="line2d_43">
+ <path d="M 73.44 216.171019
+L 842.4 216.171019
+" clip-path="url(#pa8a8fb88de)" style="fill: none; stroke-dasharray: 0.6,0.99; stroke-dashoffset: 0; stroke: #d9dde1; stroke-width: 0.6"/>
+ </g>
+ <g id="line2d_44">
+ <g>
+ <use xlink:href="#m39818b2826" x="73.44" y="216.171019" style="stroke: #000000; stroke-width: 0.6"/>
+ </g>
+ </g>
+ </g>
+ <g id="ytick_21">
+ <g id="line2d_45">
+ <path d="M 73.44 187.550741
+L 842.4 187.550741
+" clip-path="url(#pa8a8fb88de)" style="fill: none; stroke-dasharray: 0.6,0.99; stroke-dashoffset: 0; stroke: #d9dde1; stroke-width: 0.6"/>
+ </g>
+ <g id="line2d_46">
+ <g>
+ <use xlink:href="#m39818b2826" x="73.44" y="187.550741" style="stroke: #000000; stroke-width: 0.6"/>
+ </g>
+ </g>
+ </g>
+ <g id="ytick_22">
+ <g id="line2d_47">
+ <path d="M 73.44 173.017976
+L 842.4 173.017976
+" clip-path="url(#pa8a8fb88de)" style="fill: none; stroke-dasharray: 0.6,0.99; stroke-dashoffset: 0; stroke: #d9dde1; stroke-width: 0.6"/>
+ </g>
+ <g id="line2d_48">
+ <g>
+ <use xlink:href="#m39818b2826" x="73.44" y="173.017976" style="stroke: #000000; stroke-width: 0.6"/>
+ </g>
+ </g>
+ </g>
+ <g id="ytick_23">
+ <g id="line2d_49">
+ <path d="M 73.44 162.706816
+L 842.4 162.706816
+" clip-path="url(#pa8a8fb88de)" style="fill: none; stroke-dasharray: 0.6,0.99; stroke-dashoffset: 0; stroke: #d9dde1; stroke-width: 0.6"/>
+ </g>
+ <g id="line2d_50">
+ <g>
+ <use xlink:href="#m39818b2826" x="73.44" y="162.706816" style="stroke: #000000; stroke-width: 0.6"/>
+ </g>
+ </g>
+ </g>
+ <g id="ytick_24">
+ <g id="line2d_51">
+ <path d="M 73.44 154.708858
+L 842.4 154.708858
+" clip-path="url(#pa8a8fb88de)" style="fill: none; stroke-dasharray: 0.6,0.99; stroke-dashoffset: 0; stroke: #d9dde1; stroke-width: 0.6"/>
+ </g>
+ <g id="line2d_52">
+ <g>
+ <use xlink:href="#m39818b2826" x="73.44" y="154.708858" style="stroke: #000000; stroke-width: 0.6"/>
+ </g>
+ </g>
+ </g>
+ <g id="ytick_25">
+ <g id="line2d_53">
+ <path d="M 73.44 148.174051
+L 842.4 148.174051
+" clip-path="url(#pa8a8fb88de)" style="fill: none; stroke-dasharray: 0.6,0.99; stroke-dashoffset: 0; stroke: #d9dde1; stroke-width: 0.6"/>
+ </g>
+ <g id="line2d_54">
+ <g>
+ <use xlink:href="#m39818b2826" x="73.44" y="148.174051" style="stroke: #000000; stroke-width: 0.6"/>
+ </g>
+ </g>
+ </g>
+ <g id="ytick_26">
+ <g id="line2d_55">
+ <path d="M 73.44 142.648951
+L 842.4 142.648951
+" clip-path="url(#pa8a8fb88de)" style="fill: none; stroke-dasharray: 0.6,0.99; stroke-dashoffset: 0; stroke: #d9dde1; stroke-width: 0.6"/>
+ </g>
+ <g id="line2d_56">
+ <g>
+ <use xlink:href="#m39818b2826" x="73.44" y="142.648951" style="stroke: #000000; stroke-width: 0.6"/>
+ </g>
+ </g>
+ </g>
+ <g id="ytick_27">
+ <g id="line2d_57">
+ <path d="M 73.44 137.862891
+L 842.4 137.862891
+" clip-path="url(#pa8a8fb88de)" style="fill: none; stroke-dasharray: 0.6,0.99; stroke-dashoffset: 0; stroke: #d9dde1; stroke-width: 0.6"/>
+ </g>
+ <g id="line2d_58">
+ <g>
+ <use xlink:href="#m39818b2826" x="73.44" y="137.862891" style="stroke: #000000; stroke-width: 0.6"/>
+ </g>
+ </g>
+ </g>
+ <g id="ytick_28">
+ <g id="line2d_59">
+ <path d="M 73.44 133.641287
+L 842.4 133.641287
+" clip-path="url(#pa8a8fb88de)" style="fill: none; stroke-dasharray: 0.6,0.99; stroke-dashoffset: 0; stroke: #d9dde1; stroke-width: 0.6"/>
+ </g>
+ <g id="line2d_60">
+ <g>
+ <use xlink:href="#m39818b2826" x="73.44" y="133.641287" style="stroke: #000000; stroke-width: 0.6"/>
+ </g>
+ </g>
+ </g>
+ <g id="text_9">
+ <text style="font-size: 11px; font-family: 'DejaVu Sans'; text-anchor: middle" x="19.158594" y="251.1" transform="rotate(-90 19.158594 251.1)">Median runtime [ms/image] · log scale</text>
+ </g>
+ </g>
+ <g id="line2d_61">
+ <path d="M 272.18087 378
+L 272.18087 124.2
+" clip-path="url(#pa8a8fb88de)" style="fill: none; stroke: #e0e3e6; stroke-width: 0.8; stroke-linecap: square"/>
+ </g>
+ <g id="line2d_62">
+ <path d="M 457.92 378
+L 457.92 124.2
+" clip-path="url(#pa8a8fb88de)" style="fill: none; stroke: #e0e3e6; stroke-width: 0.8; stroke-linecap: square"/>
+ </g>
+ <g id="line2d_63">
+ <path d="M 643.65913 378
+L 643.65913 124.2
+" clip-path="url(#pa8a8fb88de)" style="fill: none; stroke: #e0e3e6; stroke-width: 0.8; stroke-linecap: square"/>
+ </g>
+ <g id="patch_3">
+ <path d="M 73.44 378
+L 73.44 124.2
+" style="fill: none; stroke: #000000; stroke-width: 0.8; stroke-linejoin: miter; stroke-linecap: square"/>
+ </g>
+ <g id="patch_4">
+ <path d="M 73.44 378
+L 842.4 378
+" style="fill: none; stroke: #000000; stroke-width: 0.8; stroke-linejoin: miter; stroke-linecap: square"/>
+ </g>
+ <g id="patch_5">
+ <path d="M 107.118219 82989.715651
+L 134.117259 82989.715651
+L 134.117259 156.093476
+L 107.118219 156.093476
+z
+" clip-path="url(#pa8a8fb88de)" style="fill: #2549e8"/>
+ </g>
+ <g id="patch_6">
+ <path d="M 136.465002 82989.715651
+L 163.464042 82989.715651
+L 163.464042 181.171959
+L 136.465002 181.171959
+z
+" clip-path="url(#pa8a8fb88de)" style="fill: #7972c5"/>
+ </g>
+ <g id="patch_7">
+ <path d="M 165.811784 82989.715651
+L 192.810824 82989.715651
+L 192.810824 196.289613
+L 165.811784 196.289613
+z
+" clip-path="url(#pa8a8fb88de)" style="fill: #ffae00"/>
+ </g>
+ <g id="patch_8">
+ <path d="M 195.158567 82989.715651
+L 222.157607 82989.715651
+L 222.157607 185.947382
+L 195.158567 185.947382
+z
+" clip-path="url(#pa8a8fb88de)" style="fill: #a71920"/>
+ </g>
+ <g id="patch_9">
+ <path d="M 224.50535 82989.715651
+L 251.50439 82989.715651
+L 251.50439 299.903256
+L 224.50535 299.903256
+z
+" clip-path="url(#pa8a8fb88de)" style="fill: #228b32"/>
+ </g>
+ <g id="patch_10">
+ <path d="M 307.530741 82989.715651
+L 334.529781 82989.715651
+L 334.529781 286.459707
+L 307.530741 286.459707
+z
+" clip-path="url(#pa8a8fb88de)" style="fill: #2549e8"/>
+ </g>
+ <g id="patch_11">
+ <path d="M 336.877523 82989.715651
+L 363.876563 82989.715651
+L 363.876563 292.2644
+L 336.877523 292.2644
+z
+" clip-path="url(#pa8a8fb88de)" style="fill: #7972c5"/>
+ </g>
+ <g id="patch_12">
+ <path d="M 366.224306 82989.715651
+L 393.223346 82989.715651
+L 393.223346 312.977488
+L 366.224306 312.977488
+z
+" clip-path="url(#pa8a8fb88de)" style="fill: #ffae00"/>
+ </g>
+ <g id="patch_13">
+ <path d="M 395.571089 82989.715651
+L 422.570129 82989.715651
+L 422.570129 330.990713
+L 395.571089 330.990713
+z
+" clip-path="url(#pa8a8fb88de)" style="fill: #a71920"/>
+ </g>
+ <g id="patch_14">
+ <path d="M 493.269871 82989.715651
+L 520.268911 82989.715651
+L 520.268911 290.829357
+L 493.269871 290.829357
+z
+" clip-path="url(#pa8a8fb88de)" style="fill: #2549e8"/>
+ </g>
+ <g id="patch_15">
+ <path d="M 522.616654 82989.715651
+L 549.615694 82989.715651
+L 549.615694 317.144553
+L 522.616654 317.144553
+z
+" clip-path="url(#pa8a8fb88de)" style="fill: #7972c5"/>
+ </g>
+ <g id="patch_16">
+ <path d="M 551.963437 82989.715651
+L 578.962477 82989.715651
+L 578.962477 339.709129
+L 551.963437 339.709129
+z
+" clip-path="url(#pa8a8fb88de)" style="fill: #ffae00"/>
+ </g>
+ <g id="patch_17">
+ <path d="M 581.310219 82989.715651
+L 608.309259 82989.715651
+L 608.309259 347.622813
+L 581.310219 347.622813
+z
+" clip-path="url(#pa8a8fb88de)" style="fill: #a71920"/>
+ </g>
+ <g id="patch_18">
+ <path d="M 679.009002 82989.715651
+L 706.008042 82989.715651
+L 706.008042 290.917293
+L 679.009002 290.917293
+z
+" clip-path="url(#pa8a8fb88de)" style="fill: #2549e8"/>
+ </g>
+ <g id="patch_19">
+ <path d="M 708.355784 82989.715651
+L 735.354824 82989.715651
+L 735.354824 323.607248
+L 708.355784 323.607248
+z
+" clip-path="url(#pa8a8fb88de)" style="fill: #7972c5"/>
+ </g>
+ <g id="patch_20">
+ <path d="M 737.702567 82989.715651
+L 764.701607 82989.715651
+L 764.701607 347.284166
+L 737.702567 347.284166
+z
+" clip-path="url(#pa8a8fb88de)" style="fill: #ffae00"/>
+ </g>
+ <g id="patch_21">
+ <path d="M 767.04935 82989.715651
+L 794.04839 82989.715651
+L 794.04839 349.739948
+L 767.04935 349.739948
+z
+" clip-path="url(#pa8a8fb88de)" style="fill: #a71920"/>
+ </g>
+ <g id="LineCollection_1">
+ <path d="M 120.617739 156.61572
+L 120.617739 155.578732
+" clip-path="url(#pa8a8fb88de)" style="fill: none; stroke: #30343a; stroke-width: 0.9"/>
+ </g>
+ <g id="line2d_64">
+ <defs>
+ <path id="m6072d93f7e" d="M 2 0
+L -2 -0
+" style="stroke: #30343a"/>
+ </defs>
+ <g clip-path="url(#pa8a8fb88de)">
+ <use xlink:href="#m6072d93f7e" x="120.617739" y="156.61572" style="fill: #1f77b4; stroke: #30343a"/>
+ </g>
+ </g>
+ <g id="line2d_65">
+ <g clip-path="url(#pa8a8fb88de)">
+ <use xlink:href="#m6072d93f7e" x="120.617739" y="155.578732" style="fill: #1f77b4; stroke: #30343a"/>
+ </g>
+ </g>
+ <g id="LineCollection_2">
+ <path d="M 149.964522 181.326252
+L 149.964522 181.018328
+" clip-path="url(#pa8a8fb88de)" style="fill: none; stroke: #30343a; stroke-width: 0.9"/>
+ </g>
+ <g id="line2d_66">
+ <g clip-path="url(#pa8a8fb88de)">
+ <use xlink:href="#m6072d93f7e" x="149.964522" y="181.326252" style="fill: #1f77b4; stroke: #30343a"/>
+ </g>
+ </g>
+ <g id="line2d_67">
+ <g clip-path="url(#pa8a8fb88de)">
+ <use xlink:href="#m6072d93f7e" x="149.964522" y="181.018328" style="fill: #1f77b4; stroke: #30343a"/>
+ </g>
+ </g>
+ <g id="LineCollection_3">
+ <path d="M 179.311304 196.583609
+L 179.311304 195.998008
+" clip-path="url(#pa8a8fb88de)" style="fill: none; stroke: #30343a; stroke-width: 0.9"/>
+ </g>
+ <g id="line2d_68">
+ <g clip-path="url(#pa8a8fb88de)">
+ <use xlink:href="#m6072d93f7e" x="179.311304" y="196.583609" style="fill: #1f77b4; stroke: #30343a"/>
+ </g>
+ </g>
+ <g id="line2d_69">
+ <g clip-path="url(#pa8a8fb88de)">
+ <use xlink:href="#m6072d93f7e" x="179.311304" y="195.998008" style="fill: #1f77b4; stroke: #30343a"/>
+ </g>
+ </g>
+ <g id="LineCollection_4">
+ <path d="M 208.658087 186.180584
+L 208.658087 185.715688
+" clip-path="url(#pa8a8fb88de)" style="fill: none; stroke: #30343a; stroke-width: 0.9"/>
+ </g>
+ <g id="line2d_70">
+ <g clip-path="url(#pa8a8fb88de)">
+ <use xlink:href="#m6072d93f7e" x="208.658087" y="186.180584" style="fill: #1f77b4; stroke: #30343a"/>
+ </g>
+ </g>
+ <g id="line2d_71">
+ <g clip-path="url(#pa8a8fb88de)">
+ <use xlink:href="#m6072d93f7e" x="208.658087" y="185.715688" style="fill: #1f77b4; stroke: #30343a"/>
+ </g>
+ </g>
+ <g id="LineCollection_5">
+ <path d="M 238.00487 300.620206
+L 238.00487 299.200368
+" clip-path="url(#pa8a8fb88de)" style="fill: none; stroke: #30343a; stroke-width: 0.9"/>
+ </g>
+ <g id="line2d_72">
+ <g clip-path="url(#pa8a8fb88de)">
+ <use xlink:href="#m6072d93f7e" x="238.00487" y="300.620206" style="fill: #1f77b4; stroke: #30343a"/>
+ </g>
+ </g>
+ <g id="line2d_73">
+ <g clip-path="url(#pa8a8fb88de)">
+ <use xlink:href="#m6072d93f7e" x="238.00487" y="299.200368" style="fill: #1f77b4; stroke: #30343a"/>
+ </g>
+ </g>
+ <g id="LineCollection_6">
+ <path d="M 321.030261 288.851504
+L 321.030261 284.217583
+" clip-path="url(#pa8a8fb88de)" style="fill: none; stroke: #30343a; stroke-width: 0.9"/>
+ </g>
+ <g id="line2d_74">
+ <g clip-path="url(#pa8a8fb88de)">
+ <use xlink:href="#m6072d93f7e" x="321.030261" y="288.851504" style="fill: #1f77b4; stroke: #30343a"/>
+ </g>
+ </g>
+ <g id="line2d_75">
+ <g clip-path="url(#pa8a8fb88de)">
+ <use xlink:href="#m6072d93f7e" x="321.030261" y="284.217583" style="fill: #1f77b4; stroke: #30343a"/>
+ </g>
+ </g>
+ <g id="LineCollection_7">
+ <path d="M 350.377043 293.873481
+L 350.377043 290.724462
+" clip-path="url(#pa8a8fb88de)" style="fill: none; stroke: #30343a; stroke-width: 0.9"/>
+ </g>
+ <g id="line2d_76">
+ <g clip-path="url(#pa8a8fb88de)">
+ <use xlink:href="#m6072d93f7e" x="350.377043" y="293.873481" style="fill: #1f77b4; stroke: #30343a"/>
+ </g>
+ </g>
+ <g id="line2d_77">
+ <g clip-path="url(#pa8a8fb88de)">
+ <use xlink:href="#m6072d93f7e" x="350.377043" y="290.724462" style="fill: #1f77b4; stroke: #30343a"/>
+ </g>
+ </g>
+ <g id="LineCollection_8">
+ <path d="M 379.723826 318.265388
+L 379.723826 308.370365
+" clip-path="url(#pa8a8fb88de)" style="fill: none; stroke: #30343a; stroke-width: 0.9"/>
+ </g>
+ <g id="line2d_78">
+ <g clip-path="url(#pa8a8fb88de)">
+ <use xlink:href="#m6072d93f7e" x="379.723826" y="318.265388" style="fill: #1f77b4; stroke: #30343a"/>
+ </g>
+ </g>
+ <g id="line2d_79">
+ <g clip-path="url(#pa8a8fb88de)">
+ <use xlink:href="#m6072d93f7e" x="379.723826" y="308.370365" style="fill: #1f77b4; stroke: #30343a"/>
+ </g>
+ </g>
+ <g id="LineCollection_9">
+ <path d="M 409.070609 336.055281
+L 409.070609 326.553978
+" clip-path="url(#pa8a8fb88de)" style="fill: none; stroke: #30343a; stroke-width: 0.9"/>
+ </g>
+ <g id="line2d_80">
+ <g clip-path="url(#pa8a8fb88de)">
+ <use xlink:href="#m6072d93f7e" x="409.070609" y="336.055281" style="fill: #1f77b4; stroke: #30343a"/>
+ </g>
+ </g>
+ <g id="line2d_81">
+ <g clip-path="url(#pa8a8fb88de)">
+ <use xlink:href="#m6072d93f7e" x="409.070609" y="326.553978" style="fill: #1f77b4; stroke: #30343a"/>
+ </g>
+ </g>
+ <g id="LineCollection_10">
+ <path d="M 506.769391 291.42913
+L 506.769391 290.239456
+" clip-path="url(#pa8a8fb88de)" style="fill: none; stroke: #30343a; stroke-width: 0.9"/>
+ </g>
+ <g id="line2d_82">
+ <g clip-path="url(#pa8a8fb88de)">
+ <use xlink:href="#m6072d93f7e" x="506.769391" y="291.42913" style="fill: #1f77b4; stroke: #30343a"/>
+ </g>
+ </g>
+ <g id="line2d_83">
+ <g clip-path="url(#pa8a8fb88de)">
+ <use xlink:href="#m6072d93f7e" x="506.769391" y="290.239456" style="fill: #1f77b4; stroke: #30343a"/>
+ </g>
+ </g>
+ <g id="LineCollection_11">
+ <path d="M 536.116174 317.906562
+L 536.116174 316.398408
+" clip-path="url(#pa8a8fb88de)" style="fill: none; stroke: #30343a; stroke-width: 0.9"/>
+ </g>
+ <g id="line2d_84">
+ <g clip-path="url(#pa8a8fb88de)">
+ <use xlink:href="#m6072d93f7e" x="536.116174" y="317.906562" style="fill: #1f77b4; stroke: #30343a"/>
+ </g>
+ </g>
+ <g id="line2d_85">
+ <g clip-path="url(#pa8a8fb88de)">
+ <use xlink:href="#m6072d93f7e" x="536.116174" y="316.398408" style="fill: #1f77b4; stroke: #30343a"/>
+ </g>
+ </g>
+ <g id="LineCollection_12">
+ <path d="M 565.462957 342.437278
+L 565.462957 337.174028
+" clip-path="url(#pa8a8fb88de)" style="fill: none; stroke: #30343a; stroke-width: 0.9"/>
+ </g>
+ <g id="line2d_86">
+ <g clip-path="url(#pa8a8fb88de)">
+ <use xlink:href="#m6072d93f7e" x="565.462957" y="342.437278" style="fill: #1f77b4; stroke: #30343a"/>
+ </g>
+ </g>
+ <g id="line2d_87">
+ <g clip-path="url(#pa8a8fb88de)">
+ <use xlink:href="#m6072d93f7e" x="565.462957" y="337.174028" style="fill: #1f77b4; stroke: #30343a"/>
+ </g>
+ </g>
+ <g id="LineCollection_13">
+ <path d="M 594.809739 348.042102
+L 594.809739 347.208373
+" clip-path="url(#pa8a8fb88de)" style="fill: none; stroke: #30343a; stroke-width: 0.9"/>
+ </g>
+ <g id="line2d_88">
+ <g clip-path="url(#pa8a8fb88de)">
+ <use xlink:href="#m6072d93f7e" x="594.809739" y="348.042102" style="fill: #1f77b4; stroke: #30343a"/>
+ </g>
+ </g>
+ <g id="line2d_89">
+ <g clip-path="url(#pa8a8fb88de)">
+ <use xlink:href="#m6072d93f7e" x="594.809739" y="347.208373" style="fill: #1f77b4; stroke: #30343a"/>
+ </g>
+ </g>
+ <g id="LineCollection_14">
+ <path d="M 692.508522 291.181862
+L 692.508522 290.654663
+" clip-path="url(#pa8a8fb88de)" style="fill: none; stroke: #30343a; stroke-width: 0.9"/>
+ </g>
+ <g id="line2d_90">
+ <g clip-path="url(#pa8a8fb88de)">
+ <use xlink:href="#m6072d93f7e" x="692.508522" y="291.181862" style="fill: #1f77b4; stroke: #30343a"/>
+ </g>
+ </g>
+ <g id="line2d_91">
+ <g clip-path="url(#pa8a8fb88de)">
+ <use xlink:href="#m6072d93f7e" x="692.508522" y="290.654663" style="fill: #1f77b4; stroke: #30343a"/>
+ </g>
+ </g>
+ <g id="LineCollection_15">
+ <path d="M 721.855304 324.230412
+L 721.855304 322.994735
+" clip-path="url(#pa8a8fb88de)" style="fill: none; stroke: #30343a; stroke-width: 0.9"/>
+ </g>
+ <g id="line2d_92">
+ <g clip-path="url(#pa8a8fb88de)">
+ <use xlink:href="#m6072d93f7e" x="721.855304" y="324.230412" style="fill: #1f77b4; stroke: #30343a"/>
+ </g>
+ </g>
+ <g id="line2d_93">
+ <g clip-path="url(#pa8a8fb88de)">
+ <use xlink:href="#m6072d93f7e" x="721.855304" y="322.994735" style="fill: #1f77b4; stroke: #30343a"/>
+ </g>
+ </g>
+ <g id="LineCollection_16">
+ <path d="M 751.202087 348.274044
+L 751.202087 346.320893
+" clip-path="url(#pa8a8fb88de)" style="fill: none; stroke: #30343a; stroke-width: 0.9"/>
+ </g>
+ <g id="line2d_94">
+ <g clip-path="url(#pa8a8fb88de)">
+ <use xlink:href="#m6072d93f7e" x="751.202087" y="348.274044" style="fill: #1f77b4; stroke: #30343a"/>
+ </g>
+ </g>
+ <g id="line2d_95">
+ <g clip-path="url(#pa8a8fb88de)">
+ <use xlink:href="#m6072d93f7e" x="751.202087" y="346.320893" style="fill: #1f77b4; stroke: #30343a"/>
+ </g>
+ </g>
+ <g id="LineCollection_17">
+ <path d="M 780.54887 350.641733
+L 780.54887 348.860296
+" clip-path="url(#pa8a8fb88de)" style="fill: none; stroke: #30343a; stroke-width: 0.9"/>
+ </g>
+ <g id="line2d_96">
+ <g clip-path="url(#pa8a8fb88de)">
+ <use xlink:href="#m6072d93f7e" x="780.54887" y="350.641733" style="fill: #1f77b4; stroke: #30343a"/>
+ </g>
+ </g>
+ <g id="line2d_97">
+ <g clip-path="url(#pa8a8fb88de)">
+ <use xlink:href="#m6072d93f7e" x="780.54887" y="348.860296" style="fill: #1f77b4; stroke: #30343a"/>
+ </g>
+ </g>
+ <g id="line2d_98">
+ <path d="M 73.44 299.903256
+L 842.4 299.903256
+" clip-path="url(#pa8a8fb88de)" style="fill: none; stroke-dasharray: 4.44,1.92; stroke-dashoffset: 0; stroke: #228b32; stroke-width: 1.2"/>
+ </g>
+ <g id="text_10">
+ <text style="font-weight: 500; font-size: 8.5px; font-family: 'DejaVu Sans'; text-anchor: start" x="119.603808" y="149.130689" transform="rotate(-35 119.603808 149.130689)">4,810.53</text>
+ </g>
+ <g id="text_11">
+ <text style="font-weight: 500; font-size: 8.5px; font-family: 'DejaVu Sans'; text-anchor: start" x="148.950591" y="174.570284" transform="rotate(-35 148.950591 174.570284)">2,389.58</text>
+ </g>
+ <g id="text_12">
+ <text style="font-weight: 500; font-size: 8.5px; font-family: 'DejaVu Sans'; text-anchor: start" x="178.297374" y="189.549965" transform="rotate(-35 178.297374 189.549965)">1,567.26</text>
+ </g>
+ <g id="text_13">
+ <text style="font-weight: 500; font-size: 8.5px; font-family: 'DejaVu Sans'; text-anchor: start" x="207.644156" y="179.267644" transform="rotate(-35 207.644156 179.267644)">2,091.50</text>
+ </g>
+ <g id="text_14">
+ <text style="font-weight: 500; font-size: 8.5px; font-family: 'DejaVu Sans'; text-anchor: start" x="236.990939" y="292.752324" transform="rotate(-35 236.990939 292.752324)">87.03</text>
+ </g>
+ <g id="text_15">
+ <text style="font-weight: 500; font-size: 8.5px; font-family: 'DejaVu Sans'; text-anchor: start" x="320.01633" y="277.769539" transform="rotate(-35 320.01633 277.769539)">126.64</text>
+ </g>
+ <g id="text_16">
+ <text style="font-weight: 500; font-size: 8.5px; font-family: 'DejaVu Sans'; text-anchor: start" x="349.363113" y="284.276419" transform="rotate(-35 349.363113 284.276419)">107.70</text>
+ </g>
+ <g id="text_17">
+ <text style="font-weight: 500; font-size: 8.5px; font-family: 'DejaVu Sans'; text-anchor: start" x="378.709895" y="301.922322" transform="rotate(-35 378.709895 301.922322)">60.43</text>
+ </g>
+ <g id="text_18">
+ <text style="font-weight: 500; font-size: 8.5px; font-family: 'DejaVu Sans'; text-anchor: start" x="408.056678" y="320.105934" transform="rotate(-35 408.056678 320.105934)">36.56</text>
+ </g>
+ <g id="text_19">
+ <text style="font-weight: 500; font-size: 8.5px; font-family: 'DejaVu Sans'; text-anchor: start" x="505.755461" y="283.791412" transform="rotate(-35 505.755461 283.791412)">112.10</text>
+ </g>
+ <g id="text_20">
+ <text style="font-weight: 500; font-size: 8.5px; font-family: 'DejaVu Sans'; text-anchor: start" x="535.102243" y="309.950364" transform="rotate(-35 535.102243 309.950364)">53.80</text>
+ </g>
+ <g id="text_21">
+ <text style="font-weight: 500; font-size: 8.5px; font-family: 'DejaVu Sans'; text-anchor: start" x="564.449026" y="330.725985" transform="rotate(-35 564.449026 330.725985)">28.66</text>
+ </g>
+ <g id="text_22">
+ <text style="font-weight: 500; font-size: 8.5px; font-family: 'DejaVu Sans'; text-anchor: start" x="593.795808" y="340.760329" transform="rotate(-35 593.795808 340.760329)">22.99</text>
+ </g>
+ <g id="text_23">
+ <text style="font-weight: 500; font-size: 8.5px; font-family: 'DejaVu Sans'; text-anchor: start" x="691.494591" y="284.20662" transform="rotate(-35 691.494591 284.20662)">111.83</text>
+ </g>
+ <g id="text_24">
+ <text style="font-weight: 500; font-size: 8.5px; font-family: 'DejaVu Sans'; text-anchor: start" x="720.841374" y="316.546691" transform="rotate(-35 720.841374 316.546691)">44.92</text>
+ </g>
+ <g id="text_25">
+ <text style="font-weight: 500; font-size: 8.5px; font-family: 'DejaVu Sans'; text-anchor: start" x="750.188156" y="339.87285" transform="rotate(-35 750.188156 339.87285)">23.20</text>
+ </g>
+ <g id="text_26">
+ <text style="font-weight: 500; font-size: 8.5px; font-family: 'DejaVu Sans'; text-anchor: start" x="779.534939" y="342.412253" transform="rotate(-35 779.534939 342.412253)">21.67</text>
+ </g>
+ </g>
+ <g id="text_27">
+ <text style="font-weight: 600; font-size: 19px; font-family: 'DejaVu Sans'; text-anchor: start" x="73.44" y="30.637031" transform="rotate(-0 73.44 30.637031)">SIFT (DoG + SIFT descriptor) runtime</text>
+ </g>
+ <g id="text_28">
+ <text style="font-size: 11px; font-family: 'DejaVu Sans'; text-anchor: start; fill: #51565d" x="73.44" y="51.3" transform="rotate(-0 73.44 51.3)">Oxford graf img1 · 640×800 · 4096 requested features · lower is faster</text>
+ </g>
+ <g id="text_29">
+ <text style="font-size: 10px; font-family: 'DejaVu Sans'; text-anchor: start; fill: #51565d" x="73.44" y="71.82" transform="rotate(-0 73.44 71.82)">NVIDIA GeForce RTX 4090 · Intel Core i7-14700K · PyTorch 2.14.0</text>
+ </g>
+ <g id="text_30">
+ <text style="font-size: 9.2px; font-family: 'DejaVu Sans'; fill: #51565d" transform="translate(73.44 444.390562)">True batches of a repeated image; batch latency divided by batch size. CPU: one thread. GPU: transfers excluded.</text>
+ <text style="font-size: 9.2px; font-family: 'DejaVu Sans'; fill: #51565d" transform="translate(73.44 457.838303)">Historical source versions run on the same PyTorch stack; native presets differ in detection quality.</text>
+ <text style="font-size: 9.2px; font-family: 'DejaVu Sans'; fill: #51565d" transform="translate(73.44 471.286044)">Current + compile: detector pyramid, response and refinement only.</text>
+ <text style="font-size: 9.2px; font-family: 'DejaVu Sans'; fill: #51565d" transform="translate(73.44 484.733784)">Whiskers: median ± IQR/2 (spread, not confidence intervals). OpenCV is measured on CPU only.</text>
+ <text style="font-size: 9.2px; font-family: 'DejaVu Sans'; fill: #51565d" transform="translate(73.44 498.181525)">Kornia: 4096 nonzero LAF/descriptor slots/image; OpenCV: 2678 keypoints/image. RootSIFT enabled; native detection/filtering differ.</text>
+ </g>
+ <g id="legend_1">
+ <g id="patch_22">
+ <path d="M 279.606719 105.698438
+L 299.606719 105.698438
+L 299.606719 98.698438
+L 279.606719 98.698438
+z
+" style="fill: #2549e8"/>
+ </g>
+ <g id="text_31">
+ <text style="font-size: 10px; font-family: 'DejaVu Sans'; text-anchor: start" x="307.606719" y="105.698438" transform="rotate(-0 307.606719 105.698438)">0.8.2</text>
+ </g>
+ <g id="patch_23">
+ <path d="M 279.606719 120.376563
+L 299.606719 120.376563
+L 299.606719 113.376563
+L 279.606719 113.376563
+z
+" style="fill: #7972c5"/>
+ </g>
+ <g id="text_32">
+ <text style="font-size: 10px; font-family: 'DejaVu Sans'; text-anchor: start" x="307.606719" y="120.376563" transform="rotate(-0 307.606719 120.376563)">0.8.3</text>
+ </g>
+ <g id="patch_24">
+ <path d="M 354.050469 105.698438
+L 374.050469 105.698438
+L 374.050469 98.698438
+L 354.050469 98.698438
+z
+" style="fill: #ffae00"/>
+ </g>
+ <g id="text_33">
+ <text style="font-size: 10px; font-family: 'DejaVu Sans'; text-anchor: start" x="382.050469" y="105.698438" transform="rotate(-0 382.050469 105.698438)">current</text>
+ </g>
+ <g id="patch_25">
+ <path d="M 354.050469 120.376563
+L 374.050469 120.376563
+L 374.050469 113.376563
+L 354.050469 113.376563
+z
+" style="fill: #a71920"/>
+ </g>
+ <g id="text_34">
+ <text style="font-size: 10px; font-family: 'DejaVu Sans'; text-anchor: start" x="382.050469" y="120.376563" transform="rotate(-0 382.050469 120.376563)">current + compile</text>
+ </g>
+ <g id="patch_26">
+ <path d="M 493.270781 105.698438
+L 513.270781 105.698438
+L 513.270781 98.698438
+L 493.270781 98.698438
+z
+" style="fill: #228b32"/>
+ </g>
+ <g id="text_35">
+ <text style="font-size: 10px; font-family: 'DejaVu Sans'; text-anchor: start" x="521.270781" y="105.698438" transform="rotate(-0 521.270781 105.698438)">OpenCV (CPU only)</text>
+ </g>
+ <g id="line2d_99">
+ <path d="M 493.270781 116.876563
+L 503.270781 116.876563
+L 513.270781 116.876563
+" style="fill: none; stroke-dasharray: 5.55,2.4; stroke-dashoffset: 0; stroke: #228b32; stroke-width: 1.5"/>
+ </g>
+ <g id="text_36">
+ <text style="font-size: 10px; font-family: 'DejaVu Sans'; text-anchor: start" x="521.270781" y="120.376563" transform="rotate(-0 521.270781 120.376563)">OpenCV CPU reference</text>
+ </g>
+ </g>
+ </g>
+ <defs>
+ <clipPath id="pa8a8fb88de">
+ <rect x="73.44" y="124.2" width="768.96" height="253.8"/>
+ </clipPath>
+ </defs>
+</svg>
diff --git a/benchmarks/feature/sift_runtime_results/0.8.2-cpu-1.json b/benchmarks/feature/sift_runtime_results/0.8.2-cpu-1.json
new file mode 100644
index 000000000..6307f1c22
--- /dev/null
+++ b/benchmarks/feature/sift_runtime_results/0.8.2-cpu-1.json
@@ -0,0 +1,55 @@
+{
+ "metadata": {
+ "albumentations": null,
+ "batch_regime": "same graf image repeated as a true tensor batch",
+ "compile": false,
+ "compile_dynamic": null,
+ "compile_scope": [],
+ "cudnn_allow_tf32": true,
+ "cudnn_benchmark": false,
+ "device": "cpu",
+ "git_commit": "856fd1ae",
+ "historical_presets": "native release defaults; refinement algorithms and quality differ",
+ "image": "img1.ppm",
+ "input_sha256": "8d53092ffa5b27f5138ec458302f35e7c72a9f35d1f94078ca35944c4b3626dd",
+ "kornia": "0.8.2",
+ "kornia_rs": "0.1.10",
+ "machine": "x86_64",
+ "min_run_time": 5,
+ "model_repr": "SIFTFeatureScaleSpace(\n (detector): ScaleSpaceDetector(num_features=4096, mr_size=6.0, scale_pyr=ScalePyramid(n_levels=3, init_sigma=1.6, min_size=32, extra_levels=3, border=15, sigma_step=1.2599210498948732, double_image=True), resp=BlobDoG, nms=ConvQuadInterp3d(strict_maxima_bonus=10), ori=LAFOrienter(patch_size=19, angle_detector=PatchDominantGradientOrientation(patch_size=19, num_ang_bins=36, eps=1e-08)), aff=PassLAF())\n (descriptor): LAFDescriptor(descriptor=SIFTDescriptor(num_ang_bins=8, num_spatial_bins=4, patch_size=41, rootsift=True, clipval=0.2), patch_size=41, grayscale_descriptor='True)\n)",
+ "num_features": 4096,
+ "numpy": "2.4.0",
+ "opencv": "4.11.0",
+ "opencv_num_threads": 1,
+ "pillow": "12.3.0",
+ "platform": "Linux-6.18.33.2-microsoft-standard-WSL2-x86_64-with-glibc2.39",
+ "python": "3.11.14",
+ "seed": 0,
+ "series": "0.8.2",
+ "timestamp_utc": "2026-09-05T17:37:07+00:00",
+ "timing": "feature extraction only; raw batch latency; transfers/compilation/matching/RANSAC excluded",
+ "torch": "2.14.0+cu130",
+ "torch_num_threads": 1,
+ "torchvision": null
+ },
+ "results": [
+ {
+ "backend": "kornia (eager)",
+ "batch": 1,
+ "device": "cpu",
+ "dtype": "float32",
+ "features_per_image": [
+ 4096
+ ],
+ "height": 640,
+ "initial_call_seconds": 5.59779872800209,
+ "iqr_us": 139168.64300244924,
+ "median_us": 4810528.74100169,
+ "op": "SIFTFeatureScaleSpace",
+ "peak_extra_cuda_bytes": null,
+ "series": "0.8.2",
+ "throughput_per_s": 0.20787735690604592,
+ "width": 800
+ }
+ ]
+}
diff --git a/benchmarks/feature/sift_runtime_results/0.8.2-cuda-1.json b/benchmarks/feature/sift_runtime_results/0.8.2-cuda-1.json
new file mode 100644
index 000000000..11b2465ba
--- /dev/null
+++ b/benchmarks/feature/sift_runtime_results/0.8.2-cuda-1.json
@@ -0,0 +1,57 @@
+{
+ "metadata": {
+ "albumentations": null,
+ "batch_regime": "same graf image repeated as a true tensor batch",
+ "compile": false,
+ "compile_dynamic": null,
+ "compile_scope": [],
+ "cuda_device": "NVIDIA GeForce RTX 4090",
+ "cuda_version": "13.0",
+ "cudnn_allow_tf32": true,
+ "cudnn_benchmark": false,
+ "device": "cuda",
+ "git_commit": "856fd1ae",
+ "historical_presets": "native release defaults; refinement algorithms and quality differ",
+ "image": "img1.ppm",
+ "input_sha256": "8d53092ffa5b27f5138ec458302f35e7c72a9f35d1f94078ca35944c4b3626dd",
+ "kornia": "0.8.2",
+ "kornia_rs": "0.1.10",
+ "machine": "x86_64",
+ "min_run_time": 5,
+ "model_repr": "SIFTFeatureScaleSpace(\n (detector): ScaleSpaceDetector(num_features=4096, mr_size=6.0, scale_pyr=ScalePyramid(n_levels=3, init_sigma=1.6, min_size=32, extra_levels=3, border=15, sigma_step=1.2599210498948732, double_image=True), resp=BlobDoG, nms=ConvQuadInterp3d(strict_maxima_bonus=10), ori=LAFOrienter(patch_size=19, angle_detector=PatchDominantGradientOrientation(patch_size=19, num_ang_bins=36, eps=1e-08)), aff=PassLAF())\n (descriptor): LAFDescriptor(descriptor=SIFTDescriptor(num_ang_bins=8, num_spatial_bins=4, patch_size=41, rootsift=True, clipval=0.2), patch_size=41, grayscale_descriptor='True)\n)",
+ "num_features": 4096,
+ "numpy": "2.4.0",
+ "opencv": "4.11.0",
+ "opencv_num_threads": 1,
+ "pillow": "12.3.0",
+ "platform": "Linux-6.18.33.2-microsoft-standard-WSL2-x86_64-with-glibc2.39",
+ "python": "3.11.14",
+ "seed": 0,
+ "series": "0.8.2",
+ "timestamp_utc": "2026-09-05T17:37:54+00:00",
+ "timing": "feature extraction only; raw batch latency; transfers/compilation/matching/RANSAC excluded",
+ "torch": "2.14.0+cu130",
+ "torch_num_threads": 1,
+ "torchvision": null
+ },
+ "results": [
+ {
+ "backend": "kornia (eager)",
+ "batch": 1,
+ "device": "cuda",
+ "dtype": "float32",
+ "features_per_image": [
+ 4096
+ ],
+ "height": 640,
+ "initial_call_seconds": 0.8002390969995758,
+ "iqr_us": 16349.892501239083,
+ "median_us": 126638.37799846078,
+ "op": "SIFTFeatureScaleSpace",
+ "peak_extra_cuda_bytes": 2030630912,
+ "series": "0.8.2",
+ "throughput_per_s": 7.8965003800992655,
+ "width": 800
+ }
+ ]
+}
diff --git a/benchmarks/feature/sift_runtime_results/0.8.2-cuda-4.json b/benchmarks/feature/sift_runtime_results/0.8.2-cuda-4.json
new file mode 100644
index 000000000..b3b921bd1
--- /dev/null
+++ b/benchmarks/feature/sift_runtime_results/0.8.2-cuda-4.json
@@ -0,0 +1,60 @@
+{
+ "metadata": {
+ "albumentations": null,
+ "batch_regime": "same graf image repeated as a true tensor batch",
+ "compile": false,
+ "compile_dynamic": null,
+ "compile_scope": [],
+ "cuda_device": "NVIDIA GeForce RTX 4090",
+ "cuda_version": "13.0",
+ "cudnn_allow_tf32": true,
+ "cudnn_benchmark": false,
+ "device": "cuda",
+ "git_commit": "856fd1ae",
+ "historical_presets": "native release defaults; refinement algorithms and quality differ",
+ "image": "img1.ppm",
+ "input_sha256": "8d53092ffa5b27f5138ec458302f35e7c72a9f35d1f94078ca35944c4b3626dd",
+ "kornia": "0.8.2",
+ "kornia_rs": "0.1.10",
+ "machine": "x86_64",
+ "min_run_time": 5,
+ "model_repr": "SIFTFeatureScaleSpace(\n (detector): ScaleSpaceDetector(num_features=4096, mr_size=6.0, scale_pyr=ScalePyramid(n_levels=3, init_sigma=1.6, min_size=32, extra_levels=3, border=15, sigma_step=1.2599210498948732, double_image=True), resp=BlobDoG, nms=ConvQuadInterp3d(strict_maxima_bonus=10), ori=LAFOrienter(patch_size=19, angle_detector=PatchDominantGradientOrientation(patch_size=19, num_ang_bins=36, eps=1e-08)), aff=PassLAF())\n (descriptor): LAFDescriptor(descriptor=SIFTDescriptor(num_ang_bins=8, num_spatial_bins=4, patch_size=41, rootsift=True, clipval=0.2), patch_size=41, grayscale_descriptor='True)\n)",
+ "num_features": 4096,
+ "numpy": "2.4.0",
+ "opencv": "4.11.0",
+ "opencv_num_threads": 1,
+ "pillow": "12.3.0",
+ "platform": "Linux-6.18.33.2-microsoft-standard-WSL2-x86_64-with-glibc2.39",
+ "python": "3.11.14",
+ "seed": 0,
+ "series": "0.8.2",
+ "timestamp_utc": "2026-09-05T17:38:01+00:00",
+ "timing": "feature extraction only; raw batch latency; transfers/compilation/matching/RANSAC excluded",
+ "torch": "2.14.0+cu130",
+ "torch_num_threads": 1,
+ "torchvision": null
+ },
+ "results": [
+ {
+ "backend": "kornia (eager)",
+ "batch": 4,
+ "device": "cuda",
+ "dtype": "float32",
+ "features_per_image": [
+ 4096,
+ 4096,
+ 4096,
+ 4096
+ ],
+ "height": 640,
+ "initial_call_seconds": 0.995904999999766,
+ "iqr_us": 14882.382500218228,
+ "median_us": 448413.7910003483,
+ "op": "SIFTFeatureScaleSpace",
+ "peak_extra_cuda_bytes": 7720745472,
+ "series": "0.8.2",
+ "throughput_per_s": 8.920332247312379,
+ "width": 800
+ }
+ ]
+}
diff --git a/benchmarks/feature/sift_runtime_results/0.8.2-cuda-8.json b/benchmarks/feature/sift_runtime_results/0.8.2-cuda-8.json
new file mode 100644
index 000000000..332513951
--- /dev/null
+++ b/benchmarks/feature/sift_runtime_results/0.8.2-cuda-8.json
@@ -0,0 +1,64 @@
+{
+ "metadata": {
+ "albumentations": null,
+ "batch_regime": "same graf image repeated as a true tensor batch",
+ "compile": false,
+ "compile_dynamic": null,
+ "compile_scope": [],
+ "cuda_device": "NVIDIA GeForce RTX 4090",
+ "cuda_version": "13.0",
+ "cudnn_allow_tf32": true,
+ "cudnn_benchmark": false,
+ "device": "cuda",
+ "git_commit": "856fd1ae",
+ "historical_presets": "native release defaults; refinement algorithms and quality differ",
+ "image": "img1.ppm",
+ "input_sha256": "8d53092ffa5b27f5138ec458302f35e7c72a9f35d1f94078ca35944c4b3626dd",
+ "kornia": "0.8.2",
+ "kornia_rs": "0.1.10",
+ "machine": "x86_64",
+ "min_run_time": 5,
+ "model_repr": "SIFTFeatureScaleSpace(\n (detector): ScaleSpaceDetector(num_features=4096, mr_size=6.0, scale_pyr=ScalePyramid(n_levels=3, init_sigma=1.6, min_size=32, extra_levels=3, border=15, sigma_step=1.2599210498948732, double_image=True), resp=BlobDoG, nms=ConvQuadInterp3d(strict_maxima_bonus=10), ori=LAFOrienter(patch_size=19, angle_detector=PatchDominantGradientOrientation(patch_size=19, num_ang_bins=36, eps=1e-08)), aff=PassLAF())\n (descriptor): LAFDescriptor(descriptor=SIFTDescriptor(num_ang_bins=8, num_spatial_bins=4, patch_size=41, rootsift=True, clipval=0.2), patch_size=41, grayscale_descriptor='True)\n)",
+ "num_features": 4096,
+ "numpy": "2.4.0",
+ "opencv": "4.11.0",
+ "opencv_num_threads": 1,
+ "pillow": "12.3.0",
+ "platform": "Linux-6.18.33.2-microsoft-standard-WSL2-x86_64-with-glibc2.39",
+ "python": "3.11.14",
+ "seed": 0,
+ "series": "0.8.2",
+ "timestamp_utc": "2026-09-05T17:38:10+00:00",
+ "timing": "feature extraction only; raw batch latency; transfers/compilation/matching/RANSAC excluded",
+ "torch": "2.14.0+cu130",
+ "torch_num_threads": 1,
+ "torchvision": null
+ },
+ "results": [
+ {
+ "backend": "kornia (eager)",
+ "batch": 8,
+ "device": "cuda",
+ "dtype": "float32",
+ "features_per_image": [
+ 4096,
+ 4096,
+ 4096,
+ 4096,
+ 4096,
+ 4096,
+ 4096,
+ 4096
+ ],
+ "height": 640,
+ "initial_call_seconds": 1.5640069559995027,
+ "iqr_us": 13158.759253201424,
+ "median_us": 894629.9814997474,
+ "op": "SIFTFeatureScaleSpace",
+ "peak_extra_cuda_bytes": 15319929856,
+ "series": "0.8.2",
+ "throughput_per_s": 8.942244464676774,
+ "width": 800
+ }
+ ]
+}
diff --git a/benchmarks/feature/sift_runtime_results/0.8.3-cpu-1.json b/benchmarks/feature/sift_runtime_results/0.8.3-cpu-1.json
new file mode 100644
index 000000000..11bf08d9e
--- /dev/null
+++ b/benchmarks/feature/sift_runtime_results/0.8.3-cpu-1.json
@@ -0,0 +1,55 @@
+{
+ "metadata": {
+ "albumentations": null,
+ "batch_regime": "same graf image repeated as a true tensor batch",
+ "compile": false,
+ "compile_dynamic": null,
+ "compile_scope": [],
+ "cudnn_allow_tf32": true,
+ "cudnn_benchmark": false,
+ "device": "cpu",
+ "git_commit": "d6bb4bf0",
+ "historical_presets": "native release defaults; refinement algorithms and quality differ",
+ "image": "img1.ppm",
+ "input_sha256": "8d53092ffa5b27f5138ec458302f35e7c72a9f35d1f94078ca35944c4b3626dd",
+ "kornia": "0.8.3",
+ "kornia_rs": "0.1.10",
+ "machine": "x86_64",
+ "min_run_time": 5,
+ "model_repr": "SIFTFeatureScaleSpace(\n (detector): ScaleSpaceDetector(num_features=4096, mr_size=6.0, scale_pyr=ScalePyramid(n_levels=3, init_sigma=1.6, min_size=32, extra_levels=3, border=15, sigma_step=1.2599210498948732, double_image=True), resp=BlobDoG, subpix=ConvQuadInterp3d(n_iters=5, strict_maxima_bonus=0.0, max_subpixel_shift=0.6, dilation_radius=1, allow_scale_steps=True), ori=LAFOrienter(patch_size=19, angle_detector=PatchDominantGradientOrientation(patch_size=19, num_ang_bins=36, eps=1e-08)), aff=PassLAF())\n (descriptor): LAFDescriptor(descriptor=SIFTDescriptor(num_ang_bins=8, num_spatial_bins=4, patch_size=41, rootsift=True, clipval=0.2), patch_size=41, grayscale_descriptor='True)\n)",
+ "num_features": 4096,
+ "numpy": "2.4.0",
+ "opencv": "4.11.0",
+ "opencv_num_threads": 1,
+ "pillow": "12.3.0",
+ "platform": "Linux-6.18.33.2-microsoft-standard-WSL2-x86_64-with-glibc2.39",
+ "python": "3.11.14",
+ "seed": 0,
+ "series": "0.8.3",
+ "timestamp_utc": "2026-09-05T17:38:20+00:00",
+ "timing": "feature extraction only; raw batch latency; transfers/compilation/matching/RANSAC excluded",
+ "torch": "2.14.0+cu130",
+ "torch_num_threads": 1,
+ "torchvision": null
+ },
+ "results": [
+ {
+ "backend": "kornia (eager)",
+ "batch": 1,
+ "device": "cpu",
+ "dtype": "float32",
+ "features_per_image": [
+ 4096
+ ],
+ "height": 640,
+ "initial_call_seconds": 2.4854920440011483,
+ "iqr_us": 20529.002002149355,
+ "median_us": 2389575.213001081,
+ "op": "SIFTFeatureScaleSpace",
+ "peak_extra_cuda_bytes": null,
+ "series": "0.8.3",
+ "throughput_per_s": 0.4184844212307067,
+ "width": 800
+ }
+ ]
+}
diff --git a/benchmarks/feature/sift_runtime_results/0.8.3-cuda-1.json b/benchmarks/feature/sift_runtime_results/0.8.3-cuda-1.json
new file mode 100644
index 000000000..262a6a9e9
--- /dev/null
+++ b/benchmarks/feature/sift_runtime_results/0.8.3-cuda-1.json
@@ -0,0 +1,57 @@
+{
+ "metadata": {
+ "albumentations": null,
+ "batch_regime": "same graf image repeated as a true tensor batch",
+ "compile": false,
+ "compile_dynamic": null,
+ "compile_scope": [],
+ "cuda_device": "NVIDIA GeForce RTX 4090",
+ "cuda_version": "13.0",
+ "cudnn_allow_tf32": true,
+ "cudnn_benchmark": false,
+ "device": "cuda",
+ "git_commit": "d6bb4bf0",
+ "historical_presets": "native release defaults; refinement algorithms and quality differ",
+ "image": "img1.ppm",
+ "input_sha256": "8d53092ffa5b27f5138ec458302f35e7c72a9f35d1f94078ca35944c4b3626dd",
+ "kornia": "0.8.3",
+ "kornia_rs": "0.1.10",
+ "machine": "x86_64",
+ "min_run_time": 5,
+ "model_repr": "SIFTFeatureScaleSpace(\n (detector): ScaleSpaceDetector(num_features=4096, mr_size=6.0, scale_pyr=ScalePyramid(n_levels=3, init_sigma=1.6, min_size=32, extra_levels=3, border=15, sigma_step=1.2599210498948732, double_image=True), resp=BlobDoG, subpix=ConvQuadInterp3d(n_iters=5, strict_maxima_bonus=0.0, max_subpixel_shift=0.6, dilation_radius=1, allow_scale_steps=True), ori=LAFOrienter(patch_size=19, angle_detector=PatchDominantGradientOrientation(patch_size=19, num_ang_bins=36, eps=1e-08)), aff=PassLAF())\n (descriptor): LAFDescriptor(descriptor=SIFTDescriptor(num_ang_bins=8, num_spatial_bins=4, patch_size=41, rootsift=True, clipval=0.2), patch_size=41, grayscale_descriptor='True)\n)",
+ "num_features": 4096,
+ "numpy": "2.4.0",
+ "opencv": "4.11.0",
+ "opencv_num_threads": 1,
+ "pillow": "12.3.0",
+ "platform": "Linux-6.18.33.2-microsoft-standard-WSL2-x86_64-with-glibc2.39",
+ "python": "3.11.14",
+ "seed": 0,
+ "series": "0.8.3",
+ "timestamp_utc": "2026-09-05T17:38:41+00:00",
+ "timing": "feature extraction only; raw batch latency; transfers/compilation/matching/RANSAC excluded",
+ "torch": "2.14.0+cu130",
+ "torch_num_threads": 1,
+ "torchvision": null
+ },
+ "results": [
+ {
+ "backend": "kornia (eager)",
+ "batch": 1,
+ "device": "cuda",
+ "dtype": "float32",
+ "features_per_image": [
+ 4096
+ ],
+ "height": 640,
+ "initial_call_seconds": 0.6781475149982725,
+ "iqr_us": 9456.53499729815,
+ "median_us": 107703.73900231789,
+ "op": "SIFTFeatureScaleSpace",
+ "peak_extra_cuda_bytes": 593271808,
+ "series": "0.8.3",
+ "throughput_per_s": 9.284728731455452,
+ "width": 800
+ }
+ ]
+}
diff --git a/benchmarks/feature/sift_runtime_results/0.8.3-cuda-4.json b/benchmarks/feature/sift_runtime_results/0.8.3-cuda-4.json
new file mode 100644
index 000000000..ca2a426a4
--- /dev/null
+++ b/benchmarks/feature/sift_runtime_results/0.8.3-cuda-4.json
@@ -0,0 +1,60 @@
+{
+ "metadata": {
+ "albumentations": null,
+ "batch_regime": "same graf image repeated as a true tensor batch",
+ "compile": false,
+ "compile_dynamic": null,
+ "compile_scope": [],
+ "cuda_device": "NVIDIA GeForce RTX 4090",
+ "cuda_version": "13.0",
+ "cudnn_allow_tf32": true,
+ "cudnn_benchmark": false,
+ "device": "cuda",
+ "git_commit": "d6bb4bf0",
+ "historical_presets": "native release defaults; refinement algorithms and quality differ",
+ "image": "img1.ppm",
+ "input_sha256": "8d53092ffa5b27f5138ec458302f35e7c72a9f35d1f94078ca35944c4b3626dd",
+ "kornia": "0.8.3",
+ "kornia_rs": "0.1.10",
+ "machine": "x86_64",
+ "min_run_time": 5,
+ "model_repr": "SIFTFeatureScaleSpace(\n (detector): ScaleSpaceDetector(num_features=4096, mr_size=6.0, scale_pyr=ScalePyramid(n_levels=3, init_sigma=1.6, min_size=32, extra_levels=3, border=15, sigma_step=1.2599210498948732, double_image=True), resp=BlobDoG, subpix=ConvQuadInterp3d(n_iters=5, strict_maxima_bonus=0.0, max_subpixel_shift=0.6, dilation_radius=1, allow_scale_steps=True), ori=LAFOrienter(patch_size=19, angle_detector=PatchDominantGradientOrientation(patch_size=19, num_ang_bins=36, eps=1e-08)), aff=PassLAF())\n (descriptor): LAFDescriptor(descriptor=SIFTDescriptor(num_ang_bins=8, num_spatial_bins=4, patch_size=41, rootsift=True, clipval=0.2), patch_size=41, grayscale_descriptor='True)\n)",
+ "num_features": 4096,
+ "numpy": "2.4.0",
+ "opencv": "4.11.0",
+ "opencv_num_threads": 1,
+ "pillow": "12.3.0",
+ "platform": "Linux-6.18.33.2-microsoft-standard-WSL2-x86_64-with-glibc2.39",
+ "python": "3.11.14",
+ "seed": 0,
+ "series": "0.8.3",
+ "timestamp_utc": "2026-09-05T17:38:48+00:00",
+ "timing": "feature extraction only; raw batch latency; transfers/compilation/matching/RANSAC excluded",
+ "torch": "2.14.0+cu130",
+ "torch_num_threads": 1,
+ "torchvision": null
+ },
+ "results": [
+ {
+ "backend": "kornia (eager)",
+ "batch": 4,
+ "device": "cuda",
+ "dtype": "float32",
+ "features_per_image": [
+ 4096,
+ 4096,
+ 4096,
+ 4096
+ ],
+ "height": 640,
+ "initial_call_seconds": 0.6713997579972784,
+ "iqr_us": 9053.339999809396,
+ "median_us": 215189.8580013949,
+ "op": "SIFTFeatureScaleSpace",
+ "peak_extra_cuda_bytes": 2353475584,
+ "series": "0.8.3",
+ "throughput_per_s": 18.588236625789637,
+ "width": 800
+ }
+ ]
+}
diff --git a/benchmarks/feature/sift_runtime_results/0.8.3-cuda-8.json b/benchmarks/feature/sift_runtime_results/0.8.3-cuda-8.json
new file mode 100644
index 000000000..f751a1410
--- /dev/null
+++ b/benchmarks/feature/sift_runtime_results/0.8.3-cuda-8.json
@@ -0,0 +1,64 @@
+{
+ "metadata": {
+ "albumentations": null,
+ "batch_regime": "same graf image repeated as a true tensor batch",
+ "compile": false,
+ "compile_dynamic": null,
+ "compile_scope": [],
+ "cuda_device": "NVIDIA GeForce RTX 4090",
+ "cuda_version": "13.0",
+ "cudnn_allow_tf32": true,
+ "cudnn_benchmark": false,
+ "device": "cuda",
+ "git_commit": "d6bb4bf0",
+ "historical_presets": "native release defaults; refinement algorithms and quality differ",
+ "image": "img1.ppm",
+ "input_sha256": "8d53092ffa5b27f5138ec458302f35e7c72a9f35d1f94078ca35944c4b3626dd",
+ "kornia": "0.8.3",
+ "kornia_rs": "0.1.10",
+ "machine": "x86_64",
+ "min_run_time": 5,
+ "model_repr": "SIFTFeatureScaleSpace(\n (detector): ScaleSpaceDetector(num_features=4096, mr_size=6.0, scale_pyr=ScalePyramid(n_levels=3, init_sigma=1.6, min_size=32, extra_levels=3, border=15, sigma_step=1.2599210498948732, double_image=True), resp=BlobDoG, subpix=ConvQuadInterp3d(n_iters=5, strict_maxima_bonus=0.0, max_subpixel_shift=0.6, dilation_radius=1, allow_scale_steps=True), ori=LAFOrienter(patch_size=19, angle_detector=PatchDominantGradientOrientation(patch_size=19, num_ang_bins=36, eps=1e-08)), aff=PassLAF())\n (descriptor): LAFDescriptor(descriptor=SIFTDescriptor(num_ang_bins=8, num_spatial_bins=4, patch_size=41, rootsift=True, clipval=0.2), patch_size=41, grayscale_descriptor='True)\n)",
+ "num_features": 4096,
+ "numpy": "2.4.0",
+ "opencv": "4.11.0",
+ "opencv_num_threads": 1,
+ "pillow": "12.3.0",
+ "platform": "Linux-6.18.33.2-microsoft-standard-WSL2-x86_64-with-glibc2.39",
+ "python": "3.11.14",
+ "seed": 0,
+ "series": "0.8.3",
+ "timestamp_utc": "2026-09-05T17:38:56+00:00",
+ "timing": "feature extraction only; raw batch latency; transfers/compilation/matching/RANSAC excluded",
+ "torch": "2.14.0+cu130",
+ "torch_num_threads": 1,
+ "torchvision": null
+ },
+ "results": [
+ {
+ "backend": "kornia (eager)",
+ "batch": 8,
+ "device": "cuda",
+ "dtype": "float32",
+ "features_per_image": [
+ 4096,
+ 4096,
+ 4096,
+ 4096,
+ 4096,
+ 4096,
+ 4096,
+ 4096
+ ],
+ "height": 640,
+ "initial_call_seconds": 0.8543874530005269,
+ "iqr_us": 12388.296998324222,
+ "median_us": 359372.06499875174,
+ "op": "SIFTFeatureScaleSpace",
+ "peak_extra_cuda_bytes": 4705007104,
+ "series": "0.8.3",
+ "throughput_per_s": 22.261051370333384,
+ "width": 800
+ }
+ ]
+}
diff --git a/benchmarks/feature/sift_runtime_results/compiled-cpu-1.json b/benchmarks/feature/sift_runtime_results/compiled-cpu-1.json
new file mode 100644
index 000000000..ce212c083
--- /dev/null
+++ b/benchmarks/feature/sift_runtime_results/compiled-cpu-1.json
@@ -0,0 +1,59 @@
+{
+ "metadata": {
+ "albumentations": null,
+ "batch_regime": "same graf image repeated as a true tensor batch",
+ "compile": true,
+ "compile_dynamic": true,
+ "compile_scope": [
+ "scale_pyr",
+ "resp",
+ "subpix"
+ ],
+ "cudnn_allow_tf32": true,
+ "cudnn_benchmark": false,
+ "device": "cpu",
+ "git_commit": "0dbcad81",
+ "historical_presets": "native release defaults; refinement algorithms and quality differ",
+ "image": "img1.ppm",
+ "input_sha256": "8d53092ffa5b27f5138ec458302f35e7c72a9f35d1f94078ca35944c4b3626dd",
+ "kornia": "0.9.0rc1",
+ "kornia_rs": "0.1.10",
+ "machine": "x86_64",
+ "min_run_time": 5,
+ "model_repr": "SIFTFeatureScaleSpace(\n (detector): ScaleSpaceDetector(num_features=4096, mr_size=6.0, scale_pyr=OptimizedModule(\n (_orig_mod): ScalePyramid(n_levels=3, init_sigma=1.6, min_size=32, extra_levels=3, border=15, sigma_step=1.2599210498948732, double_image=True)\n ), resp=OptimizedModule(\n (_orig_mod): BlobDoG\n ), subpix=OptimizedModule(\n (_orig_mod): ConvQuadInterp3d(n_iters=5, strict_maxima_bonus=0.0, max_subpixel_shift=0.6, dilation_radius=1, allow_scale_steps=True)\n ), ori=LAFOrienter(patch_size=19, angle_detector=PatchDominantGradientOrientation(patch_size=19, num_ang_bins=36, eps=1e-08)), aff=PassLAF())\n (descriptor): LAFDescriptor(descriptor=SIFTDescriptor(num_ang_bins=8, num_spatial_bins=4, patch_size=41, rootsift=True, clipval=0.2), patch_size=41, grayscale_descriptor='True)\n)",
+ "num_features": 4096,
+ "numpy": "2.4.0",
+ "opencv": "4.11.0",
+ "opencv_num_threads": 1,
+ "pillow": "12.3.0",
+ "platform": "Linux-6.18.33.2-microsoft-standard-WSL2-x86_64-with-glibc2.39",
+ "python": "3.11.14",
+ "seed": 0,
+ "series": "current + compile",
+ "timestamp_utc": "2026-09-05T17:41:16+00:00",
+ "timing": "feature extraction only; raw batch latency; transfers/compilation/matching/RANSAC excluded",
+ "torch": "2.14.0+cu130",
+ "torch_num_threads": 1,
+ "torchvision": null
+ },
+ "results": [
+ {
+ "backend": "kornia (selectively compiled)",
+ "batch": 1,
+ "device": "cpu",
+ "dtype": "float32",
+ "features_per_image": [
+ 4096
+ ],
+ "height": 640,
+ "initial_call_seconds": 78.23252610300187,
+ "iqr_us": 27127.721747092437,
+ "median_us": 2091498.9119992242,
+ "op": "SIFTFeatureScaleSpace",
+ "peak_extra_cuda_bytes": null,
+ "series": "current + compile",
+ "throughput_per_s": 0.47812599579318876,
+ "width": 800
+ }
+ ]
+}
diff --git a/benchmarks/feature/sift_runtime_results/compiled-cuda-1.json b/benchmarks/feature/sift_runtime_results/compiled-cuda-1.json
new file mode 100644
index 000000000..fd02ff5a7
--- /dev/null
+++ b/benchmarks/feature/sift_runtime_results/compiled-cuda-1.json
@@ -0,0 +1,61 @@
+{
+ "metadata": {
+ "albumentations": null,
+ "batch_regime": "same graf image repeated as a true tensor batch",
+ "compile": true,
+ "compile_dynamic": true,
+ "compile_scope": [
+ "scale_pyr",
+ "resp",
+ "subpix"
+ ],
+ "cuda_device": "NVIDIA GeForce RTX 4090",
+ "cuda_version": "13.0",
+ "cudnn_allow_tf32": true,
+ "cudnn_benchmark": false,
+ "device": "cuda",
+ "git_commit": "0dbcad81",
+ "historical_presets": "native release defaults; refinement algorithms and quality differ",
+ "image": "img1.ppm",
+ "input_sha256": "8d53092ffa5b27f5138ec458302f35e7c72a9f35d1f94078ca35944c4b3626dd",
+ "kornia": "0.9.0rc1",
+ "kornia_rs": "0.1.10",
+ "machine": "x86_64",
+ "min_run_time": 5,
+ "model_repr": "SIFTFeatureScaleSpace(\n (detector): ScaleSpaceDetector(num_features=4096, mr_size=6.0, scale_pyr=OptimizedModule(\n (_orig_mod): ScalePyramid(n_levels=3, init_sigma=1.6, min_size=32, extra_levels=3, border=15, sigma_step=1.2599210498948732, double_image=True)\n ), resp=OptimizedModule(\n (_orig_mod): BlobDoG\n ), subpix=OptimizedModule(\n (_orig_mod): ConvQuadInterp3d(n_iters=5, strict_maxima_bonus=0.0, max_subpixel_shift=0.6, dilation_radius=1, allow_scale_steps=True)\n ), ori=LAFOrienter(patch_size=19, angle_detector=PatchDominantGradientOrientation(patch_size=19, num_ang_bins=36, eps=1e-08)), aff=PassLAF())\n (descriptor): LAFDescriptor(descriptor=SIFTDescriptor(num_ang_bins=8, num_spatial_bins=4, patch_size=41, rootsift=True, clipval=0.2), patch_size=41, grayscale_descriptor='True)\n)",
+ "num_features": 4096,
+ "numpy": "2.4.0",
+ "opencv": "4.11.0",
+ "opencv_num_threads": 1,
+ "pillow": "12.3.0",
+ "platform": "Linux-6.18.33.2-microsoft-standard-WSL2-x86_64-with-glibc2.39",
+ "python": "3.11.14",
+ "seed": 0,
+ "series": "current + compile",
+ "timestamp_utc": "2026-09-05T17:42:54+00:00",
+ "timing": "feature extraction only; raw batch latency; transfers/compilation/matching/RANSAC excluded",
+ "torch": "2.14.0+cu130",
+ "torch_num_threads": 1,
+ "torchvision": null
+ },
+ "results": [
+ {
+ "backend": "kornia (selectively compiled)",
+ "batch": 1,
+ "device": "cuda",
+ "dtype": "float32",
+ "features_per_image": [
+ 4096
+ ],
+ "height": 640,
+ "initial_call_seconds": 44.824140085998806,
+ "iqr_us": 9634.864996769466,
+ "median_us": 36558.64000029396,
+ "op": "SIFTFeatureScaleSpace",
+ "peak_extra_cuda_bytes": 721284608,
+ "series": "current + compile",
+ "throughput_per_s": 27.353315112158416,
+ "width": 800
+ }
+ ]
+}
diff --git a/benchmarks/feature/sift_runtime_results/compiled-cuda-4.json b/benchmarks/feature/sift_runtime_results/compiled-cuda-4.json
new file mode 100644
index 000000000..bdcd91f2a
--- /dev/null
+++ b/benchmarks/feature/sift_runtime_results/compiled-cuda-4.json
@@ -0,0 +1,64 @@
+{
+ "metadata": {
+ "albumentations": null,
+ "batch_regime": "same graf image repeated as a true tensor batch",
+ "compile": true,
+ "compile_dynamic": true,
+ "compile_scope": [
+ "scale_pyr",
+ "resp",
+ "subpix"
+ ],
+ "cuda_device": "NVIDIA GeForce RTX 4090",
+ "cuda_version": "13.0",
+ "cudnn_allow_tf32": true,
+ "cudnn_benchmark": false,
+ "device": "cuda",
+ "git_commit": "0dbcad81",
+ "historical_presets": "native release defaults; refinement algorithms and quality differ",
+ "image": "img1.ppm",
+ "input_sha256": "8d53092ffa5b27f5138ec458302f35e7c72a9f35d1f94078ca35944c4b3626dd",
+ "kornia": "0.9.0rc1",
+ "kornia_rs": "0.1.10",
+ "machine": "x86_64",
+ "min_run_time": 5,
+ "model_repr": "SIFTFeatureScaleSpace(\n (detector): ScaleSpaceDetector(num_features=4096, mr_size=6.0, scale_pyr=OptimizedModule(\n (_orig_mod): ScalePyramid(n_levels=3, init_sigma=1.6, min_size=32, extra_levels=3, border=15, sigma_step=1.2599210498948732, double_image=True)\n ), resp=OptimizedModule(\n (_orig_mod): BlobDoG\n ), subpix=OptimizedModule(\n (_orig_mod): ConvQuadInterp3d(n_iters=5, strict_maxima_bonus=0.0, max_subpixel_shift=0.6, dilation_radius=1, allow_scale_steps=True)\n ), ori=LAFOrienter(patch_size=19, angle_detector=PatchDominantGradientOrientation(patch_size=19, num_ang_bins=36, eps=1e-08)), aff=PassLAF())\n (descriptor): LAFDescriptor(descriptor=SIFTDescriptor(num_ang_bins=8, num_spatial_bins=4, patch_size=41, rootsift=True, clipval=0.2), patch_size=41, grayscale_descriptor='True)\n)",
+ "num_features": 4096,
+ "numpy": "2.4.0",
+ "opencv": "4.11.0",
+ "opencv_num_threads": 1,
+ "pillow": "12.3.0",
+ "platform": "Linux-6.18.33.2-microsoft-standard-WSL2-x86_64-with-glibc2.39",
+ "python": "3.11.14",
+ "seed": 0,
+ "series": "current + compile",
+ "timestamp_utc": "2026-09-05T17:43:48+00:00",
+ "timing": "feature extraction only; raw batch latency; transfers/compilation/matching/RANSAC excluded",
+ "torch": "2.14.0+cu130",
+ "torch_num_threads": 1,
+ "torchvision": null
+ },
+ "results": [
+ {
+ "backend": "kornia (selectively compiled)",
+ "batch": 4,
+ "device": "cuda",
+ "dtype": "float32",
+ "features_per_image": [
+ 4096,
+ 4096,
+ 4096,
+ 4096
+ ],
+ "height": 640,
+ "initial_call_seconds": 55.833511578999605,
+ "iqr_us": 2138.6137514127768,
+ "median_us": 91943.58450076834,
+ "op": "SIFTFeatureScaleSpace",
+ "peak_extra_cuda_bytes": 2887183872,
+ "series": "current + compile",
+ "throughput_per_s": 43.50493861773002,
+ "width": 800
+ }
+ ]
+}
diff --git a/benchmarks/feature/sift_runtime_results/compiled-cuda-8.json b/benchmarks/feature/sift_runtime_results/compiled-cuda-8.json
new file mode 100644
index 000000000..8ba0d7570
--- /dev/null
+++ b/benchmarks/feature/sift_runtime_results/compiled-cuda-8.json
@@ -0,0 +1,68 @@
+{
+ "metadata": {
+ "albumentations": null,
+ "batch_regime": "same graf image repeated as a true tensor batch",
+ "compile": true,
+ "compile_dynamic": true,
+ "compile_scope": [
+ "scale_pyr",
+ "resp",
+ "subpix"
+ ],
+ "cuda_device": "NVIDIA GeForce RTX 4090",
+ "cuda_version": "13.0",
+ "cudnn_allow_tf32": true,
+ "cudnn_benchmark": false,
+ "device": "cuda",
+ "git_commit": "0dbcad81",
+ "historical_presets": "native release defaults; refinement algorithms and quality differ",
+ "image": "img1.ppm",
+ "input_sha256": "8d53092ffa5b27f5138ec458302f35e7c72a9f35d1f94078ca35944c4b3626dd",
+ "kornia": "0.9.0rc1",
+ "kornia_rs": "0.1.10",
+ "machine": "x86_64",
+ "min_run_time": 5,
+ "model_repr": "SIFTFeatureScaleSpace(\n (detector): ScaleSpaceDetector(num_features=4096, mr_size=6.0, scale_pyr=OptimizedModule(\n (_orig_mod): ScalePyramid(n_levels=3, init_sigma=1.6, min_size=32, extra_levels=3, border=15, sigma_step=1.2599210498948732, double_image=True)\n ), resp=OptimizedModule(\n (_orig_mod): BlobDoG\n ), subpix=OptimizedModule(\n (_orig_mod): ConvQuadInterp3d(n_iters=5, strict_maxima_bonus=0.0, max_subpixel_shift=0.6, dilation_radius=1, allow_scale_steps=True)\n ), ori=LAFOrienter(patch_size=19, angle_detector=PatchDominantGradientOrientation(patch_size=19, num_ang_bins=36, eps=1e-08)), aff=PassLAF())\n (descriptor): LAFDescriptor(descriptor=SIFTDescriptor(num_ang_bins=8, num_spatial_bins=4, patch_size=41, rootsift=True, clipval=0.2), patch_size=41, grayscale_descriptor='True)\n)",
+ "num_features": 4096,
+ "numpy": "2.4.0",
+ "opencv": "4.11.0",
+ "opencv_num_threads": 1,
+ "pillow": "12.3.0",
+ "platform": "Linux-6.18.33.2-microsoft-standard-WSL2-x86_64-with-glibc2.39",
+ "python": "3.11.14",
+ "seed": 0,
+ "series": "current + compile",
+ "timestamp_utc": "2026-09-05T17:44:54+00:00",
+ "timing": "feature extraction only; raw batch latency; transfers/compilation/matching/RANSAC excluded",
+ "torch": "2.14.0+cu130",
+ "torch_num_threads": 1,
+ "torchvision": null
+ },
+ "results": [
+ {
+ "backend": "kornia (selectively compiled)",
+ "batch": 8,
+ "device": "cuda",
+ "dtype": "float32",
+ "features_per_image": [
+ 4096,
+ 4096,
+ 4096,
+ 4096,
+ 4096,
+ 4096,
+ 4096,
+ 4096
+ ],
+ "height": 640,
+ "initial_call_seconds": 57.72233975400013,
+ "iqr_us": 8613.597001385642,
+ "median_us": 173339.85699951882,
+ "op": "SIFTFeatureScaleSpace",
+ "peak_extra_cuda_bytes": 5777923584,
+ "series": "current + compile",
+ "throughput_per_s": 46.152109148343236,
+ "width": 800
+ }
+ ]
+}
diff --git a/benchmarks/feature/sift_runtime_results/current-cpu-1.json b/benchmarks/feature/sift_runtime_results/current-cpu-1.json
new file mode 100644
index 000000000..fde6ad2f2
--- /dev/null
+++ b/benchmarks/feature/sift_runtime_results/current-cpu-1.json
@@ -0,0 +1,55 @@
+{
+ "metadata": {
+ "albumentations": null,
+ "batch_regime": "same graf image repeated as a true tensor batch",
+ "compile": false,
+ "compile_dynamic": null,
+ "compile_scope": [],
+ "cudnn_allow_tf32": true,
+ "cudnn_benchmark": false,
+ "device": "cpu",
+ "git_commit": "0dbcad81",
+ "historical_presets": "native release defaults; refinement algorithms and quality differ",
+ "image": "img1.ppm",
+ "input_sha256": "8d53092ffa5b27f5138ec458302f35e7c72a9f35d1f94078ca35944c4b3626dd",
+ "kornia": "0.9.0rc1",
+ "kornia_rs": "0.1.10",
+ "machine": "x86_64",
+ "min_run_time": 5,
+ "model_repr": "SIFTFeatureScaleSpace(\n (detector): ScaleSpaceDetector(num_features=4096, mr_size=6.0, scale_pyr=ScalePyramid(n_levels=3, init_sigma=1.6, min_size=32, extra_levels=3, border=15, sigma_step=1.2599210498948732, double_image=True), resp=BlobDoG, subpix=ConvQuadInterp3d(n_iters=5, strict_maxima_bonus=0.0, max_subpixel_shift=0.6, dilation_radius=1, allow_scale_steps=True), ori=LAFOrienter(patch_size=19, angle_detector=PatchDominantGradientOrientation(patch_size=19, num_ang_bins=36, eps=1e-08)), aff=PassLAF())\n (descriptor): LAFDescriptor(descriptor=SIFTDescriptor(num_ang_bins=8, num_spatial_bins=4, patch_size=41, rootsift=True, clipval=0.2), patch_size=41, grayscale_descriptor='True)\n)",
+ "num_features": 4096,
+ "numpy": "2.4.0",
+ "opencv": "4.11.0",
+ "opencv_num_threads": 1,
+ "pillow": "12.3.0",
+ "platform": "Linux-6.18.33.2-microsoft-standard-WSL2-x86_64-with-glibc2.39",
+ "python": "3.11.14",
+ "seed": 0,
+ "series": "current",
+ "timestamp_utc": "2026-09-05T17:40:37+00:00",
+ "timing": "feature extraction only; raw batch latency; transfers/compilation/matching/RANSAC excluded",
+ "torch": "2.14.0+cu130",
+ "torch_num_threads": 1,
+ "torchvision": null
+ },
+ "results": [
+ {
+ "backend": "kornia (eager)",
+ "batch": 1,
+ "device": "cpu",
+ "dtype": "float32",
+ "features_per_image": [
+ 4096
+ ],
+ "height": 640,
+ "initial_call_seconds": 2.0103456729993923,
+ "iqr_us": 25605.91750261665,
+ "median_us": 1567264.998997416,
+ "op": "SIFTFeatureScaleSpace",
+ "peak_extra_cuda_bytes": null,
+ "series": "current",
+ "throughput_per_s": 0.6380541903505169,
+ "width": 800
+ }
+ ]
+}
diff --git a/benchmarks/feature/sift_runtime_results/current-cuda-1.json b/benchmarks/feature/sift_runtime_results/current-cuda-1.json
new file mode 100644
index 000000000..227bc84e7
--- /dev/null
+++ b/benchmarks/feature/sift_runtime_results/current-cuda-1.json
@@ -0,0 +1,57 @@
+{
+ "metadata": {
+ "albumentations": null,
+ "batch_regime": "same graf image repeated as a true tensor batch",
+ "compile": false,
+ "compile_dynamic": null,
+ "compile_scope": [],
+ "cuda_device": "NVIDIA GeForce RTX 4090",
+ "cuda_version": "13.0",
+ "cudnn_allow_tf32": true,
+ "cudnn_benchmark": false,
+ "device": "cuda",
+ "git_commit": "0dbcad81",
+ "historical_presets": "native release defaults; refinement algorithms and quality differ",
+ "image": "img1.ppm",
+ "input_sha256": "8d53092ffa5b27f5138ec458302f35e7c72a9f35d1f94078ca35944c4b3626dd",
+ "kornia": "0.9.0rc1",
+ "kornia_rs": "0.1.10",
+ "machine": "x86_64",
+ "min_run_time": 5,
+ "model_repr": "SIFTFeatureScaleSpace(\n (detector): ScaleSpaceDetector(num_features=4096, mr_size=6.0, scale_pyr=ScalePyramid(n_levels=3, init_sigma=1.6, min_size=32, extra_levels=3, border=15, sigma_step=1.2599210498948732, double_image=True), resp=BlobDoG, subpix=ConvQuadInterp3d(n_iters=5, strict_maxima_bonus=0.0, max_subpixel_shift=0.6, dilation_radius=1, allow_scale_steps=True), ori=LAFOrienter(patch_size=19, angle_detector=PatchDominantGradientOrientation(patch_size=19, num_ang_bins=36, eps=1e-08)), aff=PassLAF())\n (descriptor): LAFDescriptor(descriptor=SIFTDescriptor(num_ang_bins=8, num_spatial_bins=4, patch_size=41, rootsift=True, clipval=0.2), patch_size=41, grayscale_descriptor='True)\n)",
+ "num_features": 4096,
+ "numpy": "2.4.0",
+ "opencv": "4.11.0",
+ "opencv_num_threads": 1,
+ "pillow": "12.3.0",
+ "platform": "Linux-6.18.33.2-microsoft-standard-WSL2-x86_64-with-glibc2.39",
+ "python": "3.11.14",
+ "seed": 0,
+ "series": "current",
+ "timestamp_utc": "2026-09-05T17:40:54+00:00",
+ "timing": "feature extraction only; raw batch latency; transfers/compilation/matching/RANSAC excluded",
+ "torch": "2.14.0+cu130",
+ "torch_num_threads": 1,
+ "torchvision": null
+ },
+ "results": [
+ {
+ "backend": "kornia (eager)",
+ "batch": 1,
+ "device": "cuda",
+ "dtype": "float32",
+ "features_per_image": [
+ 4096
+ ],
+ "height": 640,
+ "initial_call_seconds": 0.5890047370012326,
+ "iqr_us": 16577.8964983474,
+ "median_us": 60430.123998230556,
+ "op": "SIFTFeatureScaleSpace",
+ "peak_extra_cuda_bytes": 681767424,
+ "series": "current",
+ "throughput_per_s": 16.548038194150998,
+ "width": 800
+ }
+ ]
+}
diff --git a/benchmarks/feature/sift_runtime_results/current-cuda-4.json b/benchmarks/feature/sift_runtime_results/current-cuda-4.json
new file mode 100644
index 000000000..5673ae699
--- /dev/null
+++ b/benchmarks/feature/sift_runtime_results/current-cuda-4.json
@@ -0,0 +1,60 @@
+{
+ "metadata": {
+ "albumentations": null,
+ "batch_regime": "same graf image repeated as a true tensor batch",
+ "compile": false,
+ "compile_dynamic": null,
+ "compile_scope": [],
+ "cuda_device": "NVIDIA GeForce RTX 4090",
+ "cuda_version": "13.0",
+ "cudnn_allow_tf32": true,
+ "cudnn_benchmark": false,
+ "device": "cuda",
+ "git_commit": "0dbcad81",
+ "historical_presets": "native release defaults; refinement algorithms and quality differ",
+ "image": "img1.ppm",
+ "input_sha256": "8d53092ffa5b27f5138ec458302f35e7c72a9f35d1f94078ca35944c4b3626dd",
+ "kornia": "0.9.0rc1",
+ "kornia_rs": "0.1.10",
+ "machine": "x86_64",
+ "min_run_time": 5,
+ "model_repr": "SIFTFeatureScaleSpace(\n (detector): ScaleSpaceDetector(num_features=4096, mr_size=6.0, scale_pyr=ScalePyramid(n_levels=3, init_sigma=1.6, min_size=32, extra_levels=3, border=15, sigma_step=1.2599210498948732, double_image=True), resp=BlobDoG, subpix=ConvQuadInterp3d(n_iters=5, strict_maxima_bonus=0.0, max_subpixel_shift=0.6, dilation_radius=1, allow_scale_steps=True), ori=LAFOrienter(patch_size=19, angle_detector=PatchDominantGradientOrientation(patch_size=19, num_ang_bins=36, eps=1e-08)), aff=PassLAF())\n (descriptor): LAFDescriptor(descriptor=SIFTDescriptor(num_ang_bins=8, num_spatial_bins=4, patch_size=41, rootsift=True, clipval=0.2), patch_size=41, grayscale_descriptor='True)\n)",
+ "num_features": 4096,
+ "numpy": "2.4.0",
+ "opencv": "4.11.0",
+ "opencv_num_threads": 1,
+ "pillow": "12.3.0",
+ "platform": "Linux-6.18.33.2-microsoft-standard-WSL2-x86_64-with-glibc2.39",
+ "python": "3.11.14",
+ "seed": 0,
+ "series": "current",
+ "timestamp_utc": "2026-09-05T17:41:01+00:00",
+ "timing": "feature extraction only; raw batch latency; transfers/compilation/matching/RANSAC excluded",
+ "torch": "2.14.0+cu130",
+ "torch_num_threads": 1,
+ "torchvision": null
+ },
+ "results": [
+ {
+ "backend": "kornia (eager)",
+ "batch": 4,
+ "device": "cuda",
+ "dtype": "float32",
+ "features_per_image": [
+ 4096,
+ 4096,
+ 4096,
+ 4096
+ ],
+ "height": 640,
+ "initial_call_seconds": 0.5701114440016681,
+ "iqr_us": 16806.9972523881,
+ "median_us": 114659.57200016419,
+ "op": "SIFTFeatureScaleSpace",
+ "peak_extra_cuda_bytes": 2710657536,
+ "series": "current",
+ "throughput_per_s": 34.88587939255758,
+ "width": 800
+ }
+ ]
+}
diff --git a/benchmarks/feature/sift_runtime_results/current-cuda-8.json b/benchmarks/feature/sift_runtime_results/current-cuda-8.json
new file mode 100644
index 000000000..93fda4a45
--- /dev/null
+++ b/benchmarks/feature/sift_runtime_results/current-cuda-8.json
@@ -0,0 +1,64 @@
+{
+ "metadata": {
+ "albumentations": null,
+ "batch_regime": "same graf image repeated as a true tensor batch",
+ "compile": false,
+ "compile_dynamic": null,
+ "compile_scope": [],
+ "cuda_device": "NVIDIA GeForce RTX 4090",
+ "cuda_version": "13.0",
+ "cudnn_allow_tf32": true,
+ "cudnn_benchmark": false,
+ "device": "cuda",
+ "git_commit": "0dbcad81",
+ "historical_presets": "native release defaults; refinement algorithms and quality differ",
+ "image": "img1.ppm",
+ "input_sha256": "8d53092ffa5b27f5138ec458302f35e7c72a9f35d1f94078ca35944c4b3626dd",
+ "kornia": "0.9.0rc1",
+ "kornia_rs": "0.1.10",
+ "machine": "x86_64",
+ "min_run_time": 5,
+ "model_repr": "SIFTFeatureScaleSpace(\n (detector): ScaleSpaceDetector(num_features=4096, mr_size=6.0, scale_pyr=ScalePyramid(n_levels=3, init_sigma=1.6, min_size=32, extra_levels=3, border=15, sigma_step=1.2599210498948732, double_image=True), resp=BlobDoG, subpix=ConvQuadInterp3d(n_iters=5, strict_maxima_bonus=0.0, max_subpixel_shift=0.6, dilation_radius=1, allow_scale_steps=True), ori=LAFOrienter(patch_size=19, angle_detector=PatchDominantGradientOrientation(patch_size=19, num_ang_bins=36, eps=1e-08)), aff=PassLAF())\n (descriptor): LAFDescriptor(descriptor=SIFTDescriptor(num_ang_bins=8, num_spatial_bins=4, patch_size=41, rootsift=True, clipval=0.2), patch_size=41, grayscale_descriptor='True)\n)",
+ "num_features": 4096,
+ "numpy": "2.4.0",
+ "opencv": "4.11.0",
+ "opencv_num_threads": 1,
+ "pillow": "12.3.0",
+ "platform": "Linux-6.18.33.2-microsoft-standard-WSL2-x86_64-with-glibc2.39",
+ "python": "3.11.14",
+ "seed": 0,
+ "series": "current",
+ "timestamp_utc": "2026-09-05T17:41:09+00:00",
+ "timing": "feature extraction only; raw batch latency; transfers/compilation/matching/RANSAC excluded",
+ "torch": "2.14.0+cu130",
+ "torch_num_threads": 1,
+ "torchvision": null
+ },
+ "results": [
+ {
+ "backend": "kornia (eager)",
+ "batch": 8,
+ "device": "cuda",
+ "dtype": "float32",
+ "features_per_image": [
+ 4096,
+ 4096,
+ 4096,
+ 4096,
+ 4096,
+ 4096,
+ 4096,
+ 4096
+ ],
+ "height": 640,
+ "initial_call_seconds": 0.6545587320033519,
+ "iqr_us": 10113.196000020253,
+ "median_us": 185632.81999740866,
+ "op": "SIFTFeatureScaleSpace",
+ "peak_extra_cuda_bytes": 5422496768,
+ "series": "current",
+ "throughput_per_s": 43.095827559542954,
+ "width": 800
+ }
+ ]
+}
diff --git a/benchmarks/feature/sift_runtime_results/opencv-cpu-1.json b/benchmarks/feature/sift_runtime_results/opencv-cpu-1.json
new file mode 100644
index 000000000..1c2e59380
--- /dev/null
+++ b/benchmarks/feature/sift_runtime_results/opencv-cpu-1.json
@@ -0,0 +1,54 @@
+{
+ "metadata": {
+ "albumentations": null,
+ "batch_regime": "same graf image repeated as a true tensor batch",
+ "compile": false,
+ "compile_dynamic": null,
+ "compile_scope": [],
+ "cudnn_allow_tf32": true,
+ "cudnn_benchmark": false,
+ "device": "cpu",
+ "git_commit": "15d548fb",
+ "historical_presets": "native release defaults; refinement algorithms and quality differ",
+ "image": "img1.ppm",
+ "input_sha256": "8d53092ffa5b27f5138ec458302f35e7c72a9f35d1f94078ca35944c4b3626dd",
+ "kornia": "0.9.0rc1",
+ "kornia_rs": "0.1.10",
+ "machine": "x86_64",
+ "min_run_time": 5,
+ "num_features": 4096,
+ "numpy": "2.4.0",
+ "opencv": "4.11.0",
+ "opencv_num_threads": 1,
+ "pillow": "12.3.0",
+ "platform": "Linux-6.18.33.2-microsoft-standard-WSL2-x86_64-with-glibc2.39",
+ "python": "3.11.14",
+ "seed": 0,
+ "series": "OpenCV",
+ "timestamp_utc": "2026-09-05T17:36:09+00:00",
+ "timing": "feature extraction only; raw batch latency; transfers/compilation/matching/RANSAC excluded",
+ "torch": "2.14.0+cu130",
+ "torch_num_threads": 1,
+ "torchvision": null
+ },
+ "results": [
+ {
+ "backend": "opencv",
+ "batch": 1,
+ "device": "cpu",
+ "dtype": "uint8 input/float32 descriptor",
+ "features_per_image": [
+ 2678
+ ],
+ "height": 640,
+ "initial_call_seconds": 0.13361100899783196,
+ "iqr_us": 3447.1422504793736,
+ "median_us": 87030.59100116661,
+ "op": "OpenCV SIFT",
+ "peak_extra_cuda_bytes": null,
+ "series": "OpenCV",
+ "throughput_per_s": 11.490212676903404,
+ "width": 800
+ }
+ ]
+}
diff --git a/benchmarks/results_schema.py b/benchmarks/results_schema.py
index b2d00003c..9966f2ca6 100644
--- a/benchmarks/results_schema.py
+++ b/benchmarks/results_schema.py
@@ -31,20 +31,25 @@ REQUIRED_METADATA = ("timestamp_utc", "git_commit", "platform", "python", "torch
_ABSOLUTE_PATH = re.compile(r"^(/|\\\\|[A-Za-z]:[\\/])")
-def validate_result(path: Path) -> list[str]:
- """Return a list of problems with a committed result file; empty list means valid."""
- errors: list[str] = []
+def _load_payload(path: Path) -> tuple[dict | None, list[str]]:
+ """Parse a result file down to its ``metadata``/``results`` envelope, or explain why it cannot be."""
try:
payload = json.loads(Path(path).read_text())
except (OSError, json.JSONDecodeError) as exc:
- return [f"unreadable JSON: {exc}"]
+ return None, [f"unreadable JSON: {exc}"]
if not isinstance(payload, dict) or set(payload) != {"metadata", "results"}:
- return [f"top level must be an object with keys metadata/results, got {type(payload).__name__}"]
+ return None, [f"top level must be an object with keys metadata/results, got {type(payload).__name__}"]
+ if not isinstance(payload["metadata"], dict):
+ return None, [f"metadata must be an object, got {type(payload['metadata']).__name__}"]
+ return payload, []
+
+
+def _content_errors(payload: dict, *, require_load: bool) -> list[str]:
+ """Envelope, metadata, privacy and row-type rules shared by release snapshots and artefacts."""
+ errors: list[str] = []
meta, results = payload["metadata"], payload["results"]
- if not isinstance(meta, dict):
- return [f"metadata must be an object, got {type(meta).__name__}"]
for key in REQUIRED_METADATA:
- if key not in meta:
+ if key not in meta and (require_load or key != "load"):
errors.append(f"metadata missing '{key}'")
load = meta.get("load", {})
if not isinstance(load, dict) or not all(v is None or isinstance(v, (int, float)) for v in load.values()):
@@ -69,6 +74,33 @@ def validate_result(path: Path) -> list[str]:
or (row[key] is not None and not isinstance(row[key], (int, float)))
):
errors.append(f"results[{i}].{key} missing or wrong type")
+ return errors
+
+
+def validate_artefact(path: Path) -> list[str]:
+ """Return a list of problems with a committed comparison artefact; empty list means valid.
+
+ A comparison artefact is the raw JSON of a base-versus-branch A/B or a cross-release run, kept
+ next to the report that cites it (``benchmarks/<area>/<name>_results/``). It follows the content
+ rules of a release snapshot -- the envelope, the recorded metadata, the privacy rule and the row
+ types -- but not the release layout: its filename names the compared revision rather than a
+ machine, and it does not sit in a ``<kornia-version>`` directory, because the revision it records
+ is by construction not the current tree. ``load`` is optional because a base revision's harness
+ may predate that field.
+ """
+ payload, errors = _load_payload(path)
+ if payload is None:
+ return errors
+ return _content_errors(payload, require_load=False)
+
+
+def validate_result(path: Path) -> list[str]:
+ """Return a list of problems with a committed result file; empty list means valid."""
+ payload, errors = _load_payload(path)
+ if payload is None:
+ return errors
+ errors = _content_errors(payload, require_load=True)
+ meta = payload["metadata"]
name = Path(path).name
parts = name[: -len(".json")].split("--") if name.endswith(".json") else []
if len(parts) != 3:
diff --git a/benchmarks/results_schema_test.py b/benchmarks/results_schema_test.py
index 69a444135..8e6ce1454 100644
--- a/benchmarks/results_schema_test.py
+++ b/benchmarks/results_schema_test.py
@@ -107,6 +107,49 @@ def test_all_committed_results_are_valid() -> None:
assert results_schema.validate_result(path) == [], f"{path} invalid"
+def test_missing_load_flagged_for_release_snapshot(tmp_path) -> None:
+ p = tmp_path / "0.9.0rc1" / "filters--test-box--cpu.json"
+ p.parent.mkdir()
+ payload = _valid_payload()
+ del payload["metadata"]["load"]
+ p.write_text(json.dumps(payload))
+ assert any("load" in e for e in results_schema.validate_result(p))
+
+
+def test_artefact_skips_layout_rules_and_optional_load(tmp_path) -> None:
+ """An A/B artefact names the compared revision, not a machine, and may predate ``load``."""
+ p = tmp_path / "graf_results" / "base-cuda.json"
+ p.parent.mkdir()
+ payload = _valid_payload()
+ del payload["metadata"]["load"]
+ p.write_text(json.dumps(payload))
+ assert results_schema.validate_result(p) != [] # the same file is not a release snapshot
+ assert results_schema.validate_artefact(p) == []
+
+
+def test_artefact_keeps_content_rules(tmp_path) -> None:
+ p = tmp_path / "graf_results" / "base-cuda.json"
+ p.parent.mkdir()
+ for mutate, needle in (
+ (lambda m: m["metadata"].pop("git_commit"), "git_commit"),
+ (lambda m: m["metadata"].__setitem__("kornia_module", "/home/someone/kornia"), "privacy"),
+ (lambda m: m["metadata"].__setitem__("load", {"load_avg_1m": "busy"}), "privacy"),
+ (lambda m: m["results"][0].pop("median_us"), "median_us"),
+ (lambda m: m["results"].clear(), "non-empty"),
+ ):
+ payload = _valid_payload()
+ mutate(payload)
+ p.write_text(json.dumps(payload))
+ assert any(needle in e for e in results_schema.validate_artefact(p)), needle
+
+
+def test_all_committed_artefacts_are_valid() -> None:
+ paths = sorted((Path(__file__).parent).glob("*/*_results/*.json"))
+ assert paths, "no comparison artefacts matched benchmarks/*/*_results/*.json; update the glob with the layout"
+ for path in paths:
+ assert results_schema.validate_artefact(path) == [], f"{path} invalid"
+
+
def test_non_object_payload_rejected(tmp_path) -> None:
p = tmp_path / "0.9.0rc1" / "filters--test-box--cpu.json"
p.parent.mkdir()
diff --git a/kornia/feature/hardnet.py b/kornia/feature/hardnet.py
index 29508044a..49382c5e4 100644
--- a/kornia/feature/hardnet.py
+++ b/kornia/feature/hardnet.py
@@ -121,6 +121,10 @@ class HardNet(nn.Module):
"""
KORNIA_CHECK_SHAPE(input, ["B", "1", "32", "32"])
x_norm: torch.Tensor = self._normalize_input(input)
+ # oneDNN's float32 convolutions avoid repeated activation reorders with
+ # channels-last input. Keep CUDA's existing layout, which is faster there.
+ if input.device.type == "cpu" and input.dtype == torch.float32:
+ x_norm = x_norm.to(memory_format=torch.channels_last)
x_features: torch.Tensor = self.features(x_norm)
x_out = x_features.view(x_features.size(0), -1)
# A constant patch drives the features to zero; the default `eps` is not representable in
diff --git a/kornia/feature/keynet.py b/kornia/feature/keynet.py
index 6cb17a916..8e4280656 100644
--- a/kornia/feature/keynet.py
+++ b/kornia/feature/keynet.py
@@ -112,6 +112,11 @@ class _LearnableBlock(nn.Sequential):
self.conv2 = _KeyNetConvBlock()
def forward(self, x: torch.Tensor) -> torch.Tensor:
+ # These narrow convolutions benefit from channel-contiguous activations on
+ # CPU and CUDA. Convert once at the block boundary, without changing the
+ # parameter layout or the pretrained state-dict contract.
+ if x.dtype == torch.float32 and x.device.type in ("cpu", "cuda"):
+ x = x.to(memory_format=torch.channels_last)
x = self.conv2(self.conv1(self.conv0(x)))
return x
diff --git a/kornia/feature/orientation.py b/kornia/feature/orientation.py
index d3bd38f8b..da33de44f 100644
--- a/kornia/feature/orientation.py
+++ b/kornia/feature/orientation.py
@@ -64,6 +64,13 @@ class PatchDominantGradientOrientation(nn.Module):
num_angular_bins: number of histogram bins.
eps: for safe division, and arctan.
+ Note:
+ Each gradient pixel is accumulated into its two neighbouring histogram bins with
+ ``scatter_add_``. On CUDA that accumulation uses atomics, so two calls on identical input
+ can differ at the ulp level, and a patch whose two strongest bins are nearly tied can
+ return the neighbouring peak. ``torch.use_deterministic_algorithms(True)`` selects the
+ deterministic kernel and restores run-to-run reproducibility.
+
"""
def __init__(self, patch_size: int = 32, num_angular_bins: int = 36, eps: float = 1e-8) -> None:
@@ -129,13 +136,21 @@ class PatchDominantGradientOrientation(nn.Module):
bo1_big = (bo0_big + 1) % self.num_ang_bins
wo0_big = (1.0 - wo1_big) * mag
wo1_big = wo1_big * mag
- ang_bins_list = []
- for i in range(self.num_ang_bins):
- ang_bins_i = F.adaptive_avg_pool2d(
- (bo0_big == i).to(patch.dtype) * wo0_big + (bo1_big == i).to(patch.dtype) * wo1_big, (1, 1)
- )
- ang_bins_list.append(ang_bins_i)
- ang_bins = torch.cat(ang_bins_list, 1).view(-1, 1, self.num_ang_bins)
+ # Each pixel votes into just two bins. Accumulate those votes directly instead
+ # of scanning the entire patch once per angular bin. Like average pooling,
+ # accumulate half-precision inputs in float32, then divide before casting back.
+ accumulation_dtype = torch.float64 if patch.dtype == torch.float64 else torch.float32
+ ang_bins = torch.zeros(patch.shape[0], self.num_ang_bins, device=patch.device, dtype=accumulation_dtype)
+ # The `%` after the integer conversion only keeps the index in range: a NaN orientation
+ # casts to an arbitrary integer. A patch with NaN pixels returns a finite but arbitrary
+ # angle, as it did before this accumulation; the `max`/`where` below do not propagate NaN.
+ ang_bins.scatter_add_(
+ 1, bo0_big.flatten(1).long() % self.num_ang_bins, wo0_big.flatten(1).to(accumulation_dtype)
+ )
+ ang_bins.scatter_add_(
+ 1, bo1_big.flatten(1).long() % self.num_ang_bins, wo1_big.flatten(1).to(accumulation_dtype)
+ )
+ ang_bins = (ang_bins / (W * H)).to(patch.dtype).view(-1, 1, self.num_ang_bins)
angular_smooth_padding = self.angular_smooth.padding
if self.angular_smooth.padding_mode != "zeros":
ang_bins = F.pad(
diff --git a/kornia/feature/scale_space_detector.py b/kornia/feature/scale_space_detector.py
index 2e3602008..622937804 100644
--- a/kornia/feature/scale_space_detector.py
+++ b/kornia/feature/scale_space_detector.py
@@ -186,6 +186,27 @@ def _zero_unfilled(lafs: torch.Tensor, filled: torch.Tensor) -> torch.Tensor:
return torch.where(filled.view(filled.shape[0], -1, 1, 1), lafs, torch.zeros_like(lafs))
+_BUILTIN_SUBPIX = (ConvQuadInterp3d, AdaptiveQuadInterp3d, IterativeQuadInterp3d)
+
+
+def _subpix_dispatch(module: nn.Module) -> Tuple[bool, bool]:
+ """Classify the sub-pixel refiner the detector currently holds.
+
+ Returns ``(is_iterative, batchable)``. ``is_iterative`` means the module is one of the built-in
+ refiners or a subclass, so it accepts ``precomputed_nms_mask``. ``batchable`` means both response
+ signs can be refined in one stacked call: only the exact built-in classes qualify (a subclass may
+ change the per-image semantics), and only without a candidate cap, which
+ :func:`~kornia.geometry.subpix.iterative_quad_interp3d` applies across the whole batch rather
+ than per image. Both flags read through a :func:`torch.compile` wrapper, whether the detector
+ compiled the module itself or the caller passed a compiled one, so the same module is dispatched
+ the same way on every path.
+ """
+ subpix = getattr(module, "_orig_mod", module)
+ is_iterative = isinstance(subpix, _BUILTIN_SUBPIX)
+ batchable = type(subpix) in _BUILTIN_SUBPIX and getattr(subpix, "max_candidates", None) is None
+ return is_iterative, batchable
+
+
class ScaleSpaceDetector(nn.Module):
r"""nn.Module for differentiable local feature detection.
@@ -213,6 +234,9 @@ class ScaleSpaceDetector(nn.Module):
which does nothing. See :class:`~kornia.feature.LAFAffineShapeEstimator` for details.
minima_are_also_good: if True, then both response function minima and maxima are detected.
Useful for symmetric response functions like DoG or Hessian. Default is False.
+ With a built-in ``subpix_module`` both signs are refined in one stacked call, which
+ roughly doubles the peak memory of the refinement step: the response volume and its
+ three coordinate maps are materialised for ``2B`` images at once.
compile_modules: selects which sub-modules to wrap with :func:`torch.compile`.
Pass ``True`` to compile every sub-module, ``False`` (default) for none, or a list
containing any subset of ``["scale_pyr", "resp", "subpix", "ori", "aff"]``.
@@ -264,10 +288,6 @@ class ScaleSpaceDetector(nn.Module):
self.resp = _maybe_compile(resp_module, "resp")
if subpix_module is None:
subpix_module = AdaptiveQuadInterp3d(strict_maxima_bonus=0.0, allow_scale_steps=True)
- # Record before torch.compile wraps the module — isinstance won't match OptimizedModule.
- self._is_iterative_subpix: bool = isinstance(
- subpix_module, (ConvQuadInterp3d, AdaptiveQuadInterp3d, IterativeQuadInterp3d)
- )
self.subpix = _maybe_compile(subpix_module, "subpix")
if ori_module is None:
ori_module = PassLAF()
@@ -301,6 +321,33 @@ class ScaleSpaceDetector(nn.Module):
f"aff={self.aff.__repr__()})"
)
+ def _refine_minmax(
+ self,
+ response: torch.Tensor,
+ max_mask: torch.Tensor,
+ min_mask: torch.Tensor,
+ is_iterative_subpix: bool,
+ batchable_subpix: bool,
+ ) -> Tuple[torch.Tensor, torch.Tensor, torch.Tensor, torch.Tensor]:
+ """Refine both response signs, batching only independent built-in refiners."""
+ if batchable_subpix:
+ # Keep NMS neighbourhoods separate: merging masks would let extrema
+ # move into the other sign's dilation neighbourhood. The candidate cap
+ # excluded above needs separate calls, since it applies across the whole batch.
+ batch = response.shape[0]
+ coords, values = self.subpix(
+ torch.cat((response, -response), dim=0),
+ precomputed_nms_mask=torch.cat((max_mask, min_mask), dim=0),
+ )
+ return coords[:batch], values[:batch], coords[batch:], values[batch:]
+ if is_iterative_subpix:
+ coord_max, response_max = self.subpix(response, precomputed_nms_mask=max_mask)
+ coord_min, response_min = self.subpix(-response, precomputed_nms_mask=min_mask)
+ else:
+ coord_max, response_max = self.subpix(response)
+ coord_min, response_min = self.subpix(-response)
+ return coord_max, response_max, coord_min, response_min
+
def _process_octave(
self,
octave: torch.Tensor,
@@ -310,6 +357,7 @@ class ScaleSpaceDetector(nn.Module):
rotmat: torch.Tensor,
num_levels: int,
is_iterative_subpix: bool,
+ batchable_subpix: bool,
px_size: float,
) -> Tuple[torch.Tensor, torch.Tensor, torch.Tensor]:
"""Process one scale-space octave: response → NMS/subpix → top-K → LAF.
@@ -380,12 +428,9 @@ class ScaleSpaceDetector(nn.Module):
with self._dynamo_config_patch(("subpix",)):
if self.minima_are_also_good:
- if is_iterative_subpix:
- coord_max, response_max = self.subpix(oct_resp, precomputed_nms_mask=max_nms_mask)
- coord_min, response_min = self.subpix(-oct_resp, precomputed_nms_mask=min_nms_mask)
- else:
- coord_max, response_max = self.subpix(oct_resp)
- coord_min, response_min = self.subpix(-oct_resp)
+ coord_max, response_max, coord_min, response_min = self._refine_minmax(
+ oct_resp, max_nms_mask, min_nms_mask, is_iterative_subpix, batchable_subpix
+ )
elif is_iterative_subpix:
coord_max, response_max = self.subpix(oct_resp, precomputed_nms_mask=max_nms_mask)
else:
@@ -405,7 +450,6 @@ class ScaleSpaceDetector(nn.Module):
response_min = _weight_scores(response_min, oct_mask)
take_min_mask = (response_min > response_max) & min_nms_mask
response_max = torch.where(take_min_mask, response_min, response_max)
- coord_max = torch.where(take_min_mask.unsqueeze(2), coord_min, coord_max)
# Candidate positions: original max-NMS plus swapped min-NMS positions.
cand_mask = max_nms_mask | take_min_mask
else:
@@ -426,17 +470,16 @@ class ScaleSpaceDetector(nn.Module):
if B == 1:
nms_idx = mask_flat[0].nonzero(as_tuple=True)[0] # (M,)
resp_cands = resp_flat[0][nms_idx] # (M,)
- coord_cands = coord_flat[0][nms_idx] # (M, 3)
k_eff = min(num_feats, nms_idx.shape[0])
# Only NMS candidates are gathered here, so every returned slot is one.
is_cand = torch.ones(1, k_eff, dtype=torch.bool, device=dev)
if k_eff > 0:
resp_flat_best, local_idx = torch.topk(resp_cands, k=k_eff)
- max_coords_best = coord_cands[local_idx].unsqueeze(0) # (1, k_eff, 3)
+ idxs = nms_idx[local_idx].unsqueeze(0)
resp_flat_best = resp_flat_best.unsqueeze(0) # (1, k_eff)
else:
resp_flat_best = resp_flat.new_zeros(1, 0)
- max_coords_best = coord_flat.new_zeros(1, 0, 3)
+ idxs = nms_idx.new_empty(1, 0)
else:
# Batched fallback: mask non-candidates to -inf so they lose top-K to every finite
# response. (A finite sentinel such as `finfo.min / 2` is not below every finite
@@ -444,12 +487,21 @@ class ScaleSpaceDetector(nn.Module):
resp_masked = resp_flat.masked_fill(~mask_flat, float("-inf"))
k_eff = min(num_feats, resp_masked.size(1))
resp_flat_best, idxs = torch.topk(resp_masked, k=k_eff, dim=1)
- max_coords_best = torch.gather(coord_flat, 1, idxs.unsqueeze(-1).expand(-1, -1, 3))
# `topk` cannot rank among the masked-out positions -- they all carry the same
# `fill` -- so an image with fewer than `num_feats` maxima gets an arbitrary subset
# of non-candidates back. Carry the candidacy of each selected slot forward.
is_cand = torch.gather(mask_flat, 1, idxs)
+ coord_idxs = idxs.unsqueeze(-1).expand(-1, -1, 3)
+ max_coords_best = torch.gather(coord_flat, 1, coord_idxs)
+ if self.minima_are_also_good:
+ # Merge coordinates only for the selected features, not for every voxel
+ # in the octave (three full image volumes per scale level).
+ coord_min_flat = coord_min.movedim(2, -1).reshape(B, -1, 3)
+ min_coords_best = torch.gather(coord_min_flat, 1, coord_idxs)
+ take_min_best = torch.gather(take_min_mask.reshape(B, -1), 1, idxs)
+ max_coords_best = torch.where(take_min_best.unsqueeze(-1), min_coords_best, max_coords_best)
+
B, N = resp_flat_best.size()
max_coords_best = _scale_index_to_scale(max_coords_best, scale_sigmas, num_levels)
@@ -533,7 +585,10 @@ class ScaleSpaceDetector(nn.Module):
f"Gotcha {type(self.scale_pyr.n_levels)}"
)
rotmat = torch.eye(2, dtype=dtype, device=dev).view(1, 1, 2, 2)
- is_iterative_subpix = self._is_iterative_subpix
+ # Read the live module once per forward, so a refiner swapped in after construction, or a
+ # compiled one passed by the caller, is dispatched consistently on both the single-sign and
+ # the minima-and-maxima path.
+ is_iterative_subpix, batchable_subpix = _subpix_dispatch(self.subpix)
px_size0 = 0.5 if self.scale_pyr.double_image else 1.0
px_sizes = [px_size0 * (2.0**i) for i in range(len(sp))]
@@ -545,7 +600,15 @@ class ScaleSpaceDetector(nn.Module):
n_oct = len(sp)
results: List[Tuple[torch.Tensor, torch.Tensor, torch.Tensor]] = [
self._process_octave(
- sp[i], sigmas[i], num_feats, mask, rotmat, num_levels, is_iterative_subpix, px_sizes[i]
+ sp[i],
+ sigmas[i],
+ num_feats,
+ mask,
+ rotmat,
+ num_levels,
+ is_iterative_subpix,
+ batchable_subpix,
+ px_sizes[i],
)
for i in range(n_oct)
]
diff --git a/tests/feature/test_keynet.py b/tests/feature/test_keynet.py
index acadb9506..96b4f2de4 100644
--- a/tests/feature/test_keynet.py
+++ b/tests/feature/test_keynet.py
@@ -23,6 +23,11 @@ from testing.base import BaseTester
class TestKeyNet(BaseTester):
+ def test_dynamo(self, device, dtype, torch_optimizer):
+ inp = torch.rand(1, 1, 32, 32, device=device, dtype=dtype)
+ model = KeyNet().to(device, dtype)
+ self.assert_close(torch_optimizer(model)(inp), model(inp))
+
def test_shape(self, device, dtype):
inp = torch.rand(1, 1, 16, 16, device=device, dtype=dtype)
keynet = KeyNet().to(device, dtype)
diff --git a/tests/feature/test_local_features_orientation.py b/tests/feature/test_local_features_orientation.py
index 574786212..769bf478b 100644
--- a/tests/feature/test_local_features_orientation.py
+++ b/tests/feature/test_local_features_orientation.py
@@ -58,6 +58,33 @@ class TestPassLAF(BaseTester):
class TestPatchDominantGradientOrientation(BaseTester):
+ def test_dynamo(self, device, dtype, torch_optimizer):
+ inp = torch.rand(2, 1, 32, 32, device=device, dtype=dtype)
+ model = PatchDominantGradientOrientation(32).to(device, dtype)
+ self.assert_close(torch_optimizer(model)(inp), model(inp))
+
+ @pytest.mark.parametrize(
+ "size,bins,expected",
+ [
+ (13, 8, [-3.7174663347627757e-10, -0.17437093434051, -1.473217788509725, -1.4827622084527432]),
+ (13, 36, [0.0, -1.567342763450159, -1.5818624223852344, -1.5595019149730796]),
+ (32, 36, [0.0, 0.010140574846868589, -1.574052870184957, -1.5575465831257427]),
+ ],
+ )
+ def test_histogram_reference(self, device, dtype, size, bins, expected):
+ # Kornia 601b5a4a reference: one masked adaptive-average-pool per angular bin, using the
+ # deterministic patch generation below in float64. The literals hold in float32 to 8e-7 rad
+ # on CPU and MPS (no peak is a near-tie), so the pin also runs on the MPS gate. Half precision
+ # quantises the histogram bins before the parabolic peak refinement and moves the angle by
+ # several half-precision ulps, so the literals do not apply there.
+ if dtype in (torch.float16, torch.bfloat16):
+ pytest.skip("float64 reference literals; half precision quantises the histogram bins")
+ t = torch.linspace(-1, 1, size, device=device, dtype=dtype)
+ y, x = torch.meshgrid(t, t, indexing="ij")
+ patches = torch.stack([torch.sin(3 * x + a) * torch.cos(4 * y - a) + 0.3 * x * y for a in [0, 0.4, 1.1, 2]])
+ actual = PatchDominantGradientOrientation(size, bins).to(device, dtype)(patches[:, None])
+ self.assert_close(actual, torch.tensor(expected, device=device, dtype=dtype))
+
def test_shape(self, device):
inp = torch.rand(1, 1, 32, 32, device=device)
ori = PatchDominantGradientOrientation(32).to(device)
diff --git a/tests/feature/test_scale_space_detector.py b/tests/feature/test_scale_space_detector.py
index 40ede8d41..548a6557c 100644
--- a/tests/feature/test_scale_space_detector.py
+++ b/tests/feature/test_scale_space_detector.py
@@ -27,7 +27,7 @@ from kornia.feature.scale_space_detector import (
_resize_mask,
get_default_detector_config,
)
-from kornia.geometry.subpix import ConvQuadInterp3d
+from kornia.geometry.subpix import AdaptiveQuadInterp3d, ConvQuadInterp3d, IterativeQuadInterp3d
from kornia.geometry.transform import ScalePyramid
from testing.base import (
@@ -78,6 +78,71 @@ def _canonical_order(lafs: torch.Tensor, responses: torch.Tensor) -> tuple[torch
class TestScaleSpaceDetector(BaseTester):
+ @pytest.mark.parametrize("subpix_type", [AdaptiveQuadInterp3d, ConvQuadInterp3d, IterativeQuadInterp3d])
+ @pytest.mark.parametrize("batch", [1, 2])
+ @pytest.mark.parametrize("bonus", [0.0, 10.0])
+ @pytest.mark.parametrize("max_candidates", [None, 3])
+ def test_joint_extrema_matches_separate_refinement(self, device, dtype, subpix_type, batch, bonus, max_candidates):
+ # A subclass remains on the general extension path, which refines each sign
+ # independently. Pin the batched built-in path to that reference, including
+ # signed/weighted responses and gradients through the selected features. The value
+ # comparison alone cannot fail on a tree without the stacked call, where both detectors
+ # refine separately, so the refiner call counts pin that the built-in path was taken.
+ class SeparateSubpix(subpix_type):
+ pass
+
+ if subpix_type is ConvQuadInterp3d and max_candidates is not None:
+ pytest.skip("ConvQuadInterp3d has no candidate cap")
+ torch.manual_seed(17)
+ img = torch.rand(batch, 1, 96, 99, device=device, dtype=dtype, requires_grad=True)
+ mask = torch.rand(batch, 1, 96, 99, device=device, dtype=dtype)
+ mask[..., :8, :] = 0
+
+ def detector(subpix):
+ return ScaleSpaceDetector(
+ 12,
+ mr_size=1.0,
+ scale_pyr_module=ScalePyramid(3, 1.6, 16, extra_levels=3),
+ resp_module=kornia.feature.BlobDoG(),
+ subpix_module=subpix,
+ minima_are_also_good=True,
+ scale_space_response=True,
+ ).to(device, dtype)
+
+ def count_calls(module):
+ calls = []
+ forward = module.forward
+
+ def counted(*args, **kwargs):
+ calls.append(1)
+ return forward(*args, **kwargs)
+
+ module.forward = counted
+ return calls
+
+ kwargs = {"strict_maxima_bonus": bonus}
+ if subpix_type is not ConvQuadInterp3d:
+ kwargs["max_candidates"] = max_candidates
+ joint, separate = subpix_type(**kwargs), SeparateSubpix(**kwargs)
+ joint_calls, separate_calls = count_calls(joint), count_calls(separate)
+ actual = detector(joint)(img, mask)
+ expected = detector(separate)(img, mask)
+ assert actual[0].ne(0).any()
+ for a, e in zip(actual, expected):
+ self.assert_close(a, e)
+ # The subclass refines each sign of every octave in its own call. The built-in refiner
+ # stacks both signs into one call, unless a candidate cap keeps it on the separate path.
+ assert len(separate_calls) > 0 and len(separate_calls) % 2 == 0
+ assert len(joint_calls) == (len(separate_calls) if max_candidates is not None else len(separate_calls) // 2)
+ if dtype is torch.float16:
+ # ConvQuadInterp3d's float16 backward is NaN over part of the image on CPU (#4257), on
+ # `main` as well as here and on both paths, and `assert_close` treats matching NaNs as a
+ # mismatch. The gradient half of this pin runs in the other dtypes.
+ return
+ actual_grad = torch.autograd.grad(sum(x.sum() for x in actual), img, retain_graph=True)[0]
+ expected_grad = torch.autograd.grad(sum(x.sum() for x in expected), img)[0]
+ self.assert_close(actual_grad, expected_grad)
+
def test_shape(self, device, dtype):
inp = torch.rand(1, 1, 32, 32, device=device, dtype=dtype)
n_feats = 10
diff --git a/tests/test_benchmark_results.py b/tests/test_benchmark_results.py
index 64cd4e528..40a508935 100644
--- a/tests/test_benchmark_results.py
+++ b/tests/test_benchmark_results.py
@@ -34,3 +34,11 @@ def test_all_committed_results_are_valid() -> None:
results_root = REPO_ROOT / "benchmarks" / "results"
for path in sorted(results_root.rglob("*.json")):
assert results_schema.validate_result(path) == [], f"{path} invalid"
+
+
+def test_all_committed_artefacts_are_valid() -> None:
+ """Comparison artefacts (A/B and cross-release raw JSON next to a report) pass the content rules."""
+ paths = sorted((REPO_ROOT / "benchmarks").glob("*/*_results/*.json"))
+ assert paths, "no comparison artefacts matched benchmarks/*/*_results/*.json; update the glob with the layout"
+ for path in paths:
+ assert results_schema.validate_artefact(path) == [], f"{path} invalid"
diff --git a/tests/test_sift_runtime_plot.py b/tests/test_sift_runtime_plot.py
new file mode 100644
index 000000000..7a8bcbddd
--- /dev/null
+++ b/tests/test_sift_runtime_plot.py
@@ -0,0 +1,189 @@
+# LICENSE HEADER MANAGED BY add-license-header
+#
+# Copyright 2018 Kornia Team
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+"""Validate SIFT chart data without requiring Matplotlib or running benchmarks."""
+
+from __future__ import annotations
+
+import copy
+import importlib.util
+import json
+import math
+from pathlib import Path
+from typing import Any
+
+import pytest
+
+REPO_ROOT = Path(__file__).resolve().parent.parent
+_spec = importlib.util.spec_from_file_location(
+ "plot_sift_runtime", REPO_ROOT / "benchmarks" / "feature" / "plot_sift_runtime.py"
+)
+sift_plot = importlib.util.module_from_spec(_spec)
+_spec.loader.exec_module(sift_plot)
+
+
+def document() -> dict[str, Any]:
+ """Return independent benchmark data with complete comparison metadata."""
+ return {
+ "metadata": {
+ "num_features": 4096,
+ "python": "3.13.5",
+ "torch": "2.14.0+cu130",
+ "cuda_device": "NVIDIA GeForce RTX 4090",
+ "input_sha256": "a" * 64,
+ "torch_num_threads": 1,
+ "opencv_num_threads": 1,
+ },
+ "results": [
+ {
+ "op": "SIFTFeatureScaleSpace",
+ "series": "current",
+ "device": "cuda",
+ "batch": 4,
+ "height": 640,
+ "width": 800,
+ "median_us": 8000.0,
+ "iqr_us": 800.0,
+ "features_per_image": [4096] * 4,
+ "peak_extra_cuda_bytes": 1048576,
+ }
+ ],
+ }
+
+
+def write_document(tmp_path: Path, document: dict[str, Any], name: str = "run.json") -> Path:
+ """Write a test result using the benchmark metadata/results envelope."""
+ path = tmp_path / name
+ path.write_text(json.dumps(document))
+ return path
+
+
[email protected]("batch, expected", [(1, (8.0, 0.8)), (4, (2.0, 0.2)), (8, (1.0, 0.1))])
+def test_normalize_batch_latency(batch: int, expected: tuple[float, float]) -> None:
+ """Both median and IQR are converted from batch microseconds to ms/image."""
+ assert sift_plot.normalize_timing({"batch": batch, "median_us": 8000, "iqr_us": 800}) == expected
+
+
[email protected]("median", [0, -1, math.nan, math.inf, -math.inf, None, True, "8000"])
+def test_reject_invalid_median(document: dict[str, Any], median: Any) -> None:
+ with pytest.raises(ValueError, match="median_us"):
+ sift_plot.normalize_timing(document["results"][0] | {"median_us": median})
+
+
[email protected]("batch", [0, -1, 1.5, True, None, "4"])
+def test_reject_invalid_batch(document: dict[str, Any], batch: Any) -> None:
+ with pytest.raises(ValueError, match="batch"):
+ sift_plot.normalize_timing(document["results"][0] | {"batch": batch})
+
+
[email protected]("spread", [-1, math.nan, math.inf, None, True, "800"])
+def test_reject_invalid_iqr(document: dict[str, Any], spread: Any) -> None:
+ with pytest.raises(ValueError, match="iqr_us"):
+ sift_plot.normalize_timing(document["results"][0] | {"iqr_us": spread})
+
+
+def test_zero_iqr_is_valid(document: dict[str, Any]) -> None:
+ assert sift_plot.normalize_timing(document["results"][0] | {"iqr_us": 0}) == (2.0, 0.0)
+
+
+def test_load_normalized_rows(tmp_path: Path, document: dict[str, Any]) -> None:
+ assert sift_plot.load_rows([write_document(tmp_path, document)]) == {("current", "cuda", 4): (2.0, 0.2)}
+
+
+def test_reject_duplicate_measurements(tmp_path: Path, document: dict[str, Any]) -> None:
+ path = write_document(tmp_path, document)
+ with pytest.raises(ValueError, match="duplicate measurement"):
+ sift_plot.load_rows([path, path])
+
+
[email protected]("height,width", [(800, 640), (320, 800), (640, 400)])
+def test_reject_wrong_image_dimensions(tmp_path: Path, document: dict[str, Any], height: int, width: int) -> None:
+ document["results"][0].update(height=height, width=width)
+ with pytest.raises(ValueError, match="height=640, width=800"):
+ sift_plot.load_rows([write_document(tmp_path, document)])
+
+
[email protected]("count", [None, 2048, "4096"])
+def test_reject_wrong_feature_budget(tmp_path: Path, document: dict[str, Any], count: Any) -> None:
+ document["metadata"]["num_features"] = count
+ with pytest.raises(ValueError, match="num_features=4096"):
+ sift_plot.load_rows([write_document(tmp_path, document)])
+
+
+def test_reject_opencv_on_cuda(tmp_path: Path, document: dict[str, Any]) -> None:
+ document["results"][0].update(op="OpenCV SIFT", series="OpenCV", batch=1)
+ with pytest.raises(ValueError, match="OpenCV must be CPU batch one"):
+ sift_plot.load_rows([write_document(tmp_path, document)])
+
+
+def test_hardware_subtitle(tmp_path: Path, document: dict[str, Any]) -> None:
+ path = write_document(tmp_path, document)
+ assert sift_plot.describe_environment([path], "Intel Core i7-14700K") == (
+ "NVIDIA GeForce RTX 4090 · Intel Core i7-14700K · PyTorch 2.14.0"
+ )
+
+
+ "key,value",
+ [
+ ("python", "3.12.0"),
+ ("input_sha256", "b" * 64),
+ ("torch_num_threads", 2),
+ ("opencv_num_threads", 2),
+ ("cuda_device", "NVIDIA GeForce RTX 3090"),
+ ("torch", "2.13.0+cu130"),
+ ],
+)
+def test_reject_mixed_environments(tmp_path: Path, document: dict[str, Any], key: str, value: Any) -> None:
+ first = write_document(tmp_path, document)
+ other = copy.deepcopy(document)
+ other["metadata"][key] = value
+ second = write_document(tmp_path, other, "other.json")
+ with pytest.raises(ValueError, match=key):
+ sift_plot.describe_environment([first, second])
+
+
[email protected]("key", ["python", "input_sha256", "torch_num_threads", "opencv_num_threads", "torch"])
+def test_reject_missing_environment_metadata(tmp_path: Path, document: dict[str, Any], key: str) -> None:
+ del document["metadata"][key]
+ with pytest.raises(ValueError, match="metadata"):
+ sift_plot.describe_environment([write_document(tmp_path, document)])
+
+
+def test_caption_discloses_actual_output_counts(tmp_path: Path, document: dict[str, Any]) -> None:
+ document["results"].append(
+ document["results"][0]
+ | {"op": "OpenCV SIFT", "series": "OpenCV", "device": "cpu", "batch": 1, "features_per_image": [2678]}
+ )
+ caption = sift_plot.describe_outputs([write_document(tmp_path, document)])
+ assert caption == (
+ "Kornia: 4096 nonzero LAF/descriptor slots/image; OpenCV: 2678 keypoints/image. "
+ "RootSIFT enabled; native detection/filtering differ."
+ )
+
+
+def test_caption_reports_output_count_range(tmp_path: Path, document: dict[str, Any]) -> None:
+ document["results"][0]["features_per_image"] = [0, 2048, 4000, 4096]
+ caption = sift_plot.describe_outputs([write_document(tmp_path, document)])
+ assert "Kornia: 0\N{EN DASH}4096 nonzero LAF/descriptor slots/image" in caption
+
+
[email protected]("counts", [None, [], [4096], [4096] * 5, [-1] * 4, [True] * 4, [1.5] * 4])
+def test_reject_invalid_output_counts(tmp_path: Path, document: dict[str, Any], counts: Any) -> None:
+ document["results"][0]["features_per_image"] = counts
+ with pytest.raises(ValueError, match="count"):
+ sift_plot.describe_outputs([write_document(tmp_path, document)])