From 23b8522077fe9f4cc541b286421c30ad3c186349 Mon Sep 17 00:00:00 2001 From: jinkun Date: Mon, 20 Jul 2026 18:51:52 +0800 Subject: [PATCH 1/3] recipe(koelectra): add NSMC text classification recipe --- examples/recipes/README.md | 3 +- .../text-classification_fp16_config.json | 57 ++++++++++++ .../text-classification_w8a16_config.json | 92 +++++++++++++++++++ 3 files changed, 151 insertions(+), 1 deletion(-) create mode 100644 examples/recipes/daekeun-ml_koelectra-small-v3-nsmc/text-classification_fp16_config.json create mode 100644 examples/recipes/daekeun-ml_koelectra-small-v3-nsmc/text-classification_w8a16_config.json diff --git a/examples/recipes/README.md b/examples/recipes/README.md index 1077e4f74..90157e3f9 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 | |---|---| @@ -38,6 +38,7 @@ 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 | +| daekeun-ml/koelectra-small-v3-nsmc | 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/daekeun-ml_koelectra-small-v3-nsmc/text-classification_fp16_config.json b/examples/recipes/daekeun-ml_koelectra-small-v3-nsmc/text-classification_fp16_config.json new file mode 100644 index 000000000..0c4a9ed1a --- /dev/null +++ b/examples/recipes/daekeun-ml_koelectra-small-v3-nsmc/text-classification_fp16_config.json @@ -0,0 +1,57 @@ +{ + "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, 35000] + }, + { + "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": "electra" + }, + "eval": { + "task": "text-classification", + "dataset": { + "path": "nsmc", + "split": "test", + "samples": 100, + "columns_mapping": { + "input_column": "document" + } + } + } +} diff --git a/examples/recipes/daekeun-ml_koelectra-small-v3-nsmc/text-classification_w8a16_config.json b/examples/recipes/daekeun-ml_koelectra-small-v3-nsmc/text-classification_w8a16_config.json new file mode 100644 index 000000000..4b07f322c --- /dev/null +++ b/examples/recipes/daekeun-ml_koelectra-small-v3-nsmc/text-classification_w8a16_config.json @@ -0,0 +1,92 @@ +{ + "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, + 35000 + ] + }, + { + "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": "qdq", + "samples": 10, + "calibration_method": "minmax", + "weight_type": "uint8", + "activation_type": "uint16", + "per_channel": false, + "symmetric": false, + "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": "daekeun-ml/koelectra-small-v3-nsmc" + }, + "compile": null, + "loader": { + "task": "text-classification", + "model_class": "AutoModelForSequenceClassification", + "model_type": "electra" + }, + "eval": { + "task": "text-classification", + "dataset": { + "path": "nsmc", + "split": "test", + "samples": 1000, + "columns_mapping": { + "input_column": "document" + } + } + } +} From 5936d38cc7fbf63d42c5ddb8bce2efd24cf2561e Mon Sep 17 00:00:00 2001 From: Shiyi Zheng Date: Wed, 22 Jul 2026 21:05:33 +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 90157e3f9..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 | |---|---| @@ -38,7 +38,6 @@ Total: **76** (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 | -| daekeun-ml/koelectra-small-v3-nsmc | 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 | From a7ed837aa1d20a946eb67fd5fe0660e6710513c3 Mon Sep 17 00:00:00 2001 From: "Shiyi Zheng (from Dev Box)" Date: Wed, 22 Jul 2026 23:21:35 +0800 Subject: [PATCH 3/3] fix(recipes): repair KoELECTRA CPU coverage --- .../cpu/text-classification_fp16_config.json} | 23 +++++++---- .../cpu/text-classification_fp32_config.json} | 41 +++++++++++++++---- 2 files changed, 49 insertions(+), 15 deletions(-) rename examples/recipes/daekeun-ml_koelectra-small-v3-nsmc/{text-classification_w8a16_config.json => cpu/cpu/text-classification_fp16_config.json} (79%) rename examples/recipes/daekeun-ml_koelectra-small-v3-nsmc/{text-classification_fp16_config.json => cpu/cpu/text-classification_fp32_config.json} (62%) diff --git a/examples/recipes/daekeun-ml_koelectra-small-v3-nsmc/text-classification_w8a16_config.json b/examples/recipes/daekeun-ml_koelectra-small-v3-nsmc/cpu/cpu/text-classification_fp16_config.json similarity index 79% rename from examples/recipes/daekeun-ml_koelectra-small-v3-nsmc/text-classification_w8a16_config.json rename to examples/recipes/daekeun-ml_koelectra-small-v3-nsmc/cpu/cpu/text-classification_fp16_config.json index 4b07f322c..1904a6746 100644 --- a/examples/recipes/daekeun-ml_koelectra-small-v3-nsmc/text-classification_w8a16_config.json +++ b/examples/recipes/daekeun-ml_koelectra-small-v3-nsmc/cpu/cpu/text-classification_fp16_config.json @@ -55,13 +55,15 @@ }, "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, @@ -69,8 +71,8 @@ "calibration_save_path": null, "op_types_to_quantize": null, "nodes_to_exclude": null, - "task": "text-classification", - "model_id": "daekeun-ml/koelectra-small-v3-nsmc" + "fp16_keep_io_types": true, + "fp16_op_block_list": null }, "compile": null, "loader": { @@ -81,12 +83,19 @@ "eval": { "task": "text-classification", "dataset": { - "path": "nsmc", + "path": "e9t/nsmc", "split": "test", - "samples": 1000, + "samples": 100, + "shuffle": false, + "streaming": true, + "revision": "153263700c285ac0997b3e2a2d80b826aaf672d6", "columns_mapping": { "input_column": "document" + }, + "label_mapping": { + "negative": 0, + "positive": 1 } } } -} +} \ No newline at end of file diff --git a/examples/recipes/daekeun-ml_koelectra-small-v3-nsmc/text-classification_fp16_config.json b/examples/recipes/daekeun-ml_koelectra-small-v3-nsmc/cpu/cpu/text-classification_fp32_config.json similarity index 62% rename from examples/recipes/daekeun-ml_koelectra-small-v3-nsmc/text-classification_fp16_config.json rename to examples/recipes/daekeun-ml_koelectra-small-v3-nsmc/cpu/cpu/text-classification_fp32_config.json index 0c4a9ed1a..bcb1f07e3 100644 --- a/examples/recipes/daekeun-ml_koelectra-small-v3-nsmc/text-classification_fp16_config.json +++ b/examples/recipes/daekeun-ml_koelectra-small-v3-nsmc/cpu/cpu/text-classification_fp32_config.json @@ -13,20 +13,38 @@ { "name": "input_ids", "dtype": "int32", - "shape": [1, 512], - "value_range": [0, 35000] + "shape": [ + 1, + 512 + ], + "value_range": [ + 0, + 35000 + ] }, { "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": [ @@ -46,12 +64,19 @@ "eval": { "task": "text-classification", "dataset": { - "path": "nsmc", + "path": "e9t/nsmc", "split": "test", "samples": 100, + "shuffle": false, + "streaming": true, + "revision": "153263700c285ac0997b3e2a2d80b826aaf672d6", "columns_mapping": { "input_column": "document" + }, + "label_mapping": { + "negative": 0, + "positive": 1 } } } -} +} \ No newline at end of file