Add zvec as a dense ANN backend#1130
Conversation
|
Thanks for the PR. At first glance this looks good with just a couple thoughts. |
|
Thanks, that makes sense. Dropped the extra metadata and config restore since |
|
Thanks for clarifying it requires multiple files. TAR files have had security issues I've had to deal with in the past. Please model this after this class: https://github.com/neuml/txtai/blob/master/src/python/txtai/graph/networkx.py using ArchiveFactory. |
|
Thanks, that makes sense. Switched the zvec save/load to |
|
Thanks, can you sync your fork with the latest? I had to debug a number of recent build errors unrelated to this PR. |
0b7af69 to
b362c65
Compare
Synced the branch with the latest master and reran the ANN tests, optional-dependency test, and lint hooks. Everything passed locally. It should be good now |
|
Please see the build error. It looks like we need to skip copying at least the LOCK file if not more. I can't find a ton on the file format but if there are other files to skip that would be good too. |
|
Excluded both zvec runtime |
|
I'll run the build here but this is starting to get messy. |
|
Can you call collection.close -> save -> then reopen instead of all this additional code to work around lockfiles? The last change just seems messy. |
|
Are you sure you don't need to call self.backend.close vs just setting null? I don't know what platform you're developing on but Windows is just very finicky with locks. |
|
zvec's |
|
Developed this on macOS, so I ran |
|
The Windows job gets through the save with no |
|
Thank you for the hard work on this. I'll merge it in and debug anything further, if anything. |
|
Thanks for merging this. If anything surfaces when you dig in further, let me know and I'll pick it back up. |
Dense embeddings can now use
zvecas an embedded, path-based ANN index. This keeps the first pass dense-only, with sparse indexing and the current default backend unchanged. The shared harness covers save/load, append, missing-ID deletes, and search with positional IDs; I also ran the full dense and sparse ANN suites (31 tests with 3 existing macOS skips), the optional-dependency test, and the changed-file lint hooks. In a seeded local 10,000 × 240 run, zvec matched the exact NumPy top result for all 100 queries. Closes #1040