recipe(koelectra): add NSMC text classification recipe#1144
Conversation
|
Reviewer verdict: APPROVE fallback comment / Lane B model PR is ready for maintainer review. Checked items:
Open process note:
I attempted |
|
Supersedes the earlier fallback comment at #1144 (comment) for the repaired exact head The live PR body now reflects the frozen charter/producer/tester/learner handoffs: nested CPU fp32/fp16 recipes only, Goal L3 evidence, current-main baseline, pinned NSMC mapping/accuracy, and component/op analysis. The earlier README, flat-path, w8a16, L1-ceiling, WINML-ONLY, and knowledge-append statements describe a superseded head and are not current claims. This is an explainer correction, not an approval or reviewer verdict. The original @kujin66 contribution and commit history remain credited. Per current shipment policy, the PR is Draft and retains |
Summary
This recipe-only L0 contribution adds verified CPU recipes for
daekeun-ml/koelectra-small-v3-nsmc, a Korean NSMC binary sentiment classifier, at fp32 and fp16. At exact PR heada7ed837aa1d20a946eb67fd5fe0660e6710513c3, both required tuples reach Goal L3 PASS: fresh build, concrete CPU perf, PyTorch parity, and pinned NSMC accuracy all pass. Currentmainalready builds, perfs, and evaluates the checkpoint recipe-free; the shipped value is reproducible, checkpoint-specific fp32/fp16 recipe coverage with a pinned evaluation contract rather than a new architecture implementation.Contributor history is preserved: @kujin66 authored the original contribution and first commit; @ssss141414 supplied the subsequent scope/evidence repairs. The PR intentionally makes no README publication or w8a16 support claim.
Model metadata
What the model does
This Korean text encoder classifies one movie-review document as negative or positive sentiment. Token IDs, an attention mask, and optional token-type IDs pass through a 12-layer ELECTRA encoder; a sequence-classification head reads the first-token representation and emits two logits.
config.json(ElectraForSequenceClassification, single-label classification, two labels), and Transformers 4.57.6ElectraForSequenceClassificationsource.Primary user stories
dataset:nsmcandpipeline_tag:text-classification.Supported tasks
text-classificationElectraForSequenceClassification; current-main Optimum and WinML inspectionThe current-main Optimum probe reports
VENDOR-ONLY: vendor and post-WinML task sets both contain feature extraction, fill-mask, multiple choice, question answering, text classification, and token classification; WinML adds no ELECTRA task registration.Model architecture
Validation and support evidence
Baseline
The superseding current-main baseline used commit
5deebd422e95f28fe8fd912ee50ce874710187b3andwinml, version 0.2.0.VENDOR-ONLY; WinML adds no ELECTRA task registration[1,512]inputs; FLOAT[1,2]logitstestsamples/evalcontract and/quantisnullThe executable evaluation source is
e9t/nsmcrevision153263700c285ac0997b3e2a2d80b826aaf672d6, the pinned official parquet conversion of source revisione8ac4f539e5604fec0b3c67ed040728e0862b5e1. The direct source revision is script-based and was rejected bydatasets; the pinned parquet revision preserves the authoritative NSMC schema in executable form. Explicit mapping aligns checkpoint labels0=Neg,1=Poswith dataset classesnegative=0,positive=1.Goal
Outcome
examples/recipes/daekeun-ml_koelectra-small-v3-nsmc/cpu/cpu/text-classification_fp32_config.jsonandexamples/recipes/daekeun-ml_koelectra-small-v3-nsmc/cpu/cpu/text-classification_fp16_config.json._meta-016,_meta-031,_meta-037,_meta-065,_meta-071, and_meta-083already cover the observed host/provenance methodology.examples/recipes/README.mdis untouched. The former flat fp16/w8a16 files are not shipped, and this PR claims no w8a16 coverage.Per-EP/device/precision results
Goal ladder
Build and perf
quant.mode=fp16The fp16 artifact is distinct and 0.5013285× the fp32 size. On this CPU host, fp16 is smaller but slower; no acceleration claim is made.
L2 PyTorch parity
Pinned checkpoint revision:
d1c0233fc013ae8bd879d7b61f2bec69aa3af4c9.L3 pinned NSMC accuracy
e9t/nsmc/153263700c285ac0997b3e2a2d80b826aaf672d6test; 100; unshuffled; streamingdocument;negative=0,positive=1e9t/nsmc/153263700c285ac0997b3e2a2d80b826aaf672d6test; 100; unshuffled; streamingdocument;negative=0,positive=1Mapping basis: checkpoint Neg/Pos
id2labelindices 0/1 align with authoritative NSMCClassLabelnegative/positive indices 0/1.Delta
Both files use the required nested CPU path. Relative to fresh current-main auto-config, loader/export/optimization/compilation settings are unchanged.
fp32
/eval: absent →{ "task": "text-classification", "dataset": { "path": "e9t/nsmc", "split": "test", "samples": 100, "shuffle": false, "streaming": true, "revision": "153263700c285ac0997b3e2a2d80b826aaf672d6", "columns_mapping": { "input_column": "document" }, "label_mapping": { "negative": 0, "positive": 1 } } }fp16
/quant:null→{ "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 }/eval: absent → the exact fp32 evaluation object above.The evaluation choice and label semantics are checkpoint-specific human intent, not derivable from ELECTRA architecture metadata, so a recipe is the consistent fix class. Recipe-free acceptance independently passes in 55.492 s and confirms there is no class-wide code defect. No code paths change, and the production recipe README remains untouched.
Analyze summary — component level and op level
Static rule analysis completed for both artifacts; this is compatibility analysis, not runtime execution. The fp16 analyzer returned exit 1 intentionally for partial operator support while still producing all 11 complete EP/device rows with
has_errors=false; this is not an analysis crash.Component-level summary
Op-level summary
Rule-less CUDA, MIGraphX, DML, CPU, and VitisAI rows classify all operator types as unknown. These static rows do not claim runtime execution on those EPs.
Quality caveats
CPUExecutionProviderexecution and exited 0 for fp32/fp16 perf and eval. This is host/plugin evidence, not a model verdict downgrade.Reproduce commands
PowerShell, from a fresh checkout. The first block pins the exact reviewed head and recreates the tested frozen environment; the remaining commands are the tester's portable public command set.