feat(text): bound vLLM embedding generation - #2317
Conversation
|
Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
Signed-off-by: Praateek <praateekm@gmail.com>
Signed-off-by: Praateek <praateekm@gmail.com>
Signed-off-by: Praateek <praateekm@gmail.com>
74971eb to
b24d3e7
Compare
Signed-off-by: Praateek <praateekm@gmail.com>
…aateekm/nmcur-240-semdedup-bounded-embeddings Signed-off-by: Praateek <praateekm@gmail.com>
Signed-off-by: Praateek <praateekm@gmail.com>
sarahyurick
left a comment
There was a problem hiding this comment.
LGTM, left one minor minor comment.
Signed-off-by: Praateek <praateekm@gmail.com>
…-semdedup-bounded-embeddings Signed-off-by: Praateek <praateekm@gmail.com>
| 0, | ||
| (embedding_matrix.shape[0] + 1) * embedding_matrix.shape[1], | ||
| embedding_matrix.shape[1], | ||
| dtype=np.int64, |
There was a problem hiding this comment.
Does this one matter at all?
There was a problem hiding this comment.
That was a really good catch 🙏
Before since it was pandas, we didn't have the 2bn list-elements limit, since we moved to pyarrow now, we would've had that limit (iow if embedding_dim=1024, our document batch couldn't have had more than 2mn rows; so i then ended up moving it to ChunkedArray)
This issue isn't really an issue for SemDedup since we're anyway constrained that a single file MUST contain less than 2bn/EMBEDDING_DIM number of rows, however I can imagine there might be some embedding use case out there where we do want to support this
Signed-off-by: Praateek <praateekm@gmail.com>
Signed-off-by: Praateek <praateekm@gmail.com>
Description
Main Change - Add
model_inference_batch_sizesupport for vLLM too. Otherwise it generates a gigantic tokenized column for all texts which can result in CPU OOM. Now we only tokenize what we feed into the LLM. The output returned is a pyarrow table (earlier it was a pd.DataFrame with a embedding column which was list[float] i.e. fp64. Now we do fp32.Also related to OOM: we don't now persist text column always
Other changes
create_vllm_llm_with_retryinside setupmetadata_fieldsfor embedding (removed text as the default column that gets preserved)Linear: NMCUR-240
Validation
Benchmark comparison
Compared nightly baseline (
ae713b5e) with the PR run (878cf463). Both entries succeeded and processed the same 5,807,132 documents. Time values are seconds; delta is(PR - nightly) / nightly, so negative time deltas are improvements.time_taken_sthroughput_docs_per_secprocess_time_meantokenization_time_meanvllm_embedding_time_meantime_taken_sthroughput_docs_per_secprocess_time_meantokenization_time_meanvllm_embedding_time_meanOverall end-to-end runtime improved by 6.1% on Ray Data and 3.2% on Xenna, while embedding-stage
process_time_meanimproved by about 4% for both executors. The custom tokenization mean increased, but its overlap with vLLM inference keeps the aggregate stage time lower. This is a single-run comparison on different EOS hosts (eos0288before andeos0183after), so modest differences should be treated as directional.