From f3e5ed35380aa57e8d847890ce6424097deff9fe Mon Sep 17 00:00:00 2001 From: jinkun Date: Tue, 21 Jul 2026 10:59:18 +0800 Subject: [PATCH 1/3] recipe(distilbert): add MNLI text classification recipes --- examples/recipes/README.md | 3 +- .../text-classification_fp16_config.json | 89 +++++++++++++++++++ .../text-classification_w8a16_config.json | 87 ++++++++++++++++++ 3 files changed, 178 insertions(+), 1 deletion(-) create mode 100644 examples/recipes/typeform_distilbert-base-uncased-mnli/text-classification_fp16_config.json create mode 100644 examples/recipes/typeform_distilbert-base-uncased-mnli/text-classification_w8a16_config.json diff --git a/examples/recipes/README.md b/examples/recipes/README.md index 1077e4f74..f3c865c40 100644 --- a/examples/recipes/README.md +++ b/examples/recipes/README.md @@ -14,7 +14,7 @@ Each *(model, task)* includes: ## Models -Total: **75** (model, task) tuples that pass fp16 eval on all 10 (EP, device) buckets. +Total: **76** (model, task) tuples that pass fp16 eval on all 10 (EP, device) buckets. | Model | Task | |---|---| @@ -92,4 +92,5 @@ Total: **75** (model, task) tuples that pass fp16 eval on all 10 (EP, device) bu | sentence-transformers/paraphrase-multilingual-MiniLM-L12-v2 | feature-extraction | | sentence-transformers/paraphrase-multilingual-MiniLM-L12-v2 | sentence-similarity | | sentence-transformers/paraphrase-multilingual-mpnet-base-v2 | sentence-similarity | +| typeform/distilbert-base-uncased-mnli | text-classification | | w11wo/indonesian-roberta-base-posp-tagger | token-classification | diff --git a/examples/recipes/typeform_distilbert-base-uncased-mnli/text-classification_fp16_config.json b/examples/recipes/typeform_distilbert-base-uncased-mnli/text-classification_fp16_config.json new file mode 100644 index 000000000..ef3a50d73 --- /dev/null +++ b/examples/recipes/typeform_distilbert-base-uncased-mnli/text-classification_fp16_config.json @@ -0,0 +1,89 @@ +{ + "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, + 30522 + ] + }, + { + "name": "attention_mask", + "dtype": "int32", + "shape": [ + 1, + 512 + ], + "value_range": [ + 0, + 2 + ] + } + ], + "output_tensors": [ + { + "name": "logits" + } + ] + }, + "optim": { + + }, + "quant": { + "mode": "fp16", + "samples": 10, + "calibration_method": "minmax", + "weight_type": "uint8", + "activation_type": "uint8", + "per_channel": false, + "symmetric": false, + "weight_symmetric": null, + "activation_symmetric": null, + "save_calibration": false, + "distribution": "uniform", + "seed": null, + "calibration_load_path": null, + "calibration_save_path": null, + "op_types_to_quantize": null, + "nodes_to_exclude": null, + "task": "text-classification", + "model_id": "typeform/distilbert-base-uncased-mnli", + "model_type": "distilbert", + "fp16_keep_io_types": true, + "fp16_op_block_list": null + }, + "compile": null, + "loader": { + "task": "text-classification", + "model_class": "AutoModelForSequenceClassification", + "model_type": "distilbert" + }, + "eval": { + "task": "text-classification", + "dataset": { + "path": "nyu-mll/glue", + "name": "mnli", + "split": "validation_matched", + "samples": 100, + "columns_mapping": { + "input_column": "premise", + "second_input_column": "hypothesis" + } + } + } +} diff --git a/examples/recipes/typeform_distilbert-base-uncased-mnli/text-classification_w8a16_config.json b/examples/recipes/typeform_distilbert-base-uncased-mnli/text-classification_w8a16_config.json new file mode 100644 index 000000000..f9c568183 --- /dev/null +++ b/examples/recipes/typeform_distilbert-base-uncased-mnli/text-classification_w8a16_config.json @@ -0,0 +1,87 @@ +{ + "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, + 30522 + ] + }, + { + "name": "attention_mask", + "dtype": "int32", + "shape": [ + 1, + 512 + ], + "value_range": [ + 0, + 2 + ] + } + ], + "output_tensors": [ + { + "name": "logits" + } + ] + }, + "optim": { + + }, + "quant": { + "mode": "static", + "samples": 10, + "calibration_method": "minmax", + "weight_type": "uint8", + "activation_type": "uint16", + "per_channel": false, + "symmetric": false, + "weight_symmetric": null, + "activation_symmetric": null, + "save_calibration": false, + "distribution": "uniform", + "seed": null, + "calibration_load_path": null, + "calibration_save_path": null, + "op_types_to_quantize": null, + "nodes_to_exclude": null, + "task": "text-classification", + "model_id": "typeform/distilbert-base-uncased-mnli", + "model_type": "distilbert" + }, + "compile": null, + "loader": { + "task": "text-classification", + "model_class": "AutoModelForSequenceClassification", + "model_type": "distilbert" + }, + "eval": { + "task": "text-classification", + "dataset": { + "path": "nyu-mll/glue", + "name": "mnli", + "split": "validation_matched", + "samples": 1000, + "columns_mapping": { + "input_column": "premise", + "second_input_column": "hypothesis" + } + } + } +} From 390df0ca0aa43ce2df5a2898ba6a22dbc8c0ead4 Mon Sep 17 00:00:00 2001 From: Shiyi Zheng Date: Wed, 22 Jul 2026 21:05:21 +0800 Subject: [PATCH 2/3] Remove recipe README changes --- examples/recipes/README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/examples/recipes/README.md b/examples/recipes/README.md index f3c865c40..1077e4f74 100644 --- a/examples/recipes/README.md +++ b/examples/recipes/README.md @@ -14,7 +14,7 @@ Each *(model, task)* includes: ## Models -Total: **76** (model, task) tuples that pass fp16 eval on all 10 (EP, device) buckets. +Total: **75** (model, task) tuples that pass fp16 eval on all 10 (EP, device) buckets. | Model | Task | |---|---| @@ -92,5 +92,4 @@ Total: **76** (model, task) tuples that pass fp16 eval on all 10 (EP, device) bu | sentence-transformers/paraphrase-multilingual-MiniLM-L12-v2 | feature-extraction | | sentence-transformers/paraphrase-multilingual-MiniLM-L12-v2 | sentence-similarity | | sentence-transformers/paraphrase-multilingual-mpnet-base-v2 | sentence-similarity | -| typeform/distilbert-base-uncased-mnli | text-classification | | w11wo/indonesian-roberta-base-posp-tagger | token-classification | From 33a018c68703ba57a6181557f7fa7283e2db51a9 Mon Sep 17 00:00:00 2001 From: "Shiyi Zheng (from Dev Box)" Date: Thu, 23 Jul 2026 02:17:51 +0800 Subject: [PATCH 3/3] recipe(distilbert): align MNLI CPU precision coverage --- .../cpu/text-classification_fp16_config.json | 87 ++++++++++++++++++ .../cpu/text-classification_fp32_config.json | 65 ++++++++++++++ .../text-classification_fp16_config.json | 89 ------------------- .../text-classification_w8a16_config.json | 87 ------------------ 4 files changed, 152 insertions(+), 176 deletions(-) create mode 100644 examples/recipes/typeform_distilbert-base-uncased-mnli/cpu/cpu/text-classification_fp16_config.json create mode 100644 examples/recipes/typeform_distilbert-base-uncased-mnli/cpu/cpu/text-classification_fp32_config.json delete mode 100644 examples/recipes/typeform_distilbert-base-uncased-mnli/text-classification_fp16_config.json delete mode 100644 examples/recipes/typeform_distilbert-base-uncased-mnli/text-classification_w8a16_config.json diff --git a/examples/recipes/typeform_distilbert-base-uncased-mnli/cpu/cpu/text-classification_fp16_config.json b/examples/recipes/typeform_distilbert-base-uncased-mnli/cpu/cpu/text-classification_fp16_config.json new file mode 100644 index 000000000..b720fcd55 --- /dev/null +++ b/examples/recipes/typeform_distilbert-base-uncased-mnli/cpu/cpu/text-classification_fp16_config.json @@ -0,0 +1,87 @@ +{ + "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, + 30522 + ] + }, + { + "name": "attention_mask", + "dtype": "int32", + "shape": [ + 1, + 512 + ], + "value_range": [ + 0, + 2 + ] + } + ], + "output_tensors": [ + { + "name": "logits" + } + ] + }, + "optim": {}, + "quant": { + "mode": "fp16", + "samples": 10, + "calibration_method": "minmax", + "weight_type": "uint8", + "activation_type": "uint8", + "per_channel": false, + "symmetric": false, + "weight_symmetric": null, + "activation_symmetric": null, + "save_calibration": false, + "distribution": "uniform", + "seed": null, + "calibration_load_path": null, + "calibration_save_path": null, + "op_types_to_quantize": null, + "nodes_to_exclude": null, + "task": "text-classification", + "model_id": "typeform/distilbert-base-uncased-mnli", + "model_type": "distilbert", + "fp16_keep_io_types": true, + "fp16_op_block_list": null + }, + "compile": null, + "loader": { + "task": "text-classification", + "model_class": "AutoModelForSequenceClassification", + "model_type": "distilbert" + }, + "eval": { + "task": "text-classification", + "dataset": { + "path": "nyu-mll/glue", + "name": "mnli", + "split": "validation_matched", + "samples": 100, + "columns_mapping": { + "input_column": "premise", + "second_input_column": "hypothesis" + } + } + } +} \ No newline at end of file diff --git a/examples/recipes/typeform_distilbert-base-uncased-mnli/cpu/cpu/text-classification_fp32_config.json b/examples/recipes/typeform_distilbert-base-uncased-mnli/cpu/cpu/text-classification_fp32_config.json new file mode 100644 index 000000000..72dcfa940 --- /dev/null +++ b/examples/recipes/typeform_distilbert-base-uncased-mnli/cpu/cpu/text-classification_fp32_config.json @@ -0,0 +1,65 @@ +{ + "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, + 30522 + ] + }, + { + "name": "attention_mask", + "dtype": "int32", + "shape": [ + 1, + 512 + ], + "value_range": [ + 0, + 2 + ] + } + ], + "output_tensors": [ + { + "name": "logits" + } + ] + }, + "optim": {}, + "quant": null, + "compile": null, + "loader": { + "task": "text-classification", + "model_class": "AutoModelForSequenceClassification", + "model_type": "distilbert" + }, + "eval": { + "task": "text-classification", + "dataset": { + "path": "nyu-mll/glue", + "name": "mnli", + "split": "validation_matched", + "samples": 100, + "columns_mapping": { + "input_column": "premise", + "second_input_column": "hypothesis" + } + } + } +} \ No newline at end of file diff --git a/examples/recipes/typeform_distilbert-base-uncased-mnli/text-classification_fp16_config.json b/examples/recipes/typeform_distilbert-base-uncased-mnli/text-classification_fp16_config.json deleted file mode 100644 index ef3a50d73..000000000 --- a/examples/recipes/typeform_distilbert-base-uncased-mnli/text-classification_fp16_config.json +++ /dev/null @@ -1,89 +0,0 @@ -{ - "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, - 30522 - ] - }, - { - "name": "attention_mask", - "dtype": "int32", - "shape": [ - 1, - 512 - ], - "value_range": [ - 0, - 2 - ] - } - ], - "output_tensors": [ - { - "name": "logits" - } - ] - }, - "optim": { - - }, - "quant": { - "mode": "fp16", - "samples": 10, - "calibration_method": "minmax", - "weight_type": "uint8", - "activation_type": "uint8", - "per_channel": false, - "symmetric": false, - "weight_symmetric": null, - "activation_symmetric": null, - "save_calibration": false, - "distribution": "uniform", - "seed": null, - "calibration_load_path": null, - "calibration_save_path": null, - "op_types_to_quantize": null, - "nodes_to_exclude": null, - "task": "text-classification", - "model_id": "typeform/distilbert-base-uncased-mnli", - "model_type": "distilbert", - "fp16_keep_io_types": true, - "fp16_op_block_list": null - }, - "compile": null, - "loader": { - "task": "text-classification", - "model_class": "AutoModelForSequenceClassification", - "model_type": "distilbert" - }, - "eval": { - "task": "text-classification", - "dataset": { - "path": "nyu-mll/glue", - "name": "mnli", - "split": "validation_matched", - "samples": 100, - "columns_mapping": { - "input_column": "premise", - "second_input_column": "hypothesis" - } - } - } -} diff --git a/examples/recipes/typeform_distilbert-base-uncased-mnli/text-classification_w8a16_config.json b/examples/recipes/typeform_distilbert-base-uncased-mnli/text-classification_w8a16_config.json deleted file mode 100644 index f9c568183..000000000 --- a/examples/recipes/typeform_distilbert-base-uncased-mnli/text-classification_w8a16_config.json +++ /dev/null @@ -1,87 +0,0 @@ -{ - "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, - 30522 - ] - }, - { - "name": "attention_mask", - "dtype": "int32", - "shape": [ - 1, - 512 - ], - "value_range": [ - 0, - 2 - ] - } - ], - "output_tensors": [ - { - "name": "logits" - } - ] - }, - "optim": { - - }, - "quant": { - "mode": "static", - "samples": 10, - "calibration_method": "minmax", - "weight_type": "uint8", - "activation_type": "uint16", - "per_channel": false, - "symmetric": false, - "weight_symmetric": null, - "activation_symmetric": null, - "save_calibration": false, - "distribution": "uniform", - "seed": null, - "calibration_load_path": null, - "calibration_save_path": null, - "op_types_to_quantize": null, - "nodes_to_exclude": null, - "task": "text-classification", - "model_id": "typeform/distilbert-base-uncased-mnli", - "model_type": "distilbert" - }, - "compile": null, - "loader": { - "task": "text-classification", - "model_class": "AutoModelForSequenceClassification", - "model_type": "distilbert" - }, - "eval": { - "task": "text-classification", - "dataset": { - "path": "nyu-mll/glue", - "name": "mnli", - "split": "validation_matched", - "samples": 1000, - "columns_mapping": { - "input_column": "premise", - "second_input_column": "hypothesis" - } - } - } -}