π Geometric Computer Vision Library for Spatial AI
Python artificial-intelligencecomputer-visiondeep-learninghacktoberfestimage-processingmachine-learningneural-networkpythonpytorchroboticsspatial-ai
test: refresh MPS baseline provenance (#4344)
victorwon2001e46ed71a7412
diff --git a/.github/workflows/pr_test_cpu.yml b/.github/workflows/pr_test_cpu.ymlindex ffaa97605..54a58688f 100644--- a/.github/workflows/pr_test_cpu.yml+++ b/.github/workflows/pr_test_cpu.yml@@ -187,7 +187,8 @@ jobs:# 664 tests down across every subpackage -- `linalg.inv`, `linalg.solve`, `inv_ex`,# `lu_factor_ex` and `F.conv3d` all route through it -- where the same runner on torch# 2.9.1 had 200 failures. The blocker is the *virtual* GPU and not macOS 26: a physical M1- # on macOS 26.5 compiles those shaders and produces the same 14 failures this leg records.+ # on macOS 26.5 compiled those shaders in the #4202 comparison. The strict manifest now has+ # 12 entries after #4185 fixed the two YUV420/YUV422 empty-input failures.# The macOS 15 image is Metal 3 and takes the older kernel path, which is the path that# works on the runner fleet. Two consequences: no job here exercises the Metal 4 path that# users on current macOS run, and when GitHub retires macos-15 this leg stops schedulingdiff --git a/TESTING.md b/TESTING.mdindex d0002bb96..63e14b7f6 100644--- a/TESTING.md+++ b/TESTING.md@@ -338,7 +338,7 @@ they can raise.The `padding_mode="border"` issue in `F.grid_sample` (2D) is worked around in the implementation (`kornia/feature/laf.py`) by clamping the sampling grid to the outermost pixel *centers*, at `Β±(1 - 1/size)`, and using `padding_mode="zeros"`, which is exactly equivalent. Clamping to `[-1, 1]` is not: with `align_corners=False` that is the outer edge of the border pixel, where bilinear sampling blends it with the zero padding.-**CI coverage.** Pull-request CI runs one blocking MPS leg (`tests-mps` in `.github/workflows/pr_test_cpu.yml`): the newest Python and the newest pinned PyTorch, `float32`, on the GitHub-hosted **`macos-15`** Apple-silicon image. The image is pinned deliberately. `macos-latest` is `macos-26-arm64`, whose GPU is paravirtualized, and on macOS 26 torch 2.14 emits Metal 4 `mpp::tensor_ops::matmul2d` cooperative-tensor shaders that this virtual GPU cannot compile β one specialization failed 664 tests across every subpackage, since `linalg.inv`, `linalg.solve`, `inv_ex`, `lu_factor_ex` and `F.conv3d` all route through it. The defect is the *virtual* GPU, not macOS 26: a physical M1 on macOS 26.5 compiles those shaders and produces the same 14 failures as this leg. macOS 15 is Metal 3 and takes the older kernel path, which is the path that happens to work on the runner fleet. Two consequences worth knowing: no job in this repository now exercises the Metal 4 path that users on current macOS actually run, and when GitHub retires the `macos-15` image this leg stops scheduling and `collector` goes red with no fallback. Re-test `macos-latest` once upstream guards those kernels by device capability; `macos-14` segfaults inside MPS kernels and must never be used. The comparison is recorded in [#4159](https://github.com/kornia/kornia/issues/4159#issuecomment-5532655834). The exact known-failure baseline from [#4159](https://github.com/kornia/kornia/issues/4159) lives in `testing/known_failure_xfails/mps_float32.txt`. `--xfail-known-failures` applies those entries as strict xfails with their exact exception types. A new failure, a different exception, a skipped recorded test, or a fixed test therefore makes CI red.+**CI coverage.** Pull-request CI runs one blocking MPS leg (`tests-mps` in `.github/workflows/pr_test_cpu.yml`): the newest Python and the newest pinned PyTorch, `float32`, on the GitHub-hosted **`macos-15`** Apple-silicon image. The image is pinned deliberately. `macos-latest` is `macos-26-arm64`, whose GPU is paravirtualized, and on macOS 26 torch 2.14 emits Metal 4 `mpp::tensor_ops::matmul2d` cooperative-tensor shaders that this virtual GPU cannot compile β one specialization failed 664 tests across every subpackage, since `linalg.inv`, `linalg.solve`, `inv_ex`, `lu_factor_ex` and `F.conv3d` all route through it. The defect is the *virtual* GPU, not macOS 26: a physical M1 on macOS 26.5 compiled those shaders in the #4202 comparison. macOS 15 is Metal 3 and takes the older kernel path, which is the path that happens to work on the runner fleet. Two consequences worth knowing: no job in this repository now exercises the Metal 4 path that users on current macOS actually run, and when GitHub retires the `macos-15` image this leg stops scheduling and `collector` goes red with no fallback. Re-test `macos-latest` once upstream guards those kernels by device capability; `macos-14` segfaults inside MPS kernels and must never be used. The comparison is recorded in [#4159](https://github.com/kornia/kornia/issues/4159#issuecomment-5532655834). The exact known-failure baseline from [#4159](https://github.com/kornia/kornia/issues/4159) lives in `testing/known_failure_xfails/mps_float32.txt`: #4202 reduced it from 200 entries to 14, and #4185 then fixed the YUV420/YUV422 empty-input cases, leaving the current 12-entry baseline. `--xfail-known-failures` applies those entries as strict xfails with their exact exception types. A new failure, a different exception, a skipped recorded test, or a fixed test therefore makes CI red.Run the identical contract locally with `pixi run test-mps`. `PYTORCH_ENABLE_MPS_FALLBACK=1` silently routes missing MPS kernels to the CPU and invalidates the baseline, so unset it first. The manifest is a full-suite contract and is not intended for `-k` or partial-directory runs; use `pixi run test-module ... --device=mps --dtype=float32` for focused diagnosis without the manifest. "Full suite" means the suite as an `mps`-only run collects it: tests marked `device_agnostic` are deselected there and covered by the CPU jobs, so they never appear in the manifest.diff --git a/testing/known_failure_xfails/mps_float32.txt b/testing/known_failure_xfails/mps_float32.txtindex 670444fe1..d346e142d 100644--- a/testing/known_failure_xfails/mps_float32.txt+++ b/testing/known_failure_xfails/mps_float32.txt@@ -1,12 +1,13 @@-# Exact failure baseline recorded from-# https://github.com/kornia/kornia/actions/runs/33808269822/job/100824208527 -- that job ran-# without --xfail-known-failures, so it reports these 12 as failures: it is the run the baseline-# was recorded from, not a replay of this file.-# macos-15-arm64, Python 3.13, PyTorch 2.14.0, MPS float32, no CPU fallback,+# Exact strict baseline verified by+# https://github.com/kornia/kornia/actions/runs/33920557535/job/101177935411 -- the post-#4185+# full-suite replay completed with --xfail-known-failures: 8327 passed, 4126 skipped, 95 deselected,+# 43 xfailed, 9 xpassed in 425.15s. The 12 entries below are the strict MPS manifest.+# macos-15-arm64, Python 3.13.11, PyTorch 2.14.0, MPS float32, no CPU fallback,# one pytest process for the full suite (tests marked device_agnostic are deselected on an mps-only run).# Remove an entry when it becomes a strict XPASS; fix or explicitly add any new failure. Tracked in #4159.# torch 2.14.0 added MPS kernels for the eigen/QR/LU/SVD family and for both grid_sample backward-# passes, which took this baseline from 200 entries to 12. One cause remains:+# passes, which took the baseline from 200 entries to 14. #4185 then fixed the two YUV420/YUV422+# empty-input failures, leaving 12 entries. One cause remains:# NotImplementedError aten::_linalg_eigvals has no MPS kernel (the 5-point essential solver).# tests/geometry/test_ransac.py is skipped on MPS, not pinned: it aborts the process (#4204).# Keep the entries sorted by node ID: KnownFailureTracker prints its regeneration output sorted,