Closed raam86 closed 7 months ago
To avoid any confusion in the future about your contribution to Weaviate, we work with a Contributor License Agreement. If you agree, you can simply add a comment to this PR that you agree with the CLA so that we can merge.
beep boop - the SeMI bot 👋🤖
@raam86 The performance promises of this sound great. Anything stopping this from moving forward? It looks like this needs CLA acceptance from you. But, maybe something else is blocking this?
Looping in @antas-marcin who might have more context (mostly because this is an older PR)
Would be great if the t2v performance could be improved, as I am getting a lot of timeouts when importing and searching at the same time. So is it possible to merge this PR?
Did not look into it this ins great detail but came across a related issue.
Afaik sentence-transformers vecetorizes each text in a list as a whole. This PR calls encode
with just one string, which sentence-transformers will then just put into a list.
From my understanding it will then encode this as a whole. If the input is too long, it will not be split into batches or anything but truncate the input (see e.g. https://github.com/UKPLab/sentence-transformers/issues/181#issuecomment-614693712).
Could it be that the gain of speed would come (at least partly) from the fact that the way this is currently implemented would just encode parts of the text?
The SentenceTransformer vectorizer is already a part of transformers project. Closing this PR.
This PR suggests a move to a higher level library (sentence transformers) the behaviour stays the same while increasing performance by about an order of a magnitude.
This is probably due to the promise of this library to be highly optimized for such workloads, they also claim to use and distribute to all gpus automatically but I haven't tested that yet.
I also added support for batching in the form of an input array (instead of a single string) this should help with decoupling the transformation work for large workloads if needed.