From df29999a8d480dae160f6f47800f573bc692919d Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 16 Jul 2026 09:17:21 +0800 Subject: [PATCH] recipe(deberta): add cross-encoder/nli-deberta-v3-base (text-classification) Curated CPU float recipe for the DeBERTa-v3 cross-encoder NLI model (config model_type deberta-v2). Ships fp32 + fp16 under cpu/cpu/ (both quant:null; no CPU quantized variant per repo convention). Recipe-only: Optimum covers deberta-v2 text-classification natively, so zero source changes. Inputs are input_ids + attention_mask only (deberta-v2 has type_vocab_size=0, no token_type_ids). Validated on CPU: - L0 build: recipe-driven winml build exit 0; ONNX opset 17, output logits[1,3] (trained 3-way NLI head preserved); 786 MB fp32. - L1 perf: CPU/fp32 avg 5951 ms, throughput 0.17 samples/s, RAM +618 MB. - L2 numeric parity vs PyTorch on real NLI sentence pairs: cosine=1.000000, max-abs=1.9e-6, argmax agreement 4/4. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- .../cpu/text-classification_fp16_config.json | 54 +++++++++++++++++++ .../cpu/text-classification_fp32_config.json | 54 +++++++++++++++++++ 2 files changed, 108 insertions(+) create mode 100644 examples/recipes/cross-encoder_nli-deberta-v3-base/cpu/cpu/text-classification_fp16_config.json create mode 100644 examples/recipes/cross-encoder_nli-deberta-v3-base/cpu/cpu/text-classification_fp32_config.json diff --git a/examples/recipes/cross-encoder_nli-deberta-v3-base/cpu/cpu/text-classification_fp16_config.json b/examples/recipes/cross-encoder_nli-deberta-v3-base/cpu/cpu/text-classification_fp16_config.json new file mode 100644 index 000000000..7b36e6952 --- /dev/null +++ b/examples/recipes/cross-encoder_nli-deberta-v3-base/cpu/cpu/text-classification_fp16_config.json @@ -0,0 +1,54 @@ +{ + "export": { + "opset_version": 17, + "batch_size": 1, + "export_params": true, + "do_constant_folding": true, + "verbose": false, + "dynamo": false, + "enable_hierarchy_tags": true, + "clean_onnx": false, + "hierarchy_tag_format": "full", + "input_tensors": [ + { + "name": "input_ids", + "dtype": "int32", + "shape": [ + 1, + 512 + ], + "value_range": [ + 0, + 128100 + ] + }, + { + "name": "attention_mask", + "dtype": "int32", + "shape": [ + 1, + 512 + ], + "value_range": [ + 0, + 2 + ] + } + ], + "output_tensors": [ + { + "name": "logits" + } + ] + }, + "optim": { + "clamp_constant_values": true + }, + "quant": null, + "compile": null, + "loader": { + "task": "text-classification", + "model_class": "AutoModelForSequenceClassification", + "model_type": "deberta-v2" + } +} diff --git a/examples/recipes/cross-encoder_nli-deberta-v3-base/cpu/cpu/text-classification_fp32_config.json b/examples/recipes/cross-encoder_nli-deberta-v3-base/cpu/cpu/text-classification_fp32_config.json new file mode 100644 index 000000000..7b36e6952 --- /dev/null +++ b/examples/recipes/cross-encoder_nli-deberta-v3-base/cpu/cpu/text-classification_fp32_config.json @@ -0,0 +1,54 @@ +{ + "export": { + "opset_version": 17, + "batch_size": 1, + "export_params": true, + "do_constant_folding": true, + "verbose": false, + "dynamo": false, + "enable_hierarchy_tags": true, + "clean_onnx": false, + "hierarchy_tag_format": "full", + "input_tensors": [ + { + "name": "input_ids", + "dtype": "int32", + "shape": [ + 1, + 512 + ], + "value_range": [ + 0, + 128100 + ] + }, + { + "name": "attention_mask", + "dtype": "int32", + "shape": [ + 1, + 512 + ], + "value_range": [ + 0, + 2 + ] + } + ], + "output_tensors": [ + { + "name": "logits" + } + ] + }, + "optim": { + "clamp_constant_values": true + }, + "quant": null, + "compile": null, + "loader": { + "task": "text-classification", + "model_class": "AutoModelForSequenceClassification", + "model_type": "deberta-v2" + } +}