Open slavag opened 11 months ago
I see same thing. duckdb doing a filter for a document was very fast, even a 20GB database would only take 30s first time and <1s each further query.
However, sqlite takes huge amount of time every time. It makes sqlite way useless unless have trivial number of documents.
E.g. for 9GB database, sqlite document query using .get() takes 2 minutes each and every time. duckdb wasn't like this.
One operation that takes a very long time is db.get()
in langchain. Why would sqlite way be so horrible with same code that duckdb was so fast with?
While old duckdb chroma is fast for db.get() by massive amount than new chroma...
Even old chroma with duckdb is very slow if any filter is required. It also leads to excessive memory use when filtering. Getting 1000 similar documents on a 5GB database with 711730 entries takes more than 64GB memory.
I don't know why filtering is so slow and uses so much memory.
Indeed, for duckdb chroma, if I do db.get()
on a 5GB database (takes about 3 seconds) and then filter that entire collection using list comprehension (instant for 700k entries), it's vastly faster than chroma's native filtering that takes 60 seconds and then runs out of memory.
I would think the most efficient way to filter is to filter along the way of doing sim search. i.e. Do normal sim search, and if document doesn't satisfy filter, reject it. This would be no slower than sim search without filter and use no more memory for sure.
So whatever chroma is doing must be much worse.
Can close, h2oGPT found work-arounds.
Work around is good, but I think Chroma should solve such issues.
I have the same problem with a db of about 1GB in size. The latency is about 9 seconds.
What happened?
Hi, I have a test embeddings collection made from Gutenberg library (180 of text files, made by INSTRUCTOR_Transformer, that produced 5.9GB chroma db). When I'm running it on Linux with SSD disk , 24GB GPU NVidia V10, with 8 cores CPU. the response is very slow, take more than 30 seconds to respond. Did kill -s SIGUSR1 on the python process and got :
Please advise if that slow response from chroma is expected or something is not working properly. This also described in that issue (h2ogpt project) : https://github.com/h2oai/h2ogpt/issues/870
I can share the DB with you, as it a quite big need find a place how I can share with you. Thanks
Versions
Chroma 0.4.10. Amazon Linux 2023, Python 3.11.5
Relevant log output
No response