Skip to content

🐍 Geometric Computer Vision Library for Spatial AI

docs: refresh the half-precision numbers and annotate the morphology row (#4082)

Dmytro Mishkin01fff4fc99b0
diff --git a/README.md b/README.md
index 9af63a820..d214e4d3b 100644
--- a/README.md
+++ b/README.md
@@ -82,7 +82,7 @@ Leverage pre-trained AI models optimized for a variety of vision tasks, all with
| `kornia.color` | ⚠️ | ⚠️ | Most conversions work for both; FFT-based ops may fail |
| `kornia.filters` | ⚠️ | ⚠️ | Basic filters work; FFT-based ops may fail on CUDA |
| `kornia.enhance` | ⚠️ | ⚠️ | Histogram eq / gamma / ZCA work (linalg ops use cast helpers) |
-| `kornia.morphology` | ✅ | ✅ | Pure conv/pool ops; no dtype restrictions |
+| `kornia.morphology` | ✅ | ✅ | Conv/pool ops; `top_hat` / `bottom_hat` / `gradient` also subtract two dilation/erosion results, so bfloat16 loses ~0.4% relative accuracy — within kornia's own bfloat16 tolerance, though 6 tests override it with a tighter one ([#4081](https://github.com/kornia/kornia/issues/4081)) |
| `kornia.augmentation` | ⚠️ | ⚠️ | Most ops work; precision-sensitive transforms may be inaccurate |
| `kornia.geometry.transform` | ⚠️ | ⚠️ | Affine/warp/resize work via cast helpers; thin-plate spline may fail |
| `kornia.geometry.camera` | ⚠️ | ⚠️ | Pinhole model and most camera ops work; `StereoCamera` accepts both |
@@ -99,16 +99,21 @@ Leverage pre-trained AI models optimized for a variety of vision tasks, all with
✅ Supported   ⚠️ Partial   ❌ Not supported
-**Test results** (commit `6131e98`, 2026-03-21):
-
-| Run | Passed | Failed | Skipped | Pass% |
-|-----|-------:|-------:|--------:|------:|
-| CPU float32 *(baseline)* | 7647 | 3 | 3269 | **99.9%** |
-| CUDA float32 *(baseline)* | 7634 | 3 | 3280 | **99.9%** |
-| CPU float16 | 6866 | 747 | 3306 | **90.1%** |
-| CPU bfloat16 | 6838 | 812 | 3269 | **89.3%** |
-| CUDA float16 *(KORNIA_TEST_IN_SUBPROCESS=1)* | 6727 | 643 | 3556 | **91.3%** |
-| CUDA bfloat16 *(KORNIA_TEST_IN_SUBPROCESS=1)* | 6695 | 713 | 3518 | **90.4%** |
+**Test results:**
+
+| Run | Passed | Failed | Skipped | Pass% | Measured |
+|-----|-------:|-------:|--------:|------:|----------|
+| CPU float32 *(baseline)* | 8499 | 0 | 3535 | **100.0%** | `4ab79c78`, 2026-08-29 |
+| CPU float16 | 7751 | 689 | 3595 | **91.8%** | `4ab79c78`, 2026-08-29 |
+| CPU bfloat16 | 7794 | 695 | 3545 | **91.8%** | `4ab79c78`, 2026-08-29 |
+| CUDA float32 *(baseline)* | 7634 | 3 | 3280 | **99.9%** | `6131e98`, 2026-03-21 |
+| CUDA float16 *(KORNIA_TEST_IN_SUBPROCESS=1)* | 6727 | 643 | 3556 | **91.3%** | `6131e98`, 2026-03-21 |
+| CUDA bfloat16 *(KORNIA_TEST_IN_SUBPROCESS=1)* | 6695 | 713 | 3518 | **90.4%** | `6131e98`, 2026-03-21 |
+
+Reproduce the two CPU half rows with `pixi run test-half` and the CPU float32 baseline with `pixi run test-f32`
+(`test-half` pins `KORNIA_TEST_DTYPE` to `float16,bfloat16`, so it cannot produce the baseline). The half-precision
+suite is not run in CI (see [#4070](https://github.com/kornia/kornia/issues/4070)), so these numbers are refreshed
+by hand.
See the [full precision guide](https://kornia.readthedocs.io/en/stable/get-started/precision.html) for details.
diff --git a/docs/source/get-started/precision.rst b/docs/source/get-started/precision.rst
index d2ee0f216..3cb4578a3 100644
--- a/docs/source/get-started/precision.rst
+++ b/docs/source/get-started/precision.rst
@@ -31,7 +31,11 @@ This page documents which kornia modules support half-precision floating-point d
* - ``kornia.morphology``
- ✅ Yes
- ✅ Yes
- - Uses only convolution and pooling; no dtype restrictions.
+ - Convolution and pooling; ``top_hat``, ``bottom_hat`` and ``gradient``
+ also subtract two dilation/erosion results, so bfloat16 loses roughly
+ 0.4% relative accuracy on them. That is within kornia's own bfloat16
+ tolerance, but six tests override it with a tighter constant and fail;
+ see `issue #4081 <https://github.com/kornia/kornia/issues/4081>`_.
* - ``kornia.augmentation``
- ⚠️ Partial
- ⚠️ Partial
@@ -111,8 +115,14 @@ Legend
Test Results
------------
-Measured on commit ``6131e98`` (2026-03-21), full test suite (no ``--runslow``).
-Pass% = passed ÷ (passed + failed); skipped and xfailed tests are excluded.
+Full test suite (no ``--runslow``). Pass% = passed ÷ (passed + failed);
+skipped and xfailed tests are excluded. CPU rows were measured on commit
+``4ab79c78`` (2026-08-29); CUDA rows are still from ``6131e98`` (2026-03-21).
+
+The half-precision suite is not run in CI (see `issue #4070
+<https://github.com/kornia/kornia/issues/4070>`_), so these numbers are refreshed by hand: the two CPU half rows
+with ``pixi run test-half``, and the CPU float32 baseline with ``pixi run test-f32``, since ``test-half`` pins
+``KORNIA_TEST_DTYPE`` to ``float16,bfloat16``.
.. list-table::
:header-rows: 1
@@ -124,25 +134,25 @@ Pass% = passed ÷ (passed + failed); skipped and xfailed tests are excluded.
- Skipped
- Pass%
* - CPU float32 *(baseline)*
- - 7647
- - 3
- - 3269
- - **99.9%**
+ - 8499
+ - 0
+ - 3535
+ - **100.0%**
+ * - CPU float16
+ - 7751
+ - 689
+ - 3595
+ - **91.8%**
+ * - CPU bfloat16
+ - 7794
+ - 695
+ - 3545
+ - **91.8%**
* - CUDA float32 *(baseline)*
- 7634
- 3
- 3280
- **99.9%**
- * - CPU float16
- - 6866
- - 747
- - 3306
- - **90.1%**
- * - CPU bfloat16
- - 6838
- - 812
- - 3269
- - **89.3%**
* - CUDA float16 *(KORNIA_TEST_IN_SUBPROCESS=1)*
- 6727
- 643