recipe(nli-MiniLM2-L6-H768): add CPU text classification configs#1192
Draft
fuliucansheng wants to merge 1 commit into
Draft
recipe(nli-MiniLM2-L6-H768): add CPU text classification configs#1192fuliucansheng wants to merge 1 commit into
fuliucansheng wants to merge 1 commit into
Conversation
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
Adds CPU recipe coverage for
cross-encoder/nli-MiniLM2-L6-H768, an NLI cross-encoder exported through WinML's existing RoBERTa sequence-classification path. This is an L0 recipe-only contribution: currentmainalready builds and runs the model, and this PR records verified CPU fp32/fp16 coverage with checked-in recipes.Model metadata
What the model does:
cross-encoder/nli-MiniLM2-L6-H768classifies sentence pairs into NLI labels (contradiction,entailment,neutral). WinML resolves it astext-classificationwithRobertaForSequenceClassification.Primary user stories:
Supported tasks:
text-classificationModel architecture:
Source/confidence: pinned checkpoint config resolves
model_type: roberta,architectures: [RobertaForSequenceClassification], hidden size 768, 6 layers, 12 attention heads, and 3 NLI labels.Validation and support evidence
Baseline
Baseline was run from current
origin/mainat2c378c7dc213e0a69afec87d3d7c5015eb4e570dwithwinml, version 0.2.0.winml inspectAutoModelForSequenceClassification, exporterRobertaIOConfig, WinML classWinMLModelForSequenceClassification; inputsinput_idsandattention_maskint32[1, 512]; outputlogits.roberta: vendor tasks includetext-classification; WinML adds no extra task override.0.9999999999995716, max absolute diff max2.2649765014648438e-06.text-classificationeval uses GLUE/MRPC labels and fails label alignment for labelequivalent; this checkpoint's labels arecontradiction,entailment, andneutral.Baseline
winml config -p fp32 --ep cpu --device cpuandwinml config -p fp16 --ep cpu --device cpuare the sources for the checked-in recipes.Goal
Effort: L0. Goal ceiling: L2. Outcome: L0 recipe-only.
Success means the checked-in CPU fp32/fp16 recipes build structurally valid ONNX artifacts, run
winml perfon CPU, and match the PyTorch reference numerically through WinML compare mode. L3 is explicitly blocked by default dataset label semantics for this NLI checkpoint.Outcome
Highest verified goal: L2 PASS on CPU for both fp32 and fp16. Coverage is full for the targeted EP set (
cpu/cpu/fp32,cpu/cpu/fp16); no accelerator tuples are claimed.Shipped recipes:
examples/recipes/cross-encoder_nli-MiniLM2-L6-H768/cpu/cpu/text-classification_fp32_config.jsonexamples/recipes/cross-encoder_nli-MiniLM2-L6-H768/cpu/cpu/text-classification_fp16_config.jsonMethodology friction observed: none. Model finding: RoBERTa NLI cross-encoders export cleanly through
text-classification; default MRPC eval is not semantically compatible without an NLI-specific dataset/label mapping.Per-EP/device/precision results
input_ids,attention_maskint32[1, 512], outputlogits [1, 3], 210 nodes, external data colocated withmodel.onnx.--precision fp16; final artifact is about 165.1 MB and reports fp16 at perf time, with 211 nodes.winml eval --mode compare: cosine mean0.9999999999995716, max absolute diff max2.2649765014648438e-06, SQNR mean 117.705 dB.winml eval --mode compare: cosine mean0.9999997277161565, max absolute diff max0.0017644912004470825, SQNR mean 63.299 dB.text-classificationeval datasetnyu-mll/glue/mrpcfails label alignment for labelequivalent; checkpoint labels are NLI labels.Delta
Both recipes are generated from current
winml configoutput with explicit CPU targeting. The fp32 recipe preservesquant: null; the fp16 recipe preserves the generated fp16 quantization block and model metadata. No source code or tests are changed, andexamples/recipes/README.mdis untouched.Reducibility: recipe-only is appropriate because auto-config already resolves task, loader, exporter, and WinML inference class correctly; this PR is a per-checkpoint verified CPU coverage declaration rather than a class-wide code fix.
Analyze summary
Static rule analysis completed with partial-success exit semantics: QNN/OpenVINO rows were complete, while VitisAI has no rule data and is all-unknown. This is compatibility analysis, not runtime execution.
Component-level summary
Op-level summary
Reproduce commands