recipe(opus-mt-fr-en): add CPU fp32 and fp16 recipes#1115
Conversation
|
same question for all your prs: does the model work by default? Thanks |
66982ed to
2b2c13d
Compare
|
Thanks — yes, this model works by default on current The current-main I rebased onto current |
APPROVEIndependent post-PR review passed after the requested charter correction.
Approval does not change shipment state. PR #1115 must remain Draft. |
The fp16 pair differs at It means it is identical to the one with |
Summary
This recipe-only contribution adds reviewed CPU
fp32and genuinefp16coverage for theHelsinki-NLP/opus-mt-fr-enMarian French-to-English translation composite. The model does work by default on currentmain; thefp32recipes are semantically identical to current auto-config and thefp16recipes add an explicit, verified precision policy. Effort/Outcome are L0, the highest reached Goal is L2 PASS on the encoder, and L3 is CLI-BLOCKED becausewinml evaldoes not registertranslation.Model metadata
Model-breakdown:
temp/skill-run-1115/model-breakdown/opus-mt-fr-en.model-breakdown.json; SHA-2563c15048e55223ca7aab6121ca5acdf534b16bb2837a9cd099eb813aec8eaafd9; checkpoint revisionc4aed37b318c763fd177aa449b44e3b783cc6c02.What the model does
A text-to-text Marian encoder-decoder checkpoint that translates French input text into English output text. The encoder produces contextual hidden states and the autoregressive decoder produces vocabulary logits plus updated key/value cache tensors.
Evidence: Hugging Face model identity opus-mt-fr-en; winml inspect: pipeline_tasks=[translation], architectures=[MarianMTModel]; exported encoder and decoder graph interfaces. Confidence: verified.
Primary user stories
Supported tasks
translation— surfaces: checkpoint, transformers, winml; evidence: winml inspect pipeline_tasks; composite config generation; confidence: verified.text2text-generation— surfaces: transformers, optimum-onnx, winml; evidence: decoder task and Optimum Marian registry; confidence: verified.feature-extraction— surfaces: optimum-onnx, winml; evidence: encoder component task and build config; confidence: verified.These support surfaces describe model loading/export/inference routing. They do not imply task-metric coverage in
winml eval; the fresh L3 probe below confirms that its eval registry currently excludestranslation.Model architecture
A 6-layer Marian transformer encoder and 6-layer autoregressive Marian decoder, hidden width 512 with 8 attention heads. Each encoder layer contains self-attention and an MLP; each decoder layer contains self-attention, encoder cross-attention, an MLP, normalization/residual paths, and a KV-cache interface. Encoder and decoder export as separate ONNX graphs.
Components:
encoder,encoder.embeddings_input,encoder.layers[],encoder.layers[].self_attention,encoder.layers[].mlp,encoder.layers[].normalization_residual,decoder,decoder.embeddings_input,decoder.layers[],decoder.layers[].self_attention,decoder.layers[].cross_attention,decoder.layers[].mlp,decoder.layers[].normalization_residual,decoder.kv_cache,decoder.lm_head. Evidence: HTP traced module hierarchies; ONNX node scopes and graph interfaces; winml inspect io_config. Confidence: mapped.Validation and support evidence
1. Baseline
main:76d48ad38f894c3fc5a5e760de67f0a096e438a6; WinML0.2.0.winml build -m Helsinki-NLP/opus-mt-fr-en -o temp/skill-run-1115/baseline/build --ep cpu --device cpu --no-analyze --no-optimize --no-quant --no-compile --rebuildwinml perf -m temp/skill-run-1115/baseline/build/encoder_model.onnx --task feature-extraction --ep cpu --device cpu --iterations 10 --warmup 3 --format jsonwinml perf -m temp/skill-run-1115/baseline/build/decoder_model.onnx --task text2text-generation --ep cpu --device cpu --iterations 10 --warmup 3 --format jsonwinml eval --schema --task translationfeature-extraction,feature-extraction-with-past,text-generation,text-generation-with-past,text2text-generation, andtext2text-generation-with-past; WinML adds no new task key. Starting config is the two-file composite output fromwinml config --task translation.2. Goal
74342698e416bd9bc4e5f9b534f943425ce81c62; no later ceiling change was made.3. Outcome
examples/recipes/Helsinki-NLP_opus-mt-fr-en/cpu/cpu/; no source code and no production recipe README change.marian-007and methodology finding_meta-080in ModelKitArtifacts Lane A commitbe732458. Methodology friction observed: source-tree analyze reused a central rule tree only after selecting the implementedWINMLCLI_RULES_DIRoverride.Goal ladder
4. Per-EP/device/precision results — including perf and eval data
Perf
Ten measured iterations after three warmups, batch size 1. Component latency is not full autoregressive translation latency.
Default composite-path perf also passed at fp32: encoder mean/p50
78.319/78.513 ms, decoder24.327/24.283 ms. This confirms the model works by default independently of the checked-in recipes.Eval
Evaluation failed: Task 'translation' is not supported. Supported tasks: audio-classification, automatic-speech-recognition, depth-estimation, feature-extraction, fill-mask, image-classification, image-feature-extraction, image-to-image, image-to-text, object-detection, question-answering, semantic-segmentation, text-classification, token-classification, zero-shot-classification, zero-shot-image-classificationEvaluation failed: Task 'translation' is not supported. Supported tasks: audio-classification, automatic-speech-recognition, depth-estimation, feature-extraction, fill-mask, image-classification, image-feature-extraction, image-to-image, image-to-text, object-detection, question-answering, semantic-segmentation, text-classification, token-classification, zero-shot-classification, zero-shot-image-classificationNo dataset or task metric can be reported before the translation eval task and generation loop are registered. Feature gap: add translation dataset/generation-loop support to
winml eval/TASK_REGISTRY.5. Delta
examples/recipes/Helsinki-NLP_opus-mt-fr-en/cpu/cpu/translation_fp32_encoder_config.jsonexamples/recipes/Helsinki-NLP_opus-mt-fr-en/cpu/cpu/translation_fp32_decoder_config.jsonexamples/recipes/Helsinki-NLP_opus-mt-fr-en/cpu/cpu/translation_fp16_encoder_config.jsonexamples/recipes/Helsinki-NLP_opus-mt-fr-en/cpu/cpu/translation_fp16_decoder_config.jsonwinml configoutput is identical (formatting only)./quantchanges fromnullto the generated fp16 policy;/quant/mode = "fp16", component-specific task/model metadata,/quant/fp16_keep_io_types = true, and generated default calibration fields. No export, optimizer, compile, or loader delta exists relative to the matching fp32 config.examples/recipes/README.mdremains untouched.6. Analyze results — component level and op level
Status: ANALYZE-PARTIAL-SUCCESS; exit code
1. winml analyze exited 1 after emitting complete parseable 11-EP JSON for each artifact because requested all-EP classifications include partial/unsupported/unknown results; exit 2 rule-discovery failures were repaired by setting WINMLCLI_RULES_DIR.Component-level analysis
All ten semantic regions map by scoped ONNX node names with mapped confidence. The mapping report lists representative nodes and a full region count; the table uses full region node/operator counts.
encoder.embeddings_input— Encoder embedding/input preparation/encoder/Reshape,/encoder/embed_tokens/Gatherencoder.layers[].self_attention— Encoder self-attention/encoder/layers.0/self_attn/k_proj/MatMul/MatMulAddFusion,/encoder/layers.0/self_attn/Transpose_2encoder.layers[].normalization_residual— Encoder normalization/residual/encoder/layers.0/Add,/encoder/layers.0/self_attn_layer_norm/LayerNormalizationencoder.layers[].mlp— Encoder feed-forward network/encoder/layers.0/fc1/MatMul/MatMulAddFusion,/encoder/layers.0/activation_fn/Sigmoiddecoder.embeddings_input— Decoder embedding/input preparationgemm_input_reshape_token_212,gemm_output_reshape_token_215_new_reshapedecoder.layers[].cross_attention— Decoder cross-attention/model/model/decoder/layers.5/encoder_attn/v_proj/MatMul/MatMulAddFusion,/model/model/decoder/layers.5/encoder_attn/Transpose_1decoder.layers[].self_attention— Decoder self-attention/model/model/decoder/layers.0/self_attn/v_proj/MatMul/MatMulAddFusion,/model/model/decoder/layers.0/self_attn/Transpose_2decoder.layers[].normalization_residual— Decoder normalization/residual/model/model/decoder/layers.0/Add,/model/model/decoder/layers.0/self_attn_layer_norm/LayerNormalizationdecoder.layers[].mlp— Decoder feed-forward network/model/model/decoder/layers.0/fc1/MatMul/MatMulAddFusion,/model/model/decoder/layers.0/activation_fn/Sigmoiddecoder.lm_head— Language-model projection/model/lm_head/MatMulUnmapped node count:
0. Mapping gaps: MLP and normalization/residual are functional regions inferred from scoped node names/topology rather than separate HTP module boundaries; the frozen component map uses current-main fp32 graphs, while fp16 topology/precision is validated by tester artifacts.Op-level analysis
fp32_encoder— 204 operators, 16 unique typesCounts:
Reshape61,Gather1,Mul19,Add19,Gemm36,Transpose24,MatMul12,Unsqueeze2,Expand1,Cast2,Sub1,Where1,Slice1,Softmax6,LayerNormalization12,Sigmoid6.Reshape,Gather,Mul,Add,Gemm,Transpose,MatMul,Unsqueeze,Expand,Cast,Sub,Where,Slice,Softmax,LayerNormalization,SigmoidReshape,Gather,Mul,Add,Gemm,Transpose,MatMul,Unsqueeze,Expand,Cast,Sub,Where,Slice,Softmax,LayerNormalization,SigmoidReshape,Gather,Mul,Add,Gemm,Transpose,MatMul,Unsqueeze,Expand,Cast,Sub,Where,Slice,Softmax,LayerNormalization,SigmoidReshape,Gather,Mul,Add,Gemm,Transpose,MatMul,Unsqueeze,Expand,Cast,Sub,Where,Slice,Softmax,LayerNormalization,SigmoidReshape,Gather,Mul,Add,Gemm,Transpose,MatMul,Unsqueeze,Expand,Cast,Sub,Where,Slice,Softmax,LayerNormalization,Sigmoidfp32_decoder— 392 operators, 20 unique typesCounts:
Reshape112,Gemm60,Transpose54,Unsqueeze7,Expand5,Cast4,Sub1,Where2,Slice3,Gather2,Mul32,Add33,Concat1,ScatterND13,Greater1,Equal1,MatMul25,Softmax12,LayerNormalization18,Sigmoid6.ScatterNDReshape,Gemm,Transpose,Unsqueeze,Expand,Cast,Sub,Where,Slice,Gather,Mul,Add,Concat,ScatterND,Greater,Equal,MatMul,Softmax,LayerNormalization,SigmoidReshape,Gemm,Transpose,Unsqueeze,Expand,Cast,Sub,Where,Slice,Gather,Mul,Add,Concat,ScatterND,Greater,Equal,MatMul,Softmax,LayerNormalization,SigmoidScatterNDExpand,Cast,ConcatScatterNDScatterNDScatterNDScatterNDReshape,Gemm,Transpose,Unsqueeze,Expand,Cast,Sub,Where,Slice,Gather,Mul,Add,Concat,ScatterND,Greater,Equal,MatMul,Softmax,LayerNormalization,SigmoidReshape,Gemm,Transpose,Unsqueeze,Expand,Cast,Sub,Where,Slice,Gather,Mul,Add,Concat,ScatterND,Greater,Equal,MatMul,Softmax,LayerNormalization,SigmoidReshape,Gemm,Transpose,Unsqueeze,Expand,Cast,Sub,Where,Slice,Gather,Mul,Add,Concat,ScatterND,Greater,Equal,MatMul,Softmax,LayerNormalization,Sigmoidfp16_encoder— 205 operators, 16 unique typesCounts:
Reshape61,Gather1,Mul19,Add19,Gemm36,Transpose24,MatMul12,Unsqueeze2,Expand1,Cast3,Sub1,Where1,Slice1,Softmax6,LayerNormalization12,Sigmoid6.Reshape,Gather,Mul,Add,Gemm,Transpose,MatMul,Unsqueeze,Expand,Cast,Sub,Where,Slice,Softmax,LayerNormalization,SigmoidReshape,Gather,Mul,Add,Gemm,Transpose,MatMul,Unsqueeze,Expand,Cast,Sub,Where,Slice,Softmax,LayerNormalization,SigmoidReshape,Gather,Mul,Add,Gemm,Transpose,MatMul,Unsqueeze,Expand,Cast,Sub,Where,Slice,Softmax,LayerNormalization,SigmoidReshape,Gather,Mul,Add,Gemm,Transpose,MatMul,Unsqueeze,Expand,Cast,Sub,Where,Slice,Softmax,LayerNormalization,SigmoidReshape,Gather,Mul,Add,Gemm,Transpose,MatMul,Unsqueeze,Expand,Cast,Sub,Where,Slice,Softmax,LayerNormalization,Sigmoidfp16_decoder— 418 operators, 20 unique typesCounts:
Unsqueeze7,Expand5,Cast30,Sub1,Where2,Slice3,Gather2,Mul32,Add33,Reshape112,Gemm60,Transpose54,Concat1,Greater1,Equal1,ScatterND13,MatMul25,Softmax12,LayerNormalization18,Sigmoid6.ScatterNDUnsqueeze,Expand,Cast,Sub,Where,Slice,Gather,Mul,Add,Reshape,Gemm,Transpose,Concat,Greater,Equal,ScatterND,MatMul,Softmax,LayerNormalization,SigmoidUnsqueeze,Expand,Cast,Sub,Where,Slice,Gather,Mul,Add,Reshape,Gemm,Transpose,Concat,Greater,Equal,ScatterND,MatMul,Softmax,LayerNormalization,SigmoidExpandScatterNDExpand,ConcatCastScatterNDScatterNDScatterNDScatterNDUnsqueeze,Expand,Cast,Sub,Where,Slice,Gather,Mul,Add,Reshape,Gemm,Transpose,Concat,Greater,Equal,ScatterND,MatMul,Softmax,LayerNormalization,SigmoidUnsqueeze,Expand,Cast,Sub,Where,Slice,Gather,Mul,Add,Reshape,Gemm,Transpose,Concat,Greater,Equal,ScatterND,MatMul,Softmax,LayerNormalization,SigmoidUnsqueeze,Expand,Cast,Sub,Where,Slice,Gather,Mul,Add,Reshape,Gemm,Transpose,Concat,Greater,Equal,ScatterND,MatMul,Softmax,LayerNormalization,SigmoidArtifacts:
temp/skill-run-1115/tester/analyze_fp32_encoder.json,temp/skill-run-1115/tester/analyze_fp32_decoder.json,temp/skill-run-1115/tester/analyze_fp16_encoder.json,temp/skill-run-1115/tester/analyze_fp16_decoder.json.7. Reproduce commands