Skip to content
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

[Bug]: Can't set max batch size #2403

Closed
superchargez opened this issue Jun 22, 2024 · 4 comments
Closed

[Bug]: Can't set max batch size #2403

superchargez opened this issue Jun 22, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@superchargez
Copy link

What happened?

I tried adding large number of documents but hit the limit of 5461, so I tried to change the limit but nothing happened:

In [16]: client.max_batch_size = 44445

In [17]: client.get_max_batch_size()
Out[17]: 5461

Versions

Window 11
Python 3.12.4
Chroma version: '0.5.3'

Relevant log output

No output: just did not update the batch size limit.
@superchargez superchargez added the bug Something isn't working label Jun 22, 2024
@tazarov
Copy link
Contributor

tazarov commented Jun 23, 2024

@superchargez, the max batch size in Chroma is a function of underlying SQLite. Most OS comes with a built-in release of sqlite3 (most of the time Chroma relies on those). The pre-build SQLite distros have been compiled with certain limits on which the max match size is based, and unfortunately, they cannot be changed.

Exposing the max batch size is intended to make users aware of the SQLite limits Chroma enforces. The general approach in cases like yours is to split up your large batch. We have provided an example of how to do that here - https://github.com/chroma-core/chroma/blob/main/chromadb/utils/batch_utils.py

@tazarov
Copy link
Contributor

tazarov commented Jul 22, 2024

@superchargez, did the above answer your question?

It is also worth noting that recently, we moved the max_batch_size property to a method get_max_batch_size() method (#2305) to better convey that this property cannot be set.

@superchargez
Copy link
Author

@tazarov yes, thank you it answers the question.

@jeffchuber
Copy link
Contributor

Closing this as it is resolved. Let me know if you'd like to re-open

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants