diff --git a/examples/recipes/README.md b/examples/recipes/README.md index 86aa01869..1077e4f74 100644 --- a/examples/recipes/README.md +++ b/examples/recipes/README.md @@ -38,7 +38,6 @@ Total: **75** (model, task) tuples that pass fp16 eval on all 10 (EP, device) bu | ahotrod/electra_large_discriminator_squad2_512 | question-answering | | apple/mobilevit-small | image-classification | | cardiffnlp/twitter-roberta-base-sentiment-latest | text-classification | -| cross-encoder/ms-marco-MiniLM-L6-v2 | text-classification | | dbmdz/bert-large-cased-finetuned-conll03-english | token-classification | | deepset/bert-large-uncased-whole-word-masking-squad2 | question-answering | | deepset/roberta-base-squad2 | question-answering | diff --git a/examples/recipes/cross-encoder_ms-marco-MiniLM-L6-v2/text-classification_w8a16_config.json b/examples/recipes/cross-encoder_ms-marco-MiniLM-L6-v2/cpu/cpu/text-classification_fp16_config.json similarity index 67% rename from examples/recipes/cross-encoder_ms-marco-MiniLM-L6-v2/text-classification_w8a16_config.json rename to examples/recipes/cross-encoder_ms-marco-MiniLM-L6-v2/cpu/cpu/text-classification_fp16_config.json index ce3a2f09e..ca353cc30 100644 --- a/examples/recipes/cross-encoder_ms-marco-MiniLM-L6-v2/text-classification_w8a16_config.json +++ b/examples/recipes/cross-encoder_ms-marco-MiniLM-L6-v2/cpu/cpu/text-classification_fp16_config.json @@ -13,38 +13,20 @@ { "name": "input_ids", "dtype": "int32", - "shape": [ - 1, - 512 - ], - "value_range": [ - 0, - 30522 - ] + "shape": [1, 512], + "value_range": [0, 30522] }, { "name": "attention_mask", "dtype": "int32", - "shape": [ - 1, - 512 - ], - "value_range": [ - 0, - 2 - ] + "shape": [1, 512], + "value_range": [0, 2] }, { "name": "token_type_ids", "dtype": "int32", - "shape": [ - 1, - 512 - ], - "value_range": [ - 0, - 2 - ] + "shape": [1, 512], + "value_range": [0, 2] } ], "output_tensors": [ @@ -53,17 +35,17 @@ } ] }, - "optim": { - "clamp_constant_values": true - }, + "optim": {}, "quant": { - "mode": "qdq", + "mode": "fp16", "samples": 10, "calibration_method": "minmax", "weight_type": "uint8", - "activation_type": "uint16", + "activation_type": "uint8", "per_channel": false, "symmetric": false, + "weight_symmetric": null, + "activation_symmetric": null, "save_calibration": false, "distribution": "uniform", "seed": null, @@ -71,8 +53,8 @@ "calibration_save_path": null, "op_types_to_quantize": null, "nodes_to_exclude": null, - "task": "text-classification", - "model_id": "cross-encoder/ms-marco-MiniLM-L6-v2" + "fp16_keep_io_types": true, + "fp16_op_block_list": null }, "compile": null, "loader": { diff --git a/examples/recipes/cross-encoder_ms-marco-MiniLM-L6-v2/text-classification_fp16_config.json b/examples/recipes/cross-encoder_ms-marco-MiniLM-L6-v2/cpu/cpu/text-classification_fp32_config.json similarity index 65% rename from examples/recipes/cross-encoder_ms-marco-MiniLM-L6-v2/text-classification_fp16_config.json rename to examples/recipes/cross-encoder_ms-marco-MiniLM-L6-v2/cpu/cpu/text-classification_fp32_config.json index b8612e5ac..eb9f77384 100644 --- a/examples/recipes/cross-encoder_ms-marco-MiniLM-L6-v2/text-classification_fp16_config.json +++ b/examples/recipes/cross-encoder_ms-marco-MiniLM-L6-v2/cpu/cpu/text-classification_fp32_config.json @@ -13,38 +13,20 @@ { "name": "input_ids", "dtype": "int32", - "shape": [ - 1, - 512 - ], - "value_range": [ - 0, - 30522 - ] + "shape": [1, 512], + "value_range": [0, 30522] }, { "name": "attention_mask", "dtype": "int32", - "shape": [ - 1, - 512 - ], - "value_range": [ - 0, - 2 - ] + "shape": [1, 512], + "value_range": [0, 2] }, { "name": "token_type_ids", "dtype": "int32", - "shape": [ - 1, - 512 - ], - "value_range": [ - 0, - 2 - ] + "shape": [1, 512], + "value_range": [0, 2] } ], "output_tensors": [ @@ -53,9 +35,7 @@ } ] }, - "optim": { - "clamp_constant_values": true - }, + "optim": {}, "quant": null, "compile": null, "loader": { diff --git a/examples/recipes/cross-encoder_ms-marco-MiniLM-L6-v2/dml/gpu/text-classification_fp16_config.json b/examples/recipes/cross-encoder_ms-marco-MiniLM-L6-v2/dml/gpu/text-classification_fp16_config.json new file mode 100644 index 000000000..ca353cc30 --- /dev/null +++ b/examples/recipes/cross-encoder_ms-marco-MiniLM-L6-v2/dml/gpu/text-classification_fp16_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] + }, + { + "name": "token_type_ids", + "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, + "fp16_keep_io_types": true, + "fp16_op_block_list": null + }, + "compile": null, + "loader": { + "task": "text-classification", + "model_class": "AutoModelForSequenceClassification", + "model_type": "bert" + } +} diff --git a/examples/recipes/cross-encoder_ms-marco-MiniLM-L6-v2/dml/gpu/text-classification_fp32_config.json b/examples/recipes/cross-encoder_ms-marco-MiniLM-L6-v2/dml/gpu/text-classification_fp32_config.json new file mode 100644 index 000000000..eb9f77384 --- /dev/null +++ b/examples/recipes/cross-encoder_ms-marco-MiniLM-L6-v2/dml/gpu/text-classification_fp32_config.json @@ -0,0 +1,46 @@ +{ + "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] + }, + { + "name": "token_type_ids", + "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": "bert" + } +}