From bc7377782d96a4788e565ff3acf0a6c2f06ae56d Mon Sep 17 00:00:00 2001 From: Shiyi Zheng Date: Mon, 24 Aug 2026 01:08:00 +0800 Subject: [PATCH] Add mMARCO MiniLMv2 reranking recipes --- .../cpu/cpu/reranking_fp16_config.json | 94 +++++++++++++++++++ .../cpu/cpu/reranking_fp32_config.json | 72 ++++++++++++++ 2 files changed, 166 insertions(+) create mode 100644 examples/recipes/cross-encoder_mmarco-mMiniLMv2-L12-H384-v1/cpu/cpu/reranking_fp16_config.json create mode 100644 examples/recipes/cross-encoder_mmarco-mMiniLMv2-L12-H384-v1/cpu/cpu/reranking_fp32_config.json diff --git a/examples/recipes/cross-encoder_mmarco-mMiniLMv2-L12-H384-v1/cpu/cpu/reranking_fp16_config.json b/examples/recipes/cross-encoder_mmarco-mMiniLMv2-L12-H384-v1/cpu/cpu/reranking_fp16_config.json new file mode 100644 index 000000000..7250400c6 --- /dev/null +++ b/examples/recipes/cross-encoder_mmarco-mMiniLMv2-L12-H384-v1/cpu/cpu/reranking_fp16_config.json @@ -0,0 +1,94 @@ +{ + "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, + 250002 + ] + }, + { + "name": "attention_mask", + "dtype": "int32", + "shape": [ + 1, + 512 + ], + "value_range": [ + 0, + 2 + ] + } + ], + "output_tensors": [ + { + "name": "logits" + } + ] + }, + "optim": { + "clamp_constant_values": true + }, + "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": "reranking", + "model_id": "cross-encoder/mmarco-mMiniLMv2-L12-H384-v1", + "model_type": "xlm-roberta", + "fp16_keep_io_types": true, + "fp16_op_block_list": null + }, + "compile": null, + "loader": { + "task": "reranking", + "model_class": "AutoModelForSequenceClassification", + "model_type": "xlm-roberta" + }, + "eval": { + "task": "reranking", + "dataset": { + "path": "C-MTEB/Mmarco-reranking", + "name": "default", + "split": "dev", + "samples": 2, + "shuffle": false, + "streaming": true, + "revision": "8e0c766dbe9e16e1d221116a3f36795fbade07f6", + "columns_mapping": { + "query_column": "query", + "positive_column": "positive", + "negative_column": "negative", + "max_candidates": "10" + } + } + } +} \ No newline at end of file diff --git a/examples/recipes/cross-encoder_mmarco-mMiniLMv2-L12-H384-v1/cpu/cpu/reranking_fp32_config.json b/examples/recipes/cross-encoder_mmarco-mMiniLMv2-L12-H384-v1/cpu/cpu/reranking_fp32_config.json new file mode 100644 index 000000000..e76cb5e0e --- /dev/null +++ b/examples/recipes/cross-encoder_mmarco-mMiniLMv2-L12-H384-v1/cpu/cpu/reranking_fp32_config.json @@ -0,0 +1,72 @@ +{ + "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, + 250002 + ] + }, + { + "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": "reranking", + "model_class": "AutoModelForSequenceClassification", + "model_type": "xlm-roberta" + }, + "eval": { + "task": "reranking", + "dataset": { + "path": "C-MTEB/Mmarco-reranking", + "name": "default", + "split": "dev", + "samples": 2, + "shuffle": false, + "streaming": true, + "revision": "8e0c766dbe9e16e1d221116a3f36795fbade07f6", + "columns_mapping": { + "query_column": "query", + "positive_column": "positive", + "negative_column": "negative", + "max_candidates": "10" + } + } + } +} \ No newline at end of file