Skip to content

🐍 Geometric Computer Vision Library for Spatial AI

550 B
Raw Blame

LightGlue computes its cross-attention with torch.nn.functional.scaled_dot_product_attention on every device, as its self-attention already did, instead of only on CUDA with flash=True. In float32 the matches are the same and the scores move by rounding; in half precision, rounding can also change a few matches. A 2048-keypoint DISK pair matches 1.3-1.7x faster on an Apple M1 CPU, 1.2-1.5x faster on MPS and 2.3-4x faster on an x86 CPU (i7-14700K). On CUDA the default flash=True runs as before, and flash=False matches 1.1-1.2x faster.