Add WinML reranking support for cross-encoder/ms-marco-MiniLM-L6-v2 - #1322
Add WinML reranking support for cross-encoder/ms-marco-MiniLM-L6-v2#1322ssss141414 wants to merge 12 commits into
Conversation
|
REQUEST_CHANGES for head Scope and metadata re-check:
Owner-tagged issues:
Independent validation performed:
Re-review gate:
|
|
Addressed on exact head Fix summary:
Validation:
Current review-thread snapshot:
Please re-review this exact head when convenient. |
|
REQUEST_CHANGES for head Exact-head gate re-check:
Owner-tagged issue:
Evidence used for this verdict:
|
|
ssss141414 Thanks for the re-check on #issuecomment-5356216204. Addressed on exact head
Current evidence status on this exact head:
Please re-review PR #1322 at this head. |
|
REQUEST_CHANGES for head Exact-head status re-check:
Owner-tagged issue:
Independent verification completed on this head:
Re-review gate:
|
|
APPROVE for head Exact-head authoritative reconfirmation:
Structured verification evidence:
Reviewer verdict:
|
|
REQUEST_CHANGES for head Scope and metadata re-check:
Owner-tagged issues:
Independent validation performed:
Re-review gate:
|
Summary
This PR adds canonical WinML reranking support for
cross-encoder/ms-marco-MiniLM-L6-v2, a cross-encoder passage reranker whose checkpoint metadata is authoritative fortext-rankingsemantics while export compatibility remains on the existing sequence-classification path. The shipped outcome is L3 with full CPU coverage: CPU fp32 and fp16 recipes build and perf cleanly, reranking parity preserves raw single-logit ordering, and the final candidate SHA completes a CPU fp32 functional smoke eval on a provenance-preserved MS MARCO fixture. The highest goal verdict reached isL3 PASSon candidate030e79fa6482acb08e51338ab4172ac4387b387d.Model metadata
What the model does
This checkpoint is a cross-encoder reranker that tokenizes a query-document pair together with a MiniLM-based BERT encoder and emits a single relevance logit used to order candidate passages for search and retrieval workloads.
pipeline_tag=text-ranking,architectures=[BertForSequenceClassification], and a single-label output mapping (verified).Primary user stories
mapped).inferred).Supported tasks
text-rankingon checkpoint metadata surfaces (verified).text-classificationon transformers, optimum-onnx, and WinML export/inference surfaces (mapped).Model architecture
BertForSequenceClassificationstructure in the frozen model breakdown (verified).Validation and support evidence
Baseline
02179d185f0e3ac23518236b5ca1f61fd37ef680.winml-cli 0.3.0.text-classificationpath.AutoModelForSequenceClassificationandtext-classificationwith opset 17 and the standard BERT[1, 512]int32 tensor inputs.BertForSequenceClassificationexported cleanly as a 196-node ONNX graph.winml evalattemptednyu-mll/glue/ MRPC undertext-classificationand failed offline, which confirmed the missing reranking evaluator and dataset path rather than any recipe/build defect.Goal
L2.L3.L2, with success defined as CPU fp32/fp16 builds, measured CPU perf, preserved reranking raw-logit ordering, and a final-SHA fp32 CPU reranking eval on 1-2 real MS MARCO queries with authoritative pinned provenance.Outcome
L3.L3 PASS.full.producer/ms-marco-minilm-l6-v2-reranking, final candidate SHA030e79fa6482acb08e51338ab4172ac4387b387d, tester repo-state verdictPASS, tracked treeclean, and no PR-attributable blockers remaining.uv lock --checkPASS, reranking evaluator10 passed, focused reranking regression265 passed, changed-path Ruff PASS, and preserved L2/L3 PASS evidence.Per-EP/device/precision results and Functional smoke Eval
[1, 1], initializer dtypesFLOAT=108 BOOL=1 INT64=32, graph node count196, and model size90927104bytes.[1, 1], initializer dtypesFLOAT16=108 BOOL=1 INT64=32, graph node count197, and model size45499992bytes.pair_count=4,cosine=0.9999999999999976,max_abs_diff=9.5367431640625e-07, and identical descending rank order between PyTorch and ONNX.Functional smoke Eval
030e79fa6482acb08e51338ab4172ac4387b387d.cpu,fp32only.orgrctera/msmarco_passage_ranking@a7388b9efd4dd4b87a0db91314e5b3f0e4b0d9e6and joined against the public MS MARCOqueries.tar.gz,qrels.dev.tsv, andtop1000.dev.tar.gzsources recorded inprovenance.json.2real grouped queries,8processed pairs,8expanded pairs,0skipped groups.max_queries=2,max_negatives=3, beam cap1, sequence length512,--samples 2,--no-shuffle, grouped candidates withcandidate_id_key=idandcandidate_text_key=text.MRR@10=1.0,Recall@1=1.0,Recall@10=1.0on exactly2real groups /8pairs.l3_cpu_eval_r7.jsonplus fixture provenance that pins the Hugging Face revision and published source checksums.Delta
examples/recipes/cross-encoder_ms-marco-MiniLM-L6-v2/cpu/cpu/reranking_fp32_config.jsonchanges/loader/taskfromtext-classificationtoreranking.examples/recipes/cross-encoder_ms-marco-MiniLM-L6-v2/cpu/cpu/reranking_fp16_config.jsonchanges/loader/taskfromtext-classificationtoreranking.src/winml/modelkit/loader/resolution.py: auto-detectedtext-classificationcheckpoints now surfacererankingwhen authoritative Hub metadata reportstext-ranking, while the Optimum/export boundary still resolves totext-classification.src/winml/modelkit/eval/reranking_evaluator.py: adds grouped reranking evaluation that scores raw single-logit relevance directly, with deterministic tie handling and grouped metrics.src/winml/modelkit/eval/metrics/ranking.py: defines the ranking metrics used by the reranking evaluator.src/winml/modelkit/eval/base_evaluator.py: honors explicit split selection when--datasetpoints at a locally savedDatasetDict, so the grouped fixture can be consumed reproducibly.src/winml/modelkit/utils/eval_utils.py: registers reranking schema and column conventions.src/winml/modelkit/inference/tasks.py,src/winml/modelkit/inference/pipeline.py,src/winml/modelkit/loader/task.py,src/winml/modelkit/eval/evaluate.py,src/winml/modelkit/datasets/__init__.py, andsrc/winml/modelkit/models/winml/__init__.py: wire the canonical reranking surface through shared task resolution, inference, and evaluation.scripts/e2e_eval/datasets/build_msmarco_reranking_fixture.py: materializes a tiny grouped MS MARCO fixture by joining the pinned Hugging Face dev rows against the official public query, qrels, and top1000 sources while preserving provenance.3with original authoritative ranks553(query1048585) and936(query2), while the model still ranks both positives first at inference time.MRR@10,Recall@1, andRecall@10exactly match evaluator output.true.Bug fix explanation for the final repair commit
scripts/e2e_eval/datasets/build_msmarco_reranking_fixture.pynow preserves authoritative top1000 order through bounded selection and emitted candidate ordering, andtests/unit/eval/test_reranking_evaluator.pyadds tie-order and fixture-order regressions.10 passedfull reranking evaluator,265 passedfocused regression slice, changed-path Ruff PASS), and tester r11 re-ran the two environment-sensitive gates on the exact head with clean-env changed-file mypy PASS anduv lock --checkPASS.Analyze summary ΓÇö component level and op level
Static rule analysis completed with
ANALYZE-PARTIAL-SUCCESS; this is compatibility analysis, not runtime execution.Component-level summary
Op-level summary
Reproduce commands
The public reproduce path below uses the public model ID, the checked-in grouped fixture materializer, and the pinned dataset provenance recorded by the materialized
provenance.json.