fix(workers/people): blockwise float32 density graph (OOM segfault at 26k faces) #975
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/constrained-clustering-oom"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
The constrained forward clustering pass (ADR 0100 / PR #969) builds its density graph over anchor + all unassigned faces of an owner. On a household-scale library (~26k faces in one model space) that meant a full N x N float64 similarity matrix plus two full-size temporaries: ~20.7 GiB simultaneous allocations, which segfaulted OpenBLAS mid-GEMM on the 16 GB deploy host. Every
owner_face_recognitionjob since deploy died hard after fetching embeddings (kernel:segfault ... in libscipy_openblas64_), failed after 3 attempts, and submitted nothing — so the suggestion carousel only ever showednew_person_clusterentries.Fix
_density_graphis now blockwise float32 with a bounded ~192 MiB tile:nan_to_num(copy=False), nonp.triucopy)_cosine_distance_matrixgets the same float32 blockwise treatmentMeasured at n=26213, dim=512: graph build 12 s, peak RSS 2.4 GiB (was: segfault), adjacency lists byte-identical to the brute-force reference across labeled / zero-norm / dimension-mismatch / block-boundary shapes.
Tests
Post-merge
After deploy, the failed
owner_face_recognitionjob needs a re-enqueue (retry or new dirty face) so the carousel fills with the pending merge suggestions for the confirmed anchors.