Embedding coverage Phase 1: BGE (CLS pooling, retrieval prefixes)#229
Merged
Conversation
…ger-buffer-safe loads
Phase 1 of docs/specs/embedding-model-coverage.md (E5BGE-0..3):
- BertPooling { MEAN, CLS } on BertEncoderRuntime/createBertEncoderRuntime;
detected from sentence-transformers 1_Pooling/config.json (absent -> MEAN,
max/sqrt-len rejected loudly). Pooling stays outside the traced graph.
- EmbeddingModel SPI gains embedQuery/embedDocument/embedDocuments
(defaults delegate to embed — additive). PrefixedEmbeddingModel +
EmbeddingModelProfiles apply per-repo retrieval prefixes (E5
query:/passage:, BGE query instruction); fromHuggingFace wires them
automatically, fromSafeTensors takes explicit prefixes.
- FloatSafeTensorsLoader: BGE checkpoints persist an I64
embeddings.position_ids buffer the engine loader cannot skip
(SKaiNET-developers/SKaiNET#822); interim float-only loader over the
public StreamingSafeTensorsReader, dropped when the engine gains a
tensor filter.
- Tests: CLS pooling (row-0 semantics, differs from MEAN, mask-independent),
1_Pooling parser shapes, prefix decorator + profile registry. BCV dumps
regenerated; full build + apiCheck green.
- E2E: kbert-cli BAAI/bge-small-en-v1.5 -> 384 dims, sensible similarity.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
michalharakal
added a commit
that referenced
this pull request
Jul 17, 2026
Patch on 0.36.0, shipping against the same SKaiNET engine 0.36.0. Versioned 0.36.1 rather than 0.37.0 to keep the documented lock-step rule (a transformers X.Y.Z ships against engine X.Y.Z) intact; there is no engine 0.37.0 to ship against. Covers everything on develop since 0.36.0: the BGE embedding support from #229 (CLS pooling, retrieval prefixes, integer-buffer-safe loads) and the vec2text / T5 beam search from #228. - bump VERSION_NAME to 0.36.1; CHANGELOG: cut 0.36.1 from Unreleased, folding in the BGE entry that was sitting there alongside the new beam-search notes - README: 0.36.1 current-release notes (BGE + beam search), 0.36.0 demoted to "builds on", BOM snippet bump, BERT and T5/GTR architecture rows refreshed - docs: dsl-vs-handcoded T5 row notes greedy + beam decode Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
michalharakal
added a commit
that referenced
this pull request
Jul 17, 2026
Patch on 0.36.0, shipping against the same SKaiNET engine 0.36.0. Versioned 0.36.1 rather than 0.37.0 to keep the documented lock-step rule (a transformers X.Y.Z ships against engine X.Y.Z) intact; there is no engine 0.37.0 to ship against. Covers everything on develop since 0.36.0: the BGE embedding support from #229 (CLS pooling, retrieval prefixes, integer-buffer-safe loads) and the vec2text / T5 beam search from #228. - bump VERSION_NAME to 0.36.1; CHANGELOG: cut 0.36.1 from Unreleased, folding in the BGE entry that was sitting there alongside the new beam-search notes - README: 0.36.1 current-release notes (BGE + beam search), 0.36.0 demoted to "builds on", BOM snippet bump, BERT and T5/GTR architecture rows refreshed - docs: embedding-model-coverage plan retargeted 0.37.0 -> 0.36.1 (that release number is retired; Phase 2 rows now say "next release" rather than naming a version the engine line hasn't reached); dsl-vs-handcoded T5 row notes greedy + beam decode Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Merged
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.
Implements Phase 1 (E5BGE-0..3, checkpoints CP-1/CP-2) of the new
docs/specs/embedding-model-coverage.md—BAAI/bge-small-en-v1.5runs end-to-end on the BERT DSL path, laying the model matrix for the upcoming embedding performance benchmarks.BertPooling { MEAN, CLS }— detected from1_Pooling/config.json, default MEAN (behavior-compatible); pooling stays outside the traced graph, so OPTIMIZED/StableHLO are untouched.embedQuery/embedDocument/embedDocumentson theEmbeddingModelSPI;PrefixedEmbeddingModel+EmbeddingModelProfiles(E5query:/passage:, BGE query instruction), auto-applied byfromHuggingFace.FloatSafeTensorsLoader— BGE checkpoints persist an I64embeddings.position_idsbuffer the engine loader can't skip; interim float-only loader, dropped when SafeTensorsParametersLoader: add a tensor-name filter (integer buffers fail float loads) SKaiNET#822 lands (CP-2 gate outcome: no engine release on the 0.37.0 critical path).Tests: CLS semantics (row-0, ≠ MEAN, mask-independent), pooling-config parser, prefix decorator/profiles. BCV dumps regenerated; full build + apiCheck green. E2E:
kbert-cli BAAI/bge-small-en-v1.5→ 384 dims, cosine 0.80 on a relevant pair.Follow-up (Phase 2, 0.38.0): Unigram tokenizer for
intfloat/multilingual-e5-small— placement decision at CP-3 per the spec.🤖 Generated with Claude Code