recipe(deberta): add mixedbread-ai/mxbai-rerank-base-v1 (text-classification, reranker)#1118
Conversation
|
REQUEST_CHANGES coverage: partial Independent evidence gathered:
Blocking issues to fix before approval:
|
…ication, reranker) Curated CPU float recipe for the mxbai-rerank-base-v1 cross-encoder reranker (config model_type deberta-v2, DebertaV2ForSequenceClassification, num_labels=1 -> single relevance logit). Ships fp32 + fp16 under cpu/cpu/ (both quant:null; no CPU quantized variant per repo convention). Recipe-only: Optimum covers deberta-v2 text-classification natively, so zero source changes. Inputs are input_ids + attention_mask only (deberta-v2 has type_vocab_size=0, no token_type_ids). The recipe is byte-identical to cross-encoder/nli-deberta-v3-base's (model_id is CLI-passed; output width is config-driven), confirming one deberta-v2 text-classification recipe serves the task family. Validated on CPU: - L0 build: recipe-driven winml build exit 0 (633.6s, no quantize); ONNX opset 17, output logits[1,1] (trained reranker head preserved); 786 MB fp32. - L1 perf: CPU/fp32 avg 7027.85 ms, 0.14 samples/s, RAM +624.7 MB (perf also auto-ran on QNN/NPU at 523.99 ms / 1.91 samples/s). - L2 numeric parity vs PyTorch on real (query, document) reranking pairs: cosine 1.000000, max-abs 1.097e-5, ranking order 4/4 identical, top-1 doc agrees. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
c89349c to
b34869c
Compare
|
Producer — REQUEST_CHANGES addressed (head
Verify: Tester numbers are unchanged by the rebase (recipe bytes identical): L0 float build exit 0; L2 cos 1.000000 / max-abs 1.097e-05 / ranking 4/4; CPU/fp32 perf 7027.85 ms. Re-requesting review. |
APPROVE — reviewer re-review cycle 2coverage: partial Applicable checklist evidence
Resolution of previous REQUEST_CHANGES
No residual concerns. |
Summary
Adds a curated CPU float recipe for
mixedbread-ai/mxbai-rerank-base-v1— a cross-encoder reranker that scores(query, document)relevance (configmodel_type = deberta-v2,DebertaV2ForSequenceClassification,num_labels = 1→ a single relevance logit). Ships fp32 + fp16 variants undercpu/cpu/(bothquant: null; no CPU quantized variant per repo convention).This is a recipe-only (L0★) contribution: Optimum already covers
deberta-v2text-classificationnatively, somainbuilds this model with zero source changes. The delta is the curated CPU reference recipe plus an L2 numeric + ranking parity proof that the trained reranker head is preserved end-to-end. Notably the recipe is byte-identical to the now-mergedcross-encoder/nli-deberta-v3-baserecipe (#1117, onmainate95011d3) — identical git blob OID7b36e69520b418c7c86b2d8a39eab741cb9742c5(git-stored SHA2568b587c4b…bec8; verify withgit rev-parse HEAD:<path>). Themodel_idis CLI-passed and the output width is config-driven, so onedeberta-v2text-classification recipe serves the whole task family. Claimed tiers: Effort L0★ · Goal ceiling L2 · Outcome L0.1. Recipe path(s)
examples/recipes/mixedbread-ai_mxbai-rerank-base-v1/cpu/cpu/text-classification_fp32_config.jsonexamples/recipes/mixedbread-ai_mxbai-rerank-base-v1/cpu/cpu/text-classification_fp16_config.jsonByte-identical (
quant: nullfloat bucket; on CPU both realize as fp32, fp16 materializes on GPU/NPU). opset 17, batch 1, inputsinput_ids[1,512]+attention_mask[1,512](int32), outputlogits[1,1]. Notoken_type_ids—deberta-v2hastype_vocab_size = 0.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 be a factual overclaim for a CPU-only recipe (consistent with #1084 / #1112 / #1117).
3. Build output dir
temp/mxbai_rerank/(scratch, gitignored) —model.onnx+model.onnx.data(786 MB fp32).4. Build log
✅ Build complete in 633.6s(Export 369.6s + Optimize 256.9s; no quantize —quant: null). ONNX IR 8, opset 17, external data co-located, outputlogits[1,1].5. Appended findings
model_knowledge/deberta.json→deberta-002(second model in thedebertafamily;mxbai-rerank-base-v1added tomodels_tested). Lane A (skill repo); not part of this model PR's diff.6. Optimum-coverage probe
deberta-v2text-classificationis VENDOR-ONLY (added_by_winml = []). Vendor onnx tasks:[feature-extraction, fill-mask, multiple-choice, question-answering, text-classification, token-classification]. No winml-added exporter exists or is needed.7. Claimed (Effort, Goal, Outcome)
L0★ / L2 / L0. Baseline:
winml build -m mixedbread-ai/mxbai-rerank-base-v1onmain(origin/main = e95011d3— branch rebased onto current main; winml 0.2.0) already PASSES (default pipeline 973.3s incl. quantize → uint8/16 327.5 MB). Contribution = curated CPU float recipe (fp32 + fp16) + L2 relevance-head-preservation proof.8. Goal-ladder verdict table
input_ids[1,512]+attention_mask[1,512], outputlogits[1,1], external data co-located(query, doc)pairs: cosine 1.000000, max-abs 1.097e-05, ranking order 4/4 identical, top-1 doc agreesCeiling L2 reached; no downgrade.
9. Methodology-evolution declaration
No methodology friction. This is the second model in the
debertafamily (added in #1117) — it exercised the self-learning path as designed:deberta-001predicted the recipe shape, the recipe came out byte-identical (same git blob OID7b36e695…), anddeberta-002records the reranker-specific ranking-parity check. No skill_meta change needed.10. Perf & eval data
winml evalnot run (Goal ceiling L2). The NPU row is a bonus data point fromwinml perfauto-selecting QNN — it is not a claimed coverage bucket (no NPU-side L2 parity yet), so coverage stays CPU-only/partial.11. Component / op-level data
winml analyze --ep all: 568 total operators, 17 unique (identical op profile to the NLI sibling). Per-EP: QNN NPU 17/17 supported, OpenVINO NPU 17/17 supported (includes the disentangled-attentionGatherElementsops); VitisAI all-unknown (no rule data — analyze exit 1, expected, not a functional failure). Artifact:temp/mxbai_rerank/analyze_all.json.12. Reproducible commands