Repository navigation
Store image-index embeddings as fp16 - #9696
Merged
Merged
Conversation
Persist image and video embeddings with explicit fp16 encoding and a transactional migration. Keep search and projection computation in float32; document backup and rollback expectations.
Compute expected score from independently rounded and renormalized fp16 vector.
JPPhoto
requested review from
Pfannkuchensack,
blessedcoolant,
dunkeroni and
lstein
as code owners
October 7, 2026 02:09
Decode each encoding group in one buffer with chunked float64 renormalization instead of per row. Drop the migration's own BEGIN; the migrator already runs it in a transaction.
Pfannkuchensack
approved these changes
Oct 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Persist image and video embeddings as little-endian float16 with explicit per-row encoding. Search and projection continue to use float32. A SQLite migration converts existing embeddings without rerunning the embedding model, and legacy float32 rows remain readable.
Related Issues / Discussions
QA Instructions
2.0401e-4. There were no ranking changes among 114,421 candidate pairs with an original score gap above0.002.VACUUMreduced the fixture database from about 698.9 MB to 361.4 MB.Review
No material review findings. A reviewer suggested adding a regression test for replacing existing legacy float32 rows and that can be left as a follow-up if deemed important.
Compatibility / Rollout
The migration runs on first startup after upgrade, in a database transaction, and creates a database backup before conversion. Restore the pre-upgrade backup before running an older application version. SQLite may retain freed pages, so the database file may not shrink immediately.
Checklist
What's Newcopy (if doing a release after this PR)