-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ENH] Evict other versions of hnsw index of the collection when another version is fetched #2707
Conversation
…sion is available
Reviewer ChecklistPlease leverage this checklist to ensure your code review is thorough before approving Testing, Bugs, Errors, Logs, Documentation
System Compatibility
Quality
|
Please tag your PR title with one of: [ENH | BUG | DOC | TST | BLD | PERF | TYP | CLN | CHORE]. See https://docs.trychroma.com/contributing#contributing-code-and-ideas |
This stack of pull requests is managed by Graphite. Learn more about stacking. Join @sanketkedia and the rest of your teammates on Graphite |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is fine until we have version included, and we can be refcount aware / do a deferred eviction.
Is it possible to add some basic documentation in the comments describing this behavior and the motivation?
…er version is fetched (#2707) ## Description of changes *Summarize the changes made by this PR.* It was seen that query nodes OOM in load tests. One area where we could optimize the memory footprint is the HNSW index cache. This PR restricts the cache to keep one entry per collection. Ideally, we would like the index version of this entry to be of the latest but there is no guarantee with this PR. Once the versioning changes land, we could improve this. For e.g. one bad case could be: For the same collection: 1. get index version v1 2. get index version v2 (> v1) 3. get index version v1 (can happen due to an inflight query that started before compaction of v2 occured) -- this will evict v2 even though it is more recent and will be used again in future ## Test plan - [x] Tests pass locally with `pytest` for python, `yarn test` for js, `cargo test` for rust ## Documentation Changes None
Description of changes
Summarize the changes made by this PR.
It was seen that query nodes OOM in load tests. One area where we could optimize the memory footprint is the HNSW index cache. This PR restricts the cache to keep one entry per collection. Ideally, we would like the index version of this entry to be of the latest but there is no guarantee with this PR. Once the versioning changes land, we could improve this. For e.g. one bad case could be:
For the same collection:
Test plan
pytest
for python,yarn test
for js,cargo test
for rustDocumentation Changes
None