Repository navigation
embeddings: generate-embeddings-saturate.py, a vLLM server recipe for large runs - #190
Merged
Merged
Conversation
… large runs The script starts a vLLM server on the pinned vllm/vllm-openai:v0.30.0 image and sends it one text per request with saturate. The output has one row per input row and a run can be resumed. On one A10G with 20,000 IMDb reviews, embedding step only, one run each: Qwen3-Embedding-0.6B 187 rows/s against 96 for generate-embeddings.py, and bge-m3 276 rows/s against 71. Texts are cut at the model's own maximum, which the server reports, unless --max-seq-len is set. Prompts follow generate-embeddings.py: --prompt, then the model's registered document prompt, then the known-family table. generate-embeddings-vllm.py stays, and its docstring names this recipe as its successor. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016isSPpNH4MzMcKDBpSwokh
Four 100-row runs: the default model on a10g-small and l4x1, an e5 model with a cut above its maximum, and bge-m3 with --max-seq-len 128. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016isSPpNH4MzMcKDBpSwokh
- A resumed run that processed no rows wrote a card with "dim None" and "0 embedded". The dimension now comes from one request to the server, and the card gives the rows of the last run and the rows written before. - --id-column index and --id-column content were read as saturate id strategies, not as column names. They are now passed as a callable, as in lighton-ocr3-saturate.py. - The card's reproduce command now carries the options that change the result: config, split, id column, sample limit, text cut, prompt, query mode and output column. - The docstring says that a --retry-errors run keeps the old error record, and how to read one record per id. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016isSPpNH4MzMcKDBpSwokh
…s-saturate.py A fresh run and a resumed run of the committed file on the same output. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016isSPpNH4MzMcKDBpSwokh
# Conflicts: # maintenance/STATUS.md # maintenance/verifications.jsonl
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A second embeddings recipe for large text runs.
generate-embeddings.pystays the default.What it does
vllm/vllm-openai:v0.30.0image, and sends it one text per request with saturate.[tool.hf-jobs]header sets the image,a10g-small, a 2h timeout andHF_TOKEN, so the command needs no job flags.id, the text column,embeddings,model,prompt_tokens,error). A run can be resumed by running the same command again.--max-seq-lenis set. A value above the model's maximum is lowered to it.generate-embeddings.pydoes:--prompt, then the model's registered document prompt, then the known-family table.uv-scriptandhf-jobstags.generate-embeddings-vllm.pystays in the folder. Its docstring and the README row now name this recipe as its successor.Measured
One A10G, 20,000 IMDb reviews of up to 300 words, embedding step only, one run each.
generate-embeddings.pyThe server was ready 100 to 120 seconds after it started in those runs, so
generate-embeddings.pyis quicker for a few hundred rows.Checks
100-row smoke Jobs, each with 100 of 100 rows, 0 error rows, unit-length vectors and 100 unique ids:
a10g-small: cut at the model maximum (32768), longest text 1164 tokens.l4x1(an earlier version with a fixed 512-token cut).intfloat/multilingual-e5-smallwith--max-seq-len 100000: lowered to 512, prefixpassage:.BAAI/bge-m3with--max-seq-len 128: longest text 128 tokens. This run used the committed file.Records are in
maintenance/verifications.jsonl.tools/build-catalog.py --verify-modelsandtools/recipe-status.py --checkpass.Review
A Codex review found four issues outside the default path. All are fixed in
16457ba:dim Noneand0 embedded. The dimension now comes from the server, and the card gives the rows of the last run and the rows written earlier.--id-column indexand--id-column contentwere read as saturate id strategies. They are passed as a callable, as inlighton-ocr3-saturate.py.--retry-errorsrun keeps the old error record, and how to read one record per id.Tested after the fix: the committed file run twice on the same output. The fresh run wrote 100 of 100 rows. The resumed run processed 0 rows, left 100 rows with 100 unique ids, and kept a valid card. The
--id-columnfix was not run on a Job.Notes
EngineDeadErrortraceback. It appears after the last row is written, when the server is stopped.maintenance/verifications.jsonland regeneratemaintenance/STATUS.md. The second one to merge needs a merge frommainfirst.Qwen/Qwen3-Embedding-0.6Bis declared on the Run on Jobs Space (30 to 31 models onmain).🤖 Generated with Claude Code
https://claude.ai/code/session_016isSPpNH4MzMcKDBpSwokh