Skip to content

recipe(distilbert): add MNLI text classification recipes#1153

Open
kujin66 wants to merge 1 commit into
mainfrom
kujin66/add-distilbert-mnli-recipe
Open

recipe(distilbert): add MNLI text classification recipes#1153
kujin66 wants to merge 1 commit into
mainfrom
kujin66/add-distilbert-mnli-recipe

Conversation

@kujin66

@kujin66 kujin66 commented Jul 21, 2026

Copy link
Copy Markdown

Add recipe support for typeform/distilbert-base-uncased-mnli, a DistilBERT sequence-classification checkpoint for MNLI/NLI text classification. This is a recipe-only L0 contribution with Goal L1 evidence on CPU for fp16 and w8a16. Baseline auto-config already builds the model, so the measurable delta is the checked-in catalog recipe plus verified fp16 and w8a16 artifact/perf evidence.

  1. Recipe path(s)
  • examples/recipes/typeform_distilbert-base-uncased-mnli/text-classification_fp16_config.json
  • examples/recipes/typeform_distilbert-base-uncased-mnli/text-classification_w8a16_config.json
  1. README row
  • Added | typeform/distilbert-base-uncased-mnli | text-classification | to examples/recipes/README.md.
  • Updated total from 75 to 76.
  1. Build output dir
  • Baseline auto-config: temp/distilbert_mnli_baseline_build
  • Recipe fp16: temp/distilbert_mnli_fp16_quant_build
  • Recipe w8a16: temp/distilbert_mnli_w8a16_build
  1. Build log
  • Baseline command: D:\WPDProjects\winml-cli\.venv\Scripts\python.exe -m winml.modelkit build -m typeform/distilbert-base-uncased-mnli -o temp\distilbert_mnli_baseline_build --ep cpu --device cpu --no-analyze --no-optimize --no-quant --no-compile --rebuild
    • Output contained Build complete in 48.6s, final artifact temp\distilbert_mnli_baseline_build\model.onnx.
    • winml --version: winml, version 0.2.0.
    • Branch/base HEAD: origin/main = 38767add6f91c7b10b6394fae3af6f437e02effd.
  • fp16 recipe command: D:\WPDProjects\winml-cli\.venv\Scripts\python.exe -m winml.modelkit build -c examples/recipes/typeform_distilbert-base-uncased-mnli/text-classification_fp16_config.json -m typeform/distilbert-base-uncased-mnli -o temp\distilbert_mnli_fp16_quant_build --precision fp16 --ep cpu --device cpu --no-analyze --no-optimize --no-compile --rebuild
    • Output contained Build complete in 33.5s, final artifact temp\distilbert_mnli_fp16_quant_build\model.onnx.
    • ONNX check: inputs input_ids/attention_mask [1,512], output logits [1,3], FLOAT16 initializers 109/115.
  • w8a16 recipe command: D:\WPDProjects\winml-cli\.venv\Scripts\python.exe -m winml.modelkit build -c examples/recipes/typeform_distilbert-base-uncased-mnli/text-classification_w8a16_config.json -m typeform/distilbert-base-uncased-mnli -o temp\distilbert_mnli_w8a16_build --precision w8a16 --ep cpu --device cpu --no-analyze --no-optimize --no-compile --rebuild
    • Output contained Build complete in 62.3s, final artifact temp\distilbert_mnli_w8a16_build\model.onnx.
    • ONNX check: inputs input_ids/attention_mask [1,512], output logits [1,3], QuantizeLinear=219, DequantizeLinear=328.
  1. Appended findings
  • Added local Skill knowledge file model_knowledge/distilbert.json with finding distilbert-001.
  • Finding captures fp16/w8a16 CPU evidence, export metadata, QDQ/FLOAT16 counts, MNLI eval column mapping, and analyze host gap.
  1. Optimum-coverage probe
{
  "vendor": ["feature-extraction", "fill-mask", "multiple-choice", "question-answering", "text-classification", "token-classification"],
  "after_winml": ["feature-extraction", "fill-mask", "multiple-choice", "question-answering", "text-classification", "token-classification"],
  "added_by_winml": [],
  "verdict": "VENDOR-ONLY"
}

Model config probe:

{
  "model_type": "distilbert",
  "architectures": ["DistilBertForSequenceClassification"],
  "vocab_size": 30522,
  "max_position_embeddings": 512,
  "num_labels": 3,
  "id2label": {"0": "ENTAILMENT", "1": "NEUTRAL", "2": "CONTRADICTION"}
}

winml inspect resolved task text-classification, exporter DistilBertOnnxConfig, and WinML class WinMLModelForSequenceClassification with support level default.

  1. Claimed (Effort, Goal, Outcome)
{
  "model_id": "typeform/distilbert-base-uncased-mnli",
  "model_type": "distilbert",
  "effort": "L0",
  "goal_ceiling": "L1",
  "outcome": "L0",
  "target_eps": ["cpu"],
  "catalog_gate": {
    "baseline_build": "PASS",
    "verdict": "catalog-needs-numbers",
    "file_pr": true
  }
}
  1. Goal-ladder verdict table
{
  "deliverable_ref": "typeform/distilbert-base-uncased-mnli",
  "ladder": [
    {
      "tier": "L0",
      "verdict": "PASS",
      "evidence": "Baseline auto-config and recipe builds produced loadable ONNX artifacts. fp16 model.onnx: inputs input_ids/attention_mask [1,512], output logits [1,3], FLOAT16 initializers 109/115. w8a16 model.onnx: inputs input_ids/attention_mask [1,512], output logits [1,3], QuantizeLinear=219, DequantizeLinear=328."
    },
    {
      "tier": "L1",
      "verdict": "PASS",
      "evidence": "CPU providers snapshot: ['DmlExecutionProvider', 'CPUExecutionProvider']. fp16 CPU perf mean 189.806 ms, throughput 5.27 samples/sec, RSS total delta 294.35 MB. w8a16 CPU perf mean 279.577 ms, throughput 3.58 samples/sec, RSS total delta 283.38 MB."
    }
  ],
  "ceiling_reached": "L1",
  "ceiling_downgraded": false,
  "new_verdict_shapes": []
}
  1. Methodology-evolution declaration
  • No new methodology friction observed.
  • Existing Skill rule _meta-057 was applied: recipe validation used explicit --precision fp16 / --precision w8a16, then verified FLOAT16 initializer count and QDQ node counts. This caught that a plain CPU build can resolve quant to null for fp16.
  • Analyze output was unavailable on this host because src/winml/modelkit/analyze/rules/runtime_check_rules contains only README.md; this is the known _meta-056 host gap, and the finding mines export_htp_metadata.json plus winml_build_config.json instead.

Additional notes

  • Branch base: origin/main 38767add6f91c7b10b6394fae3af6f437e02effd.

@kujin66

kujin66 commented Jul 21, 2026

Copy link
Copy Markdown
Author

Reviewer verdict: APPROVE fallback comment / Lane B model PR is ready for maintainer review.

Checked items:

  • PR body contains the 9-item adding-model-support report.
  • Diff scope is L0 recipe-only: README plus two typeform/distilbert-base-uncased-mnli recipe JSON files.
  • Branch is based on current origin/main 38767add6f91c7b10b6394fae3af6f437e02effd; git rev-list --count 38767add6f91c7b10b6394fae3af6f437e02effd..origin/main returned 0.
  • CI is green: Analyze, CodeQL, CLA, lint, and all test jobs passed.
  • Goal L0 evidence is present: baseline auto-config and recipe builds produced loadable ONNX artifacts with input_ids / attention_mask [1,512] and logits [1,3].
  • Goal L1 evidence is present for CPU: fp16 perf mean 189.806 ms / 5.27 samples/sec; w8a16 perf mean 279.577 ms / 3.58 samples/sec.
  • Precision evidence is present: fp16 artifact has 109/115 FLOAT16 initializers; w8a16 artifact has QuantizeLinear=219, DequantizeLinear=328.
  • PR is mergeable according to GitHub. GitHub-side approval metadata may not be set if the same account cannot approve its own pull request.

Methodology note:

  • No new methodology friction observed. Existing _meta-057 was applied for artifact-level precision validation, and _meta-056 covers the analyze parquet host gap.
  • Local Skill knowledge was updated as model_knowledge/distilbert.json / distilbert-001; Skill Lane A files are intentionally not included in this Lane B winml-cli PR.

@kujin66
kujin66 marked this pull request as ready for review July 21, 2026 03:05
@kujin66
kujin66 requested a review from a team as a code owner July 21, 2026 03:05
@ssss141414 ssss141414 added the model-scale-by-skill Model support PR created or maintained by the adding-model-support skill label Jul 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

model-scale-by-skill Model support PR created or maintained by the adding-model-support skill

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants