recipe(deberta-v2): add mxbai rerank xsmall recipes and fp16 exclusions - #1355
Draft
ssss141414 wants to merge 13 commits into
Draft
ssss141414 wants to merge 13 commits into
ssss141414 wants to merge 13 commits into
Conversation
|
|
||
|
|
||
| if TYPE_CHECKING: | ||
| import torch |
Contributor
Author
|
REJECT Reviewed PR: #1355 Accepted checks
Structural failures
Reviewer execution limitation
|
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
This PR adds CPU fp32 and fp16 reranking recipes for mixedbread-ai/mxbai-rerank-xsmall-v1 and the shared opt-in exact-name FP16 exclusion plumbing needed to express the verified xsmall boundary list. The model is a DeBERTa-v2 cross-encoder reranker that scores each query-document pair with a single relevance logit, so checked-in support matters for reproducible search reranking coverage rather than one-off recipe-free builds. The shipped scope is Effort L1 / Outcome L1, and the tester reached the committed Goal ceiling with L3 PASS on full required coverage. Static rule analysis finished with ANALYZE-PARTIAL-SUCCESS semantics: the summarized compatibility analysis is preserved even though winml analyze exited 1.
Model metadata
What the model does
An English text cross-encoder reranker that accepts a query paired with each candidate document, emits one relevance logit per pair, and orders candidates by descending score for search reranking.
Evidence: pinned model card lines 26-28, 42-63, and 83-111; pinned config and WinML inspect resolve DebertaV2ForSequenceClassification with one output logit and task reranking.
Confidence: verified.
Primary user stories
Evidence: pinned model card lines 42-63 and 83-111.
Confidence: verified.
Supported tasks
Model architecture
verified).Validation and support evidence
Baseline
Pinned current
maincommit:e28b128f5c2f69ecb2d73b63d2aea0a5ee8bddd0.Authorized dependency evidence commit used for the fresh baseline:
3708969b731425b0c6d4b97920d1b5e6519bb013.WinML version:
0.3.0.The planner recorded
KEEP-AUTHORIZED-DEPENDENCY-BASEbecause currentmaindiverges from the dependency branch that carries the canonical reranking evaluator, ranking metric, task resolution, scalar-logit inference, and pinned dataset path needed for this support surface. Fresh baseline evidence therefore ran on the authorized dependency commit while currentmainwas separately fetched and recorded.Baseline recipe-free support on CPU was already present: build
PASSin 22.17s, 70.8M parameters exported, ONNX checkerPASS, strict inferencePASS, and CPU session loadPASS.Baseline perf floor on CPU fp32: mean
186.52 ms, p50186.218 ms, throughput5.36 samples/s, RSS total delta+164.83 MB.Baseline functional smoke Eval floor: one pinned
mteb/scidocs-rerankingtest row with 10 pairs producedMRR@10=1.0,Recall@1=1.0, andRecall@10=1.0; this remained functional-smoke evidence only.Starting auto-config behavior: the generated reranking config resolved
task=reranking,model_class=DebertaV2ForSequenceClassification,model_type=deberta-v2, eager transformers attention compatibility, and no quant block in the starting recipe.Optimum probe: vendor-supported tasks were
feature-extraction,fill-mask,multiple-choice,question-answering,text-classification, andtoken-classification; WinML added no extra Optimum task alias, so the planner recordedVENDOR-ONLY.Goal
Committed tiers: Effort
L1, Goal ceilingL3, OutcomeL1.Goal success definition preserved from the charter and tester contract:
L0: both checked-in CPU recipes build override-free using only recipe identity/location arguments and pass checker, strict inference, external-data colocation, shapes, dtypes, and CPU load.L1: both exact tuples (cpu/cpu/fp32andcpu/cpu/fp16) produce bounded CPU perf with latency, throughput, and memory.L2: PyTorch vs ONNX on at least two real query-document pairs with cosine and max-abs checks plus identical descending rank and top-result identity.L3: one final-candidate fp32 CPU functional smoke reranking Eval with bounded fan-out and explicit metric accounting.No ceiling change or re-issued charter event occurred after the planner freeze.
Outcome
Tester outcome: shipped tier
L3; highest Goal verdictL3 PASS; coveragefull; deferred tuples[].Shipped recipe paths:
examples/recipes/mixedbread-ai_mxbai-rerank-xsmall-v1/cpu/cpu/reranking_fp32_config.jsonexamples/recipes/mixedbread-ai_mxbai-rerank-xsmall-v1/cpu/cpu/reranking_fp16_config.jsonShipped code paths:
src/winml/modelkit/quant/config.pysrc/winml/modelkit/quant/fp16.pysrc/winml/modelkit/quant/passes/fp16.pyLearner append:
deberta-010was added to the DeBERTa family knowledge file. No methodology_meta-*finding was emitted and no Lane A skill PR is required for this contribution.Knowledge carried forward into the contribution record:
deberta-003: reranking resolves a two-input DeBERTa-v2 export; revalidated independently for xsmall.deberta-005: exact FP16-to-FLOAT boundaries may require opt-in exact-name preservation; xsmall independently produced 74 such boundaries.deberta-007: reranker L2 must verify numeric similarity and induced ranking order.deberta-009: one-query bounded MRR/Recall smoke is operability evidence, not representative benchmark accuracy.Per-EP/device/precision results and Functional smoke Eval
Goal ladder:
L0 PASS,L1 PASS,L2 PASS,L3 PASS.Structural
L0evidence:cpu/cpu/fp32: checkerPASS, strict shape/type inferencePASS, CPU ORT loadPASS, 852 nodes, float16 output logits, and no frozen boundary exclusions required.cpu/cpu/fp16: checkerPASS, strict shape/type inferencePASS, CPU ORT loadPASS, 926 nodes, float16 output logits, and all 74 exact FLOAT16-to-FLOAT boundary Casts remained present exactly once each with no broad Cast block.L2numeric parity on two real query-document pairs:1.0000000000000002, max abs0.0, mean abs0.0, PyTorch order[0, 1], ONNX order[0, 1], ranking agreementtrue.1.0000000000000002, max abs0.0, mean abs0.0, PyTorch order[0, 1], ONNX order[0, 1], ranking agreementtrue.Functional smoke Eval: final candidate
335755c9cb9682ee768d632909b9df341e028900, fp32 CPU only, datasettester-owned deterministic MS MARCO-style query/document group, splitsynthetic-bounded-functional-smoke, selected and processed query groups1, processed query-document pairs2, metricMRR@2=1.0, relevant document rank1. Verified semantics: the evaluator consumesquery,positive, andnegativetext fields; the target is binary candidate relevance within the query group; the checkpoint emits one scalar relevance logit per pair and higher logits rank earlier. Fan-out caps remained explicit: candidate labels/prompts10, beams1, sequence length512, query groups1, and query-document pairs cap10. This is end-to-end operability evidence only and is not representative accuracy or benchmark quality.Delta
Baseline recipe reference:
baseline/reranking_config.json.Recipe comparison verdict:
CHANGED.Recipe diff relative to the baseline auto-config:
examples/recipes/mixedbread-ai_mxbai-rerank-xsmall-v1/cpu/cpu/reranking_fp32_config.json: structurally identical to the sealed baseline reranking config, now checked in as the exact shipped CPU fp32 recipe.examples/recipes/mixedbread-ai_mxbai-rerank-xsmall-v1/cpu/cpu/reranking_fp16_config.json: JSON pointer/quantchanged fromnullto the standard fp16 quant block withfp16_nodes_to_exclude[74]populated from the independently sealed xsmall boundary list.Code-path delta:
src/winml/modelkit/quant/config.py(WinMLQuantizationConfig,to_dict,from_dict): adds optional validated exact-name FP16 exclusion storage with declaration-order de-duplication and cache-sensitive serialization.src/winml/modelkit/quant/fp16.py(convert_to_fp16): forwards the optional exact-name list to both normal and disable-shape-inference ORT conversion paths.src/winml/modelkit/quant/passes/fp16.py(FP16Pass.run): forwards recipe config asnode_block_listwithout model identity or graph heuristics.Reducibility consistency with charter:
true.Recipe-free acceptance for the source checkpoint remained
PASS, proving the code fix does not make the support path recipe-dependent when quantization is not requested.Production recipe README status: untouched.
Bug fix explanation
(a) User-visible symptom and minimal trigger: the xsmall fp16 reranking recipe needed 74 exact FLOAT16-to-FLOAT boundary Casts to stay in FLOAT, but the authorized base had no way to express exact node-name exclusions, so the intended fp16 recipe could not be represented as a precise checked-in configuration.
(b) Root cause and prior behavior: WinML’s fp16 config/pass/converter path could forward only keep-IO and op-type block settings. That meant recipe authors either had no exact-name control or would need an over-broad Cast-style exclusion, which the charter explicitly prohibited.
(c) Changed symbols and fix mechanism:
WinMLQuantizationConfignow validates and serializesfp16_nodes_to_exclude;FP16Pass.runforwards that list asnode_block_list;convert_to_fp16passes the same list through both ORT conversion paths so exact named nodes remain FLOAT while neighboring unnamed nodes still follow ordinary fp16 conversion.(d) Why the rule is general and data-driven: the new capability is a generic optional exact ONNX node-name list. The shipped source never hard-codes this checkpoint, model ID, model type, prefixes, substrings, wildcards, or runtime graph heuristics; the 74-value list lives only in the recipe.
(e) Compatibility and blast radius: absent or null config preserves prior behavior; non-fp16 paths ignore the field; exact names are declaration-order de-duplicated; unknown names have no heuristic effect; the only intentional behavioral change is opt-in exact-name exclusion when a recipe explicitly asks for it.
(f) Regression evidence: producer compatibility evidence recorded 425 config/pass tests
PASS, 144 converter testsPASS, 5 recipe testsPASSincluding BERT-family and non-text no-field controls, Ruff format/lintPASS, focused mypyPASS, producer structural validation19/19 PASS, candidate-source recipe-free acceptancePASS, and the tester independently reachedL0throughL3PASSon both required tuples.Analyze summary — component level and op level
Static rule analysis completed with
ANALYZE-PARTIAL-SUCCESS; this is compatibility analysis, not runtime execution. The summarized analysis artifact remained valid even thoughwinml analyzeexited1after a provider-bridge warning.Component-level summary
Mapping gap preserved from tester analysis: no xsmall ONNX artifact existed when the frozen model profile was created.
Op-level summary
GatherElementsandErf, withCastremaining unknown; NvTensorRTRTX and OpenVINO support the enumerated operator set, withCastremaining unknown; CUDA, DML, MIGraphX, and Tensorrt have no rule data in this analysis snapshotRule-less EPs preserved from tester output:
CUDAExecutionProvider,DmlExecutionProvider,MIGraphXExecutionProvider, andTensorrtExecutionProviderhave no rule data in this snapshot.Reproduce commands