recipe(bert): add dell-research-harvard/lt-un-data-fine-fine-es (feature-extraction, sentence-similarity)#1185
Open
DingmaomaoBJTU wants to merge 1 commit into
Open
Conversation
…ure-extraction, sentence-similarity) Curated CPU float recipes (fp32 + fp16) for the Spanish BETO sentence embedder lt-un-data-fine-fine-es (model_type=bert, BertModel, hidden 768, vocab 31002). Ships feature-extraction and sentence-similarity under cpu/cpu/ (quant:null; no CPU quantized variant per repo convention). The default build emits w8a16; these float recipes supply the CPU fp32/fp16 convention. L2 PyTorch-vs-ONNX parity: sentence-embedding cosine 1.000000, retrieval ranking identical. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Collaborator
Author
|
APPROVE (independent reviewer; comment-only approval because same GitHub identity cannot use Coverage: full for the declared CPU target ( Evidence summary:
Concerns: no blocking concerns. Only non-blocking wording note: item 10's "coverage partial" is confusing because the declared target EPs are |
DingmaomaoBJTU
marked this pull request as ready for review
July 23, 2026 12:27
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.
Summary
Adds curated CPU float recipes for
dell-research-harvard/lt-un-data-fine-fine-es— a SpanishBertModelsentence embedder (BETO-based, fromhiiamsid/sentence_similarity_spanish_es) used for record-linkage / semantic similarity (configmodel_type = bert,architectures = [BertModel], hidden 768, vocab 31002,type_vocab_size = 2→ hastoken_type_ids,pad_token_id = 1). Ships fp32 + fp16 for both feature-extraction and sentence-similarity undercpu/cpu/(allquant: null; no CPU quantized variant per repo convention).This is a catalog-style CPU float recipe, stated honestly: the default
winml build(no recipe) builds successfully for this model and emits a w8a16 quantized artifact. The contribution's value is supplying the CPU float convention —fp32 + fp16undercpu/cpu/(consistent with #1084 / #1112 / #1170 / #1182) instead of the default w8a16 — plus an L2 numeric + retrieval-ranking parity proof that the trained embedding head is preserved end-to-end. Claimed tiers: Effort L0 · Goal ceiling L2 · Outcome L0.1. Recipe path(s)
examples/recipes/dell-research-harvard_lt-un-data-fine-fine-es/cpu/cpu/feature-extraction_fp32_config.jsonexamples/recipes/dell-research-harvard_lt-un-data-fine-fine-es/cpu/cpu/feature-extraction_fp16_config.jsonexamples/recipes/dell-research-harvard_lt-un-data-fine-fine-es/cpu/cpu/sentence-similarity_fp32_config.jsonexamples/recipes/dell-research-harvard_lt-un-data-fine-fine-es/cpu/cpu/sentence-similarity_fp16_config.jsonPer task, fp32 and fp16 are byte-identical (git blob OID
659160eb…for feature-extraction,6c1a3127…for sentence-similarity;quant: nullfloat bucket — on CPU both realize as fp32, fp16 materializes on GPU/NPU). opset 17, batch 1, inputsinput_ids[1,512](range 0..31002) +attention_mask[1,512]+token_type_ids[1,512](all int32), outputlast_hidden_state[1,512,768].2. README row
None. Recipe-only, CPU-only — deliberately not added to the "passes fp16 eval on all 10 (EP, device) buckets" table, which would overclaim for a CPU-only recipe (consistent with #1084 / #1112 / #1170 / #1182).
3. Build output dir
temp/ltun_fe/(feature-extraction) andtemp/ltun_ss/(sentence-similarity) — scratch, gitignored.model.onnx+model.onnx.data(416.9 MB float).4. Build log
✅ Build complete in 100.0s(Export 52.4 + Optimize 46.7; no quantize —quant: null).✅ Build complete in 92.3s(Export 47.1 + Optimize 44.4; same graph, outputlast_hidden_state[1,512,768]).5. Appended findings
model_knowledge/bert.json→bert-002(baseline quantize SUCCEEDS here → recipe supplies CPU float convention; refines/falsifies the over-broad reading ofbert-001— the e5 quantize crash is tokenizer-dependent). Lane A (skill repo); not part of this model PR's diff.6. Optimum-coverage probe
bertfeature-extractionis VENDOR-ONLY (added_by_winml = []; vendor onnx tasks[feature-extraction, fill-mask, multiple-choice, question-answering, text-classification, token-classification]).sentence-similarityis not a distinct Optimum onnx task — winml's task layer maps it onto the sameAutoModelbackbone export (the SS recipe builds the identical graph, confirmed). No winml-added exporter exists or is needed.7. Claimed (Effort, Goal, Outcome)
L0 / L2 / L0. Baseline gate:
winml build -m dell-research-harvard/lt-un-data-fine-fine-es(no-c) onmain(origin/main = d9feefff, winml 0.2.0) — builds successfully: Export ✅ (35.3s, 416.9 MB) + Optimize ✅ (23.3s) + Quantize ✅ (45.6s) →model.onnx(127.8 MB, w8a16 uint8/uint16), Build complete 121.5s. The recipe does not fix a crash; it supplies thequant: nullfp32 + fp16 float CPU variants per repo convention (the default w8a16 is not what we ship for CPU). Baseline HEAD == currentorigin/main(git rev-list --count HEAD..origin/main= 0).8. Goal-ladder verdict table
input_ids/attention_mask/token_type_ids[1,512]int32, outputlast_hidden_state[1,512,768], external data co-locatedlast_hidden_statemax-abs 5.860e-04; mean-pooled+L2-normalized sentence-embedding cosine 1.000000 (min = mean); retrieval ranking identical (PyTorch == ONNX) and semantically correct (paraphrase pair + QA pair rank top)Ceiling L2 reached; no downgrade.
9. Methodology-evolution declaration
Charter re-tiered L0★ → L0 during testing (recorded, not silent). The planner initially assumed the e5-style baseline-quantize crash would recur; the Step 1b baseline gate proved it does not for a WordPiece-
BertTokenizermodel (baseline quantizes to w8a16 fine). Per the anti-drift rule this bounced back to the planner for a re-issued charter (L0, catalog-style float recipe). No SKILL.md / agents/*.md edits; the refinement lives inbert-002model knowledge.10. Perf & eval data
winml evalnot run (Goal ceiling L2). Target EPs =[cpu]; coverage partial (GPU/NPU host-unreachable here).11. Component / op-level data
winml analyze: 384 total operators, 15 unique types, all supported on the analyzed EP (384/0/0/0, "Ready to deploy").12. Reproducible commands