Add WinML reranking support for cross-encoder/ms-marco-MiniLM-L6-v2 - #1322
ssss141414 wants to merge 15 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:
|
|
APPROVE: reviewed exact head 414e919. Grouped reranking now filters empty passages before capping and uses deterministic label-independent interleaving so tied scores do not receive positive-first bias. Independent detached validation passed 111 focused tests; Ruff and package-wide mypy passed; all 9 fresh GitHub checks are green; no active review threads remain. |
Qiong Wu (qiowu) (DingmaomaoBJTU)
left a comment
There was a problem hiding this comment.
The reranking integration has several correctness issues in online inference, metric semantics, grouped-ID normalization, and the bounded fixture builder. Inline comments include concrete failure modes and fixes.
Qiong Wu (qiowu) (DingmaomaoBJTU)
left a comment
There was a problem hiding this comment.
The five previous blockers are fixed, but the new bounded preselection makes the default pinned fixture build fail before it can find viable Top-1000 groups. See the inline comment.
ca9aed3 to
11422d9
Compare
|
APPROVE: independent re-verification completed for exact head
No blockers remain. |
Qiong Wu (qiowu) (DingmaomaoBJTU)
left a comment
There was a problem hiding this comment.
Found a correctness issue in pairwise dataset evaluation: row-level sampling can silently evaluate incomplete query groups. Current hosted checks pass, but the existing pairwise tests bypass prepare_data and do not cover this path.
|
|
||
| grouped: dict[str, list[_Candidate]] = {} | ||
| queries: dict[str, str] = {} | ||
| for row_index, sample in enumerate(self.data): |
There was a problem hiding this comment.
[P1] Preserve complete query groups before sampling pairwise rows. self.data has already been shuffled and truncated by inherited WinMLEvaluator.prepare_data (default samples=100, shuffle=True), so grouping here cannot recover discarded candidates. A query with a positive scored 0.1 followed by a negative scored 0.9 yields MRR@10=0.5 and Recall@1=0 on the complete group; with --samples 1 --no-shuffle, only the positive survives and this reports both metrics as 1.0. I reproduced the sampling and metric change using the actual prepare_data method and RerankingMetric. Larger pairwise datasets are likewise reduced to partial groups by the default row sampling, and shuffled rows also change tie order. Please sample/shuffle complete query groups for pairwise mode (or reject sampling that would split a group), and add an integration regression through prepare_data, including streaming input.
Summary
This PR adds canonical WinML reranking support for
cross-encoder/ms-marco-MiniLM-L6-v2, including task resolution, pairwise inference, grouped evaluation, ranking metrics, a bounded MS MARCO fixture builder, and CPU fp32/fp16 recipes. It ships Effort L2 / Outcome L2 and reaches the committed Goal L3: L0-L3 PASS with full required CPU fp32/fp16 coverage on final candidate11422d97cc9a31ffdf64fb98462976b13ad25c19. The L3 result is a bounded functional smoke only, not representative accuracy or benchmark quality.Model metadata
What the model does
This English cross-encoder jointly tokenizes a query and candidate passage, encodes the pair with a six-layer MiniLM/BERT encoder, and emits one raw relevance logit used to rank passages.
verified).Primary user stories
verified; checkpointpipeline_tag=text-rankingand MS MARCO passage-ranking model-card family).inferredfrom verified text-ranking behavior).Supported tasks
text-rankingpipeline_tagtext-classificationBertForSequenceClassificationexport boundaryrerankingModel architecture
233902d25c440f23af6f7d6e94d2946bac0bee0a,BertForSequenceClassificationsource structure, and checked-in recipe I/O (verified).Validation and support evidence
Baseline
The planner required a FULL-RERUN because the previous validated base
02179d1to exact basef4e7eafd4e2365016371686dc2d86fa03bfc475achanged dependencies and shared config/build/export/quantization/runtime/perf/eval/analyze/CI surfaces and directly overlapped seven contribution paths. No historical executable stage was reused. Fresh base execution used the current-main WinML 0.3.1 declaration:loader.task: text-classification,AutoModelForSequenceClassification, BERT, opset 17, and three[1, 512]INT32 inputs.rerankingschema resolution was unavailable (exit 2); legacytext-classificationEval rejected the checkpoint/dataset label alignment (exit 1).text-classification; WinML adds the reranking semantic surface while retaining that exporter. The planner's direct pre-rebase registry import was unavailable because of a stale Optimum/Transformers symbol mismatch, while candidate inspect resolvedBertIOConfigthroughTasksManager.The producer rebased all 15 contribution commits onto exact base
f4e7eafd.... Range-diff paired all commits in order; 14 were exact and one retained both this PR'sRerankingMetricregistration and upstream'sTensorSimilarityMetricregistration. All 24 owned paths retained identical contribution line counts, and the final branch/PR head is11422d97....Goal
Outcome
Tester verdict: PASS_WITH_ENVIRONMENT_EXCEPTIONS. L0, L1, L2, and L3 all PASS; the highest Goal verdict is L3 PASS. Coverage is full, with no deferred tuples.
Shipped recipes:
examples/recipes/cross-encoder_ms-marco-MiniLM-L6-v2/cpu/cpu/reranking_fp32_config.jsonexamples/recipes/cross-encoder_ms-marco-MiniLM-L6-v2/cpu/cpu/reranking_fp16_config.jsonThe learner appended checkpoint-scoped BERT knowledge for exact CPU recipe/HTP structure, fp16 size/performance behavior, fp32/fp16 ranking parity, and bounded pinned-source fixture semantics. No new methodology finding or feature-gap issue was required.
Per-EP/device/precision results and Functional smoke Eval
Goal ladder
Required CPU tuples
Both artifacts use opset 17; named
input_ids,attention_mask, andtoken_type_idsINT32 inputs at[1, 512]; FLOATlogitsat[1, 1]; vocabulary boundary 30522; valid external-data references; and CPUExecutionProvider. The fp16/fp32 size ratio is0.5003723084352613.PyTorch parity
Parity used identical real query/document pairs and named tokenizer inputs (
text=query,text_pair=document) for PyTorch and ONNX.Functional smoke Eval
Final candidate
11422d97...ran one CPU fp32 grouped reranking Eval againstorgrctera/msmarco_passage_rankingrevisiona7388b9efd4dd4b87a0db91314e5b3f0e4b0d9e6plus pinned official MS MARCO dev queries, qrels, and Top-1000 candidates. Source checksums matched. The bounded builder skipped absent/nonviable IDs1048578and1048579, selected viable IDs1048585and2, and retained one shared positive plus three official negatives per group in authoritative Top-1000 order.These numbers prove bounded end-to-end evaluator/model-path operability only. They are not representative accuracy and not a benchmark-quality claim.
Compatibility and quality gates
onnxruntime_providers_shared.dll; exact base failed identically.HandshakeFailurewhile fetching PyPI metadata; exact base failed identically.11422d97..., including lint, all five test partitions, CodeQL, CLA, and policy checks.Delta
Relative to the fresh base auto-config:
/loader/task"text-classification""reranking"/loader/model_class"AutoModelForSequenceClassification"/export/opset_version17/export/input_tensors[1,512]INT32 BERT inputs/optim{"clamp_constant_values": true}{"gelu_fusion": true, "matmul_add_fusion": true}/quant(fp32)nullnull/quant/mode(fp16)"fp16"/quant/fp16_keep_io_types(fp16)trueThe contribution adds 24 owned paths: the two recipes; canonical reranking task resolution and registration; query/document pair inference; grouped/pairwise dataset normalization;
RerankingEvaluator;RerankingMetricwith true multi-positive Recall; evaluation utilities; a bounded, pinned-source MS MARCO fixture builder; and focused command/eval/inference/loader regressions. The implementation keeps the establishedAutoModelForSequenceClassificationexporter rather than adding checkpoint-specific architecture code. The fp32 and fp16 recipes were each accepted only on their exact passing tuples.examples/recipes/README.mdremains untouched.Bug fix explanation
--queries 2, the earlier fixture selected IDs1048578and1048579before checking Top-1000 materializability; neither had usable Top-1000 rows, so zero groups were materialized even though later viable IDs existed.1048578/1048579, selects1048585and2, materializes exactly two groups/eight pairs, and matches independent metric recomputation. Focused compatibility reports 287/287 passing and every exact-head hosted check succeeds.Analyze summary - component level and op level
ANALYZE-PARTIAL-SUCCESS. Static rule analysis is compatibility analysis, not runtime execution. The installed non-editable wheel omitted
avaliable_providers.jsonand produced incomplete empty classifications; recovery used exact-candidate source plus an external current rules set and one bounded command per populated provider/device rule folder.Component-level summary
Op-level summary
The fp32 recovery commands exited 0. The fp16 recovery commands exited 1 because of the conservative Cast unknowns. These static accelerator rows are not runtime-support claims; runtime testing in this report is CPUExecutionProvider only.
Reproduce commands