microsoft / microsoft/winml-cli
Add exact FP16 node exclusions and bounded strict-type validation
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 40
- Forks
- 11
- Avg merge
- 1d 8h
- Merged PRs (30d)
- 50
Description
Feature gap
ONNX Runtime exposes exact node_block_list support for FP16 conversion, but WinML needs shared, opt-in plumbing for graph-derived node names and a bounded strict-type validation gate.
Required shared contract
- Add optional
WinMLQuantizationConfig.fp16_nodes_to_exclude: list[str] | Nonewith stable declaration-order de-duplication and non-empty-string validation. - Serialize the field only for FP16 mode and include distinct non-empty lists in cache identity; omitted and null preserve existing behavior.
- Forward the list unchanged through
FP16Pass.runas ORTnode_block_list. - Forward the same list in both normal and
disable_shape_infer=Trueconvert_to_fp16calls. - Before conversion, run checker, strict shape/type inference, and checker on an isolated input model. If that succeeds, require the identical sequence on the converted model and raise
RuntimeError('FP16 conversion produced incompatible FP16 types.')on failure. - Only
AttributeError,google.protobuf.message.EncodeError,checker.ValidationError, andshape_inference.InferenceErrorfrom the input capability preflight may skip the generic converted-model strict sequence. Existing specialized safeguards remain mandatory.
Exact graph-derived boundary names
The recipe must use exactly these 74 ONNX node.name values, in this order, as fp16_nodes_to_exclude:
InsertedPrecisionFreeCast_/deberta/embeddings/LayerNorm/LayerNormalization_output_0InsertedPrecisionFreeCast_/deberta/encoder/layer.0/attention/self/Transpose_3_output_0InsertedPrecisionFreeCast_/deberta/encoder/layer.0/attention/self/Reshape_1_output_0InsertedPrecisionFreeCast_/deberta/encoder/layer.0/attention/self/Reshape_3_output_0InsertedPrecisionFreeCast_/deberta/encoder/layer.0/attention/self/Transpose_8_output_0InsertedPrecisionFreeCast_/deberta/encoder/layer.0/attention/self/Reshape_5_output_0InsertedPrecisionFreeCast_/deberta/encoder/layer.0/attention/self/Reshape_13_output_0InsertedPrecisionFreeCast_/deberta/encoder/layer.1/attention/self/Transpose_3_output_0InsertedPrecisionFreeCast_/deberta/encoder/layer.1/attention/self/Reshape_1_output_0InsertedPrecisionFreeCast_/deberta/encoder/layer.1/attention/self/Reshape_3_output_0InsertedPrecisionFreeCast_/deberta/encoder/layer.1/attention/self/Transpose_8_output_0InsertedPrecisionFreeCast_/deberta/encoder/layer.1/attention/self/Reshape_5_output_0InsertedPrecisionFreeCast_/deberta/encoder/layer.1/attention/self/Reshape_13_output_0InsertedPrecisionFreeCast_/deberta/encoder/layer.2/attention/self/Transpose_3_output_0InsertedPrecisionFreeCast_/deberta/encoder/layer.2/attention/self/Reshape_1_output_0InsertedPrecisionFreeCast_/deberta/encoder/layer.2/attention/self/Reshape_3_output_0InsertedPrecisionFreeCast_/deberta/encoder/layer.2/attention/self/Transpose_8_output_0InsertedPrecisionFreeCast_/deberta/encoder/layer.2/attention/self/Reshape_5_output_0InsertedPrecisionFreeCast_/deberta/encoder/layer.2/attention/self/Reshape_13_output_0InsertedPrecisionFreeCast_/deberta/encoder/layer.3/attention/self/Transpose_3_output_0InsertedPrecisionFreeCast_/deberta/encoder/layer.3/attention/self/Reshape_1_output_0InsertedPrecisionFreeCast_/deberta/encoder/layer.3/attention/self/Reshape_3_output_0InsertedPrecisionFreeCast_/deberta/encoder/layer.3/attention/self/Transpose_8_output_0InsertedPrecisionFreeCast_/deberta/encoder/layer.3/attention/self/Reshape_5_output_0InsertedPrecisionFreeCast_/deberta/encoder/layer.3/attention/self/Reshape_13_output_0InsertedPrecisionFreeCast_/deberta/encoder/layer.4/attention/self/Transpose_3_output_0InsertedPrecisionFreeCast_/deberta/encoder/layer.4/attention/self/Reshape_1_output_0InsertedPrecisionFreeCast_/deberta/encoder/layer.4/attention/self/Reshape_3_output_0InsertedPrecisionFreeCast_/deberta/encoder/layer.4/attention/self/Transpose_8_output_0InsertedPrecisionFreeCast_/deberta/encoder/layer.4/attention/self/Reshape_5_output_0InsertedPrecisionFreeCast_/deberta/encoder/layer.4/attention/self/Reshape_13_output_0InsertedPrecisionFreeCast_/deberta/encoder/layer.5/attention/self/Transpose_3_output_0InsertedPrecisionFreeCast_/deberta/encoder/layer.5/attention/self/Reshape_1_output_0InsertedPrecisionFreeCast_/deberta/encoder/layer.5/attention/self/Reshape_3_output_0InsertedPrecisionFreeCast_/deberta/encoder/layer.5/attention/self/Transpose_8_output_0InsertedPrecisionFreeCast_/deberta/encoder/layer.5/attention/self/Reshape_5_output_0InsertedPrecisionFreeCast_/deberta/encoder/layer.5/attention/self/Reshape_13_output_0InsertedPrecisionFreeCast_/deberta/encoder/layer.6/attention/self/Transpose_3_output_0InsertedPrecisionFreeCast_/deberta/encoder/layer.6/attention/self/Reshape_1_output_0InsertedPrecisionFreeCast_/deberta/encoder/layer.6/attention/self/Reshape_3_output_0InsertedPrecisionFreeCast_/deberta/encoder/layer.6/attention/self/Transpose_8_output_0InsertedPrecisionFreeCast_/deberta/encoder/layer.6/attention/self/Reshape_5_output_0InsertedPrecisionFreeCast_/deberta/encoder/layer.6/attention/self/Reshape_13_output_0InsertedPrecisionFreeCast_/deberta/encoder/layer.7/attention/self/Transpose_3_output_0InsertedPrecisionFreeCast_/deberta/encoder/layer.7/attention/self/Reshape_1_output_0InsertedPrecisionFreeCast_/deberta/encoder/layer.7/attention/self/Reshape_3_output_0InsertedPrecisionFreeCast_/deberta/encoder/layer.7/attention/self/Transpose_8_output_0InsertedPrecisionFreeCast_/deberta/encoder/layer.7/attention/self/Reshape_5_output_0InsertedPrecisionFreeCast_/deberta/encoder/layer.7/attention/self/Reshape_13_output_0InsertedPrecisionFreeCast_/deberta/encoder/layer.8/attention/self/Transpose_3_output_0InsertedPrecisionFreeCast_/deberta/encoder/layer.8/attention/self/Reshape_1_output_0InsertedPrecisionFreeCast_/deberta/encoder/layer.8/attention/self/Reshape_3_output_0InsertedPrecisionFreeCast_/deberta/encoder/layer.8/attention/self/Transpose_8_output_0InsertedPrecisionFreeCast_/deberta/encoder/layer.8/attention/self/Reshape_5_output_0InsertedPrecisionFreeCast_/deberta/encoder/layer.8/attention/self/Reshape_13_output_0InsertedPrecisionFreeCast_/deberta/encoder/layer.9/attention/self/Transpose_3_output_0InsertedPrecisionFreeCast_/deberta/encoder/layer.9/attention/self/Reshape_1_output_0InsertedPrecisionFreeCast_/deberta/encoder/layer.9/attention/self/Reshape_3_output_0InsertedPrecisionFreeCast_/deberta/encoder/layer.9/attention/self/Transpose_8_output_0InsertedPrecisionFreeCast_/deberta/encoder/layer.9/attention/self/Reshape_5_output_0InsertedPrecisionFreeCast_/deberta/encoder/layer.9/attention/self/Reshape_13_output_0InsertedPrecisionFreeCast_/deberta/encoder/layer.10/attention/self/Transpose_3_output_0InsertedPrecisionFreeCast_/deberta/encoder/layer.10/attention/self/Reshape_1_output_0InsertedPrecisionFreeCast_/deberta/encoder/layer.10/attention/self/Reshape_3_output_0InsertedPrecisionFreeCast_/deberta/encoder/layer.10/attention/self/Transpose_8_output_0InsertedPrecisionFreeCast_/deberta/encoder/layer.10/attention/self/Reshape_5_output_0InsertedPrecisionFreeCast_/deberta/encoder/layer.10/attention/self/Reshape_13_output_0InsertedPrecisionFreeCast_/deberta/encoder/layer.11/attention/self/Transpose_3_output_0InsertedPrecisionFreeCast_/deberta/encoder/layer.11/attention/self/Reshape_1_output_0InsertedPrecisionFreeCast_/deberta/encoder/layer.11/attention/self/Reshape_3_output_0InsertedPrecisionFreeCast_/deberta/encoder/layer.11/attention/self/Transpose_8_output_0InsertedPrecisionFreeCast_/deberta/encoder/layer.11/attention/self/Reshape_5_output_0InsertedPrecisionFreeCast_/deberta/encoder/layer.11/attention/self/Reshape_13_output_0InsertedPrecisionFreeCast_/pooler/Gather_output_0
InsertedPrecisionFreeCast_/deberta/embeddings/Cast_output_0 is deliberately absent because it is INT32-to-FLOAT, not FP16-to-FLOAT, and must convert to INT32-to-FLOAT16 under ordinary semantics.
Acceptance and evidence
- Exact-name tests prove all 74 names are unique and ordered, exist once in the fresh optimized graph, remain FLOAT boundaries in FP16, and the excluded embeddings Cast converts normally.
- Config/pass/converter tests cover absent, null, non-empty, duplicate, invalid, serialization, cache, normal/fallback forwarding, unknown-name, strict-capability, and specialized-regression behavior.
- Fresh quality evidence
producer-v3-quality-20260824T130316Z-7e682b5eis PASS: 152 focused converter tests, 426 focused config/pass tests, 1 focused recipe test, and 858 affected optimization tests passed (16 skipped, 1 xfailed), with format, lint, type, diff, and license gates complete. - Fresh build attempt
producer-v3-artifacts-20260824T130610Z-971c84ddrecorded a validation-script failure and was recovered idempotently byproducer-v3-artifacts-20260824T131754Z-0d34abcb, whose model validation and artifact completion are PASS with 74 selected Casts and bounded CPU FP16 performance evidence.
Explicitly prohibited
No broad Cast op blocking, prefix/wildcard/substring matching, automatic graph heuristics, runtime synthesis or fallback exclusions, model/checkpoint conditionals, arbitrary exception catch, or suppression of specialized validation safeguards.
Planning reference: sealed planner-charter.v4.json; authorized base 3708969b731425b0c6d4b97920d1b5e6519bb013; dependency #1322. Invalid candidate 4cc9e8ee56848ffea02642294b27647e3eaeadb0 is not reusable.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with WinMLQuantizationConfig, FP16Pass.run, convert_to_fp16, and the graph-derived recipe entry point. Run the existing config, pass, converter, and recipe tests before tracing normal and fallback conversion paths. Done means the 74 ordered exclusions, validation gates, serialization, cache behavior, forwarding, and regression tests all satisfy the stated acceptance criteria.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- machine-learning, tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 32/100