Add WinML reranking recipes for cross-encoder/ms-marco-MiniLM-L4-v2 - #1348
Conversation
Independent reviewer verdict: REQUEST_CHANGESReviewed immutable PR head Actionable blockers
Verified evidence
No structural fabrication or scope leakage was found, so this is |
|
Explainer disposition for REQUEST_CHANGES comment #5391732432:
No candidate or branch files were changed. There were no line threads to resolve; this is an ordinary conversation reply and does not impersonate Reviewer. |
Independent reviewer verdict: APPROVEReviewed immutable PR head Prior-gap closure
Complete review result
No blockers remain. This |
Summary
Adds two CPU reranking recipes for
cross-encoder/ms-marco-MiniLM-L4-v2, a compact English passage cross-encoder. This is an L0 recipe-only contribution with full fp32 and true-fp16 CPU coverage. The committed Goal ceiling was L3, and the fresh immutable recovery run reached L3 PASS without any candidate change.Model metadata
What the model does
An English cross-encoder passage reranker that jointly encodes one query-document pair and emits one raw scalar relevance logit; candidates are ordered by decreasing score without softmax, sigmoid, or instruction prefixes. Confidence: verified.
Evidence: the model card and
config.jsonat pinned checkpoint revision777b2f369bc1c2f850df8bd367ed1654bda4497bdescribe MS MARCO passage reranking, decreasing-score sorting,BertForSequenceClassification, oneLABEL_0output, and Identity activation. Current-main export resolves logits from the sequence-classification head.Primary user stories
Supported tasks
checkpoint,transformers): the published pipeline tag istext-ranking, with pinned pair-scoring examples;AutoModelForSequenceClassificationis the published Transformers class. Confidence: verified.transformers,optimum-onnx,winml): current-main inspect and recipe-free build resolve throughBertIOConfigandAutoModelForSequenceClassification; the pinned checkpoint exports successfully at opset 17. Confidence: verified.Model architecture
BertForSequenceClassification, corroborated by current-main hierarchy metadata for 19,164,673 parameters, 87 modules, 33 traced modules, 66 execution steps, fourBertLayerchildren, and 215/215 tagged ONNX nodes (verified).Validation and support evidence
1. Baseline
The fresh baseline used current
maincommit774dd6e0811f6947eaf2bd8fb721d5f6e718b0c0and WinML0.0.1.dev0. Planner classified the move from0876e5ae1c98a169a6137e092e0d7b30bf9cee33as FULL-RERUN, not a SHA-only attestation: the intervening changes directly affect shared Perf EP/device selection and monitoring, session exports, Analyze missing-schema behavior, CLI constants, and their quality gates. Planner therefore reran inspect, default and reranking config, build, perf, Eval, and Analyze fail-closed on currentmain; only the unchanged model profile and dependency-alias evidence were reused.Recipe-free
BertForSequenceClassification/text-classificationbuild passed at IR 8/opset 17 in 11.0 s, producing a 76,714,266-byte model with threeint32 [1,512]inputs,float [1,1]logits, and FLOAT initializers. The CLI still emitted an Optimize stage despite--no-optimize. Baseline CPU perf over 10 measured iterations after 2 warmups was 37.30 ms mean, 37.94 ms p50, 43.70 ms p95, 26.81 samples/s, and +79.2 MB inference RAM. Baseline reranking Eval remained at the unsupported floor: it exited 1 and emitted no metric. Default config resolvedtext-classification; explicit reranking config exited 2 as unsupported. Baseline Analyze returned the expected partial-success contract with exit 1 and retained JSON containing 152 operators, 17 operator types, and 12 provider rows; this is static compatibility evidence, not a command crash or non-CPU runtime proof.Optimum probing was VENDOR-ONLY: the exact L4 import probe failed because installed Optimum imports a removed Transformers 5.14.1 private symbol. The accepted exact-runtime BERT probe exposed the same six vendor and post-WinML tasks (
feature-extraction,fill-mask,multiple-choice,question-answering,text-classification,token-classification) withadded_by_winml=[]; fresh L4 inspect/build independently verified the same model class and exporter path.This PR is intentionally stacked on draft dependency PR #1322, branch
producer/ms-marco-minilm-l6-v2-reranking, at3708969b731425b0c6d4b97920d1b5e6519bb013. On that dependency,text-rankingandrerankingconfig both exit 0, normalize toloader.task=reranking, and are parsed-JSON identical. Currentmain(774dd6e0811f6947eaf2bd8fb721d5f6e718b0c0) and the dependency head are divergent: currentmainis used only for the refreshed baseline, while candidated951fccaba37275540cdf2757bfb6b3cf60e8ec8has the dependency SHA as its exact sole parent. The candidate therefore does not incorporate current-main commits; it contributes exactly two recipe files on top of #1322 and depends on #1322's generic reranking normalization and Eval support.2. Goal
No ceiling change or re-issued charter occurred.
3. Outcome
The shipped tier is L0, the highest reached Goal verdict is L3 PASS, coverage is full, and there are no deferred tuples. The contribution contains only:
examples/recipes/cross-encoder_ms-marco-MiniLM-L4-v2/cpu/cpu/reranking_fp32_config.jsonexamples/recipes/cross-encoder_ms-marco-MiniLM-L4-v2/cpu/cpu/reranking_fp16_config.jsonQuality gates passed: license-header check; Ruff; mypy over 444 source files; 1,526 analyze tests; 1,534 model/loader/dataset/export tests; 848 optimization tests; 3,641 command/config/build/compiler/session/eval tests; and 892 remaining unit/regression/CLI tests, with only the recorded skips, xfails, deselection, and warnings.
Learner v3 preserves model findings
bert-024throughbert-029, which capture exact L4 build structure, HTP hierarchy, component/op analysis, CPU performance, raw-logit parity, and the bounded SciDocs smoke. It refreshesbert-024andbert-027from the Planner v2 baseline and Tester v2 fp16 evidence. Methodology friction_meta-114records that precision-size validation must compare realized model payloads rather than aggregate build directories. The focused Lane A compare was pushed and verified at final commite125b318d74a1319cedf5215b92f6bdd0ead9140; it preserves the separate authoritative_meta-113finding.Final PASS retains the exact-candidate evidence from immutable recovery run
32695311485and refreshes only fp16 L1 in immutable hosted run32701875911, as authorized by the Tester v2 preserved-evidence manifest. Preserved L0, fp32 L1, L2, L3, Analyze, and quality evidence remains tied to the unchanged candidate and dependency. The preserved first run failed because the tester harness compared aggregate build-directory sizes containing retained fp32 intermediates (230,182,646 bytes fp32 vs 230,235,020 bytes fp16), rather than realizedmodel.onnxpayloads (76,710,324 bytes fp32 vs 38,381,076 bytes fp16). This was a tester-harness defect; the correction changed the size assertion to compare final payload bytes, and the candidate commit did not change.The fp16 refresh also preserves two failed hosted harness attempts truthfully: run
32701127519referenced a nonexistent top-level materialized-config model key, and run32701514334found that raw CLI Perf passed but did not invoke its disconnected Model Precision display helper. The final harness printed initializer-derivedModel Precision: fp16before invoking the same bounded CLI Perf command. These were evidence-harness incidents, not candidate failures; the final artifact was byte-identical and the candidate remainedd951fccaba37275540cdf2757bfb6b3cf60e8ec8.4. Per-EP/device/precision results and Functional smoke Eval
Goal ladder
Build, perf, and parity
Both artifacts expose
input_ids,attention_mask, andtoken_type_idsasINT32 [1,512], withlogitsasFLOAT [1,1]. FP32 also measured p90/p99/max 92.52 ms and min 62.03 ms. Fresh fp16 measured p90/p99/max 120.96 ms and min 85.85 ms, with explicit initializer-derived runtime outputModel Precision: fp16. Its exact realized payload is 38,381,076 bytes, including 38,329,352 raw FLOAT16 payload bytes across 76 FLOAT16 initializers. VRAM delta was not applicable for CPU.[8.320240020751953, 1.2873587608337402, -11.603301048278809][8.320236206054688, 1.2873551845550537, -11.603301048278809][0,1,2]preserved[8.320240020751953, 1.2873587608337402, -11.603301048278809][8.31916618347168, 1.2839525938034058, -11.603437423706055][0,1,2]preservedFunctional smoke Eval
PASS, operability evidence only; not representative accuracy or benchmark quality. The final candidate fp32 CPU artifact ran
mteb/scidocs-rerankingtest split at pinned revision56a6d0140cf6356659e2a7c1413286a774468d44. Deterministic first-N streaming selected and processed 2 of 2 query groups with no shuffle. Schema, positive/negative label semantics, and one-raw-logit-per-pair descending-score prediction semantics were verified.Caps were 2 groups, 10 candidates per group, at least 1 positive per group, 20 pairs total, and sequence length 512; candidate labels/prompts were capped at 10, with beams and frames/crops not applicable. Raw metrics were MRR@10 1.0, Recall@1 1.0, and Recall@10 1.0. No other precision or EP received an accuracy claim. Current
mainformerly rejected thererankingtask; dependency #1322 supplies generic task normalization, paired-input raw-scalar evaluation, grouped-text adaptation, candidate caps, and ranking metrics.5. Delta
The production recipe README is untouched. No product source, generic tests, skill files, or existing L2/L6/L12 recipes changed in this model contribution.
/loader/tasktext-classificationreranking/loader/tasktext-classificationreranking/quantnull{"mode":"fp16","fp16_keep_io_types":true,"samples":10}/export/compatibility{"transformers_attention":"eager"}transformers_attention=eager./optim/clamp_constant_valuestrueThe dependency-generated
text-rankingandrerankingconfigs are parsed-JSON identical. The fp32 and fp16 recipes have the same sparse structure except for the required fp16/quantdeclaration. Reducibility is consistent with the charter: only per-checkpoint CPU precision coverage is authored; all metadata-derived reranking normalization and evaluation remains in dependency #1322. Recipe-free acceptance is not required for this per-model coverage contribution, and no checkpoint-hardcoded code exists.6. Analyze summary - component level and op level
Static analysis returned ANALYZE-PARTIAL-SUCCESS for both artifacts:
analyzeexited 1 because provider-bridge initialization failed, while retaining complete JSON for all seven requested EPs. This is static rule analysis, not runtime execution proof for non-CPU EPs.Component-level summary
Gatherin embeddings/pooler; no unsupported types.Gatherin embeddings/pooler; no unsupported types.The explicit unmapped nodes are backbone mask/shape glue outside the frozen component regions.
Op-level summary
The other counts are identical in both graphs: Gather 4, Mul 4, Flatten 1, And 1, Expand 1, Where 1, Softmax 4, Gelu 4, and Tanh 1.
Whereunknown; none partial/unsupportedWhereandCastunknown; none partial/unsupportedGatherpartial;Whereunknown; none unsupportedGatherpartial;WhereandCastunknown; none unsupportedWhereunknown; none partial/unsupportedWhereandCastunknown; none partial/unsupported7. Reproduce commands