Files
vit-pytorch/vit_pytorch
Amit Moryossef a1ee1daa1a optimize NaViT with SDPA and vectorized forward pass (#353)
- Replace manual attention with F.scaled_dot_product_attention
- Use repeat_interleave instead of meshgrid for position computation
- Build image_ids efficiently with repeat_interleave instead of F.pad
- Remove unused Rearrange import

~56% speedup (91ms -> 58ms on 512 variable-sized images)
Numerically equivalent (max diff ~5e-4, within flash attention tolerance)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude <noreply@anthropic.com>
2025-12-06 04:56:40 -08:00
..
2023-10-19 18:16:46 -07:00
2022-04-06 16:12:17 -07:00
2022-04-06 16:12:17 -07:00
2023-06-28 08:02:43 -07:00
2025-11-22 08:12:01 -08:00
2023-10-24 12:47:21 -07:00
2023-10-13 09:15:13 -07:00