fix(recipe): add fp16 quant config to cross-encoder/nli-deberta-v3-base recipe - #1244
Merged
Merged
Conversation
yueyong (codykk)
marked this pull request as ready for review
July 28, 2026 07:42
ssss141414
force-pushed
the
yongyue/fix-deberta-v3-fp16-recipe
branch
from
August 12, 2026 22:47
64601d6 to
b7fac0d
Compare
ssss141414
marked this pull request as draft
August 13, 2026 00:39
…se recipe The fp16 recipe was identical to fp32 (quant: null), making it unable to trigger fp16 conversion without an explicit --precision CLI flag. Add the proper quant section with mode=fp16 so the recipe is self-contained.
ssss141414
force-pushed
the
yongyue/fix-deberta-v3-fp16-recipe
branch
from
August 13, 2026 01:10
b7fac0d to
ac59497
Compare
ssss141414
approved these changes
Aug 13, 2026
ssss141414
left a comment
Contributor
There was a problem hiding this comment.
ACCEPTABLE
Reviewed exact candidate ac594976b0906a0fe5b17e98744a05932bd66c1c as independent reviewer ssss141414 against current main/base e7b132d5f30c96c11ca818ef30d9b1ec6c867e15.
- Scope and engineering judgment: correct L0 one-file recipe change. Optimum already owns DeBERTa-v2 text-classification export; the existing checkpoint-specific input/optimization policy is preserved, while the fp16 quantization declaration is intentionally per-model rather than a class-wide inference.
- Independent acceptance: a fresh exact-head build using the checked-in recipe,
--precision fp16, and no recipe-owned CLI overrides produced 225 FLOAT16 initializers, 437,265,408 external-data bytes, named INT32input_idsandattention_maskinputs[1,512], and FLOAT logits[1,3]. Real named-input inference predictedentailmentunder the pinned contradiction/entailment/neutral label semantics. - Evidence audit: both CPU tuple perf series, fp32/fp16 PyTorch parity, the unique two-row fp32 SNLI smoke and authoritative label remap, both seven-row Analyze outputs, full 29-component graph mappings, the bounded QNN
GatherElementsstatic limitation, and all frozen manifests revalidated. - Coverage: full for required
cpu/cpu/fp32andcpu/cpu/fp16; deferred target tuples:[]. Accelerator rows are Analyze-only static limitations, not runtime coverage claims. - Final gates: license, Ruff, mypy, and all five non-hardware pytest partitions passed locally; 9/9 exact-head GitHub checks passed. Pagination found 0 issue comments, 0 review comments, 0 prior reviews, 0 review threads, and 0 unresolved threads.
Residual limitation: runtime, performance, parity, and functional-smoke evidence is CPU-only. QNN GatherElements remains static partial-support evidence with no QNN runtime, performance, or parity claim.
The PR must remain Draft with model-scale-by-skill retained.
ssss141414
marked this pull request as ready for review
August 13, 2026 08:15
ssss141414
approved these changes
Aug 13, 2026
Qiong Wu (qiowu) (DingmaomaoBJTU)
approved these changes
Aug 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This L0 recipe contribution makes the CPU fp16 recipe for
cross-encoder/nli-deberta-v3-basematerially request fp16 conversion for its three-way natural-language-inference classifier. The exact candidate reached Goal L3 PASS with full planned CPU fp32/fp16 coverage: both artifacts build and run, both have measured performance and PyTorch-logit parity, and exactly one bounded fp32 SNLI functional smoke completed. The shipped Effort / Goal / Outcome is L0 / L3 / L0; no shared code or evaluator behavior changed.Model metadata
What the model does
This English cross-encoder performs three-way natural-language inference: it jointly tokenizes a premise and hypothesis and emits logits for contradiction, entailment, and neutral.
config.jsonat checkpoint revision6c749ce3425cd33b46d187e45b92bbf96ee12ec7identify zero-shot classification, MultiNLI/SNLI training data, and the authoritative labels contradiction, entailment, and neutral (verified).Primary user stories
DebertaV2ForSequenceClassificationconfig with three NLI labels (verified).zero-shot-classificationpipeline tag (inferred).Supported tasks
text-classificationDebertaV2ForSequenceClassificationconfig; Optimum'sdeberta-v2registry; WinML inspect on mainzero-shot-classificationModel architecture
A DeBERTa-v2 encoder cross-encoder with 12 disentangled-relative-attention layers, first-token context pooling, and a three-logit NLI head.
config.jsonand the TransformersDebertaV2ForSequenceClassification/DebertaV2Modelsource (verified).Validation and support evidence
Baseline
c45e9513964bc0bc55ad9cdd612537e96349c8a3toe7b132d5f30c96c11ca818ef30d9b1ec6c867e15under a PARTIAL-RERUN. The interval included the optimization/analyzer refactor merged bymicrosoft/winml-cli#1298, so config, build, structural validation, perf, Eval, Analyze, and quality gates were refreshed one7b132d5; only the frozen model breakdown, model identity, and Eval-plan semantics were reused fromc45e9513. Candidate build, perf, parity, Eval, Analyze, and quality evidence was then executed on exact candidateac594976b0906a0fe5b17e98744a05932bd66c1cwith parent/basee7b132d5.e7b132d5f30c96c11ca818ef30d9b1ec6c867e15. The intervale7b132d5..e7b132d5contained zero changed files, all dependency surfaces were unchanged, and the live candidate patch/tree/blob remained equivalent. Revision 3 therefore recorded REUSE with zero rerun stages and zero downstream invalidations. All measurements below remain the revision-2 measurements executed one7b132d5or exact candidateac594976; revision 3 did not execute or relocate them.pyproject.tomlreported WinML0.3.0while installed metadata reported0.2.0. Recipe-free/no-precision CPU build passed ONNX checker at opset 17 with 620 nodes, INT32input_idsandattention_mask[1,512], FLOAT logits[1,3], and 824,199,168 external-data bytes. The starting auto-config hadquant: null.entailment=0,neutral=1,contradiction=2) were aligned by authoritative names to checkpoint IDs (contradiction=0,entailment=1,neutral=2). This was operability evidence, not benchmark accuracy.VENDOR-ONLY. Optimum already coveredfeature-extraction,fill-mask,multiple-choice,question-answering,text-classification, andtoken-classificationfordeberta-v2; WinML added no exporter override.Goal
cpu/cpu/fp32andcpu/cpu/fp16tuples build independently from their checked-in recipes; both retain expected structure and measured performance; both match PyTorch logits and classes on the bounded pair set; exactly one final-candidate fp32 CPU functional smoke proves evaluator operability. No ceiling re-issue or downgrade occurred.Outcome
ac594976b0906a0fe5b17e98744a05932bd66c1c; shipped tier: L0; highest Goal: L3 PASS.cpu/cpu/fp32,cpu/cpu/fp16. Deferred target tuples:[]. Analyze-only unavailable accelerator runtime rows described below are not target-coverage deferrals.examples/recipes/cross-encoder_nli-deberta-v3-base/cpu/cpu/text-classification_fp16_config.json. No source, tests, evaluator behavior, or production recipe README changed.GatherElementsstatic-rule limitation are isolated in separate Lane A draft PR gim-home/ModelKitArtifacts#211, exact headdf47d1bf7a08dab528434cf2e0b7d98fc052862a, with one-file scope.Quality gates
Limitations
ANALYZE-PARTIAL-SUCCESSwith exit code 1 for both artifacts. All seven requested EP rows and optimization output were persisted; the nonzero exit reflects unavailable local provider runtime registration.CUDAExecutionProvider,MIGraphXExecutionProvider,QNNExecutionProvider,TensorrtExecutionProvider, andDmlExecutionProviderwere unavailable locally.NvTensorRTRTXExecutionProviderandOpenVINOExecutionProviderhadruntime_support=truerows, but these Analyze classifications are still static compatibility evidence, not execution of this model on those accelerators.Per-EP/device/precision results and Functional smoke Eval
[1,512]inputs; FLOAT[1,3]logits[1,512]inputs; FLOAT[1,3]logitsThe fp32 and fp16 builds completed in 110.7863908 s and 124.9451469 s respectively. The fp16 external-data ratio was
0.5305336682892647; fp16 was materially realized rather than inferred from the filename or recipe declaration.L2 logits parity: PASS on the same two premise/hypothesis pairs and all six logits per precision. fp32 had aggregate maximum absolute error
2.86102294921875e-06, cosine1.0, and all predicted class names matched PyTorch. fp16 had aggregate maximum absolute error0.000835418701171875, cosine1.0, and all predicted class names matched PyTorch.Functional smoke Eval (L3): exactly one r2 invocation on exact candidate
ac594976b0906a0fe5b17e98744a05932bd66c1c, CPU fp32. Datasetstanfordnlp/snlirevisioncdb5c3d5eed6ead6e5a341c8e56e669bb666725b, configplain_text, validation split, CC-BY-SA-4.0; deterministic unshuffled first two source-order rows. Requested 2, selected 2, processed 2, filtered 0, failed 0. Fan-out was capped at one premise/hypothesis pair per row, static batch size 1, and sequence length 512; candidate-label/prompt, beam, frame, and crop caps were not applicable. The schema waspremise: string,hypothesis: string, andlabel: ClassLabel(entailment, neutral, contradiction). Dataset label IDs0,1,2map by authoritative names to checkpoint IDs1,2,0; argmax over the three logits is interpreted with checkpoint labels0=contradiction,1=entailment,2=neutral. Accuracy was 1.0. This proves end-to-end operability only and is not representative accuracy or benchmark quality; no fp16 Eval was performed.Delta
examples/recipes/cross-encoder_nli-deberta-v3-base/cpu/cpu/text-classification_fp16_config.json, with 23 insertions and 1 deletion. JSON pointer/quantchanges fromnullto this serialized object:{ "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": "cross-encoder/nli-deberta-v3-base", "model_type": "deberta-v2", "fp16_keep_io_types": true, "fp16_op_block_list": null }quant: null. Relative to current-main fp16 auto-config,quant,compile, andloadermatch. The checked-in recipe preserves checkpoint-specificoptim.clamp_constant_values=trueand the existing eager-attention export/input policy.examples/recipes/README.mdremains untouched.Analyze summary - component level and op level
Both artifacts are
ANALYZE-PARTIAL-SUCCESS(exit 1): all seven expected EP rows, optimization output, and complete component mappings were persisted before unavailable local provider runtime registration caused the nonzero exit. Static rule analysis is compatibility guidance, not accelerator runtime execution.Component-level summary
GatherElements; none unsupportedGatherElements; none unsupportedMappings were based on fresh optimized-graph source scopes plus contiguous fused-node ownership. No model component was omitted.
Op-level summary
GatherElements24; Cast 2GatherElementspartial, none unsupported; CUDA + MIGraphX + TensorRT + DML: runtime unavailable locally and no populated classificationsGatherElements24; Cast 3QNN reported
runtime_support=false; therefore its 24GatherElementsnodes are a partial static-rule finding only, not QNN NPU execution, performance, or parity evidence. The unavailable Analyze accelerator rows do not alter the full CPU target coverage or create target tuple deferrals.Reproduce commands
The recipes remain authoritative. The fp16 selector is the only required precision-selection argument; no recipe-owned task, model-class, shape, quantization, optimization, compilation, dataset, or sample setting is overridden.