From b34869c359784f1511e2cec9b7e6e40298c62742 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 16 Jul 2026 10:39:23 +0800 Subject: [PATCH] recipe(deberta): add mixedbread-ai/mxbai-rerank-base-v1 (text-classification, reranker) Curated CPU float recipe for the mxbai-rerank-base-v1 cross-encoder reranker (config model_type deberta-v2, DebertaV2ForSequenceClassification, num_labels=1 -> single relevance logit). 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). The recipe is byte-identical to cross-encoder/nli-deberta-v3-base's (model_id is CLI-passed; output width is config-driven), confirming one deberta-v2 text-classification recipe serves the task family. Validated on CPU: - L0 build: recipe-driven winml build exit 0 (633.6s, no quantize); ONNX opset 17, output logits[1,1] (trained reranker head preserved); 786 MB fp32. - L1 perf: CPU/fp32 avg 7027.85 ms, 0.14 samples/s, RAM +624.7 MB (perf also auto-ran on QNN/NPU at 523.99 ms / 1.91 samples/s). - L2 numeric parity vs PyTorch on real (query, document) reranking pairs: cosine 1.000000, max-abs 1.097e-5, ranking order 4/4 identical, top-1 doc agrees. 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/mixedbread-ai_mxbai-rerank-base-v1/cpu/cpu/text-classification_fp16_config.json create mode 100644 examples/recipes/mixedbread-ai_mxbai-rerank-base-v1/cpu/cpu/text-classification_fp32_config.json diff --git a/examples/recipes/mixedbread-ai_mxbai-rerank-base-v1/cpu/cpu/text-classification_fp16_config.json b/examples/recipes/mixedbread-ai_mxbai-rerank-base-v1/cpu/cpu/text-classification_fp16_config.json new file mode 100644 index 000000000..7b36e6952 --- /dev/null +++ b/examples/recipes/mixedbread-ai_mxbai-rerank-base-v1/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/mixedbread-ai_mxbai-rerank-base-v1/cpu/cpu/text-classification_fp32_config.json b/examples/recipes/mixedbread-ai_mxbai-rerank-base-v1/cpu/cpu/text-classification_fp32_config.json new file mode 100644 index 000000000..7b36e6952 --- /dev/null +++ b/examples/recipes/mixedbread-ai_mxbai-rerank-base-v1/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" + } +}