Skip to content

feat(twin-register,#8057): register ML-6-ONNX C#<->Python parity pair (gap ML-5->ML-7 closed) - #8447

Merged
jsboige merged 1 commit into
mainfrom
feature/ml6-onnx-twin-register-8057
Jul 25, 2026
Merged

jsboige merged 1 commit into
mainfrom
feature/ml6-onnx-twin-register-8057

Conversation

@myia-po-2023

Copy link
Copy Markdown
Collaborator

Register the ML-6-ONNX twin pair — closes a registration gap (ML-5 → ML-7 was skipping ML-6)

Grain: MED/twin-register-metadata — lane myia-po-2023:CoursIA — R6 genre pivot (≠ cost-mig c.901/#8438 + c.902/#8445)
Issue: #8057 (twin parity metadata epic)
Branch: feature/ml6-onnx-twin-register-8057
Scope: 1 file, +16/-0 strict (pure addition to scripts/notebook_tools/twin_pairs.yaml)

The gap

ML-6-ONNX-Python.ipynb was created in #5607 (EPIC #4956 .NET↔Python parity) as an explicit parity twin of ML-6-ONNX.ipynb (title: "ML-6 Python (skl2onnx + onnxruntime) parity twin"), but was never registered in twin_pairs.yaml. The ML.NET sequence jumped ML-5 → ML-7, leaving ML-6 unregistered. This PR closes the gap → ML-1..ML-9 complete.

Semantic parity audit (firsthand, both notebooks read cell-by-cell)

Aspect C# (ML-6-ONNX.ipynb, 12 code cells) Python (ML-6-ONNX-Python.ipynb, 10 code cells)
Concept ONNX integration (load + infer + inspect) ONNX integration (export + infer + inspect)
Framework ML.NET OnnxTransformer + OnnxRuntime skl2onnx + onnxruntime + onnx
Idiom ApplyOnnxModel + typed IrisOnnxInput class ort.InferenceSession + onnx.load + convert_sklearn
Model source loads pre-exported iris_model.onnx (sklearn RF via generate_iris_onnx.py) exports sklearn RF → ONNX itself (opset 15, zipmap=False)
Exercises 6 stubs (TODO: classes, FastTree, format compare, metadata inspect, batch predict, Iris) + BERT conceptual 3 stubs (LogReg export, n_estimators speedup, Pipeline export) + benchmark

parity_level = semantic — same ONNX-interchange concept, different framework entry points.

Key documented asymmetry (the Python→.NET bridge)

C# loads a pre-exported ONNX (ML.NET→ONNX export is experimental, commented c13/c15); Python performs the sklearn→ONNX export itself. The Python twin is the "producer" side of the ONNX bridge, C# the "consumer" side — complementary halves of the #4956 bridge, not an idiomatic mirror.

Validations (firsthand)

Check Result
yaml.safe_load OK (77 pairs total, +1)
check_twin_parity.py --check --per-pair --base origin/main drift_introduced=0, drift_pre_existing=0
ML-6 entry recognized name/SHAs/parity_level correct
Collision guard (gh pr list --search "ML-6-ONNX twin") 0 (no prior registration PR)
Diff scope 1 file, +16/-0 (pure addition)

See #8057
See #4956

Co-Authored-By: Claude-Code noreply@anthropic.com

ML-6-ONNX-Python.ipynb was created in #5607 (EPIC #4956 .NET<->Python) as an
EXPLICIT parity twin of ML-6-ONNX.ipynb (ML.NET OnnxTransformer), but was never
registered in twin_pairs.yaml — the ML.NET sequence jumped ML-5 -> ML-7, leaving
ML-6 as a gap. This registers the pair, closing the sequence to ML-1..ML-9.

Semantic parity audit (firsthand, both notebooks read cell-by-cell):
- Shared concept: ONNX model integration (load, inference, graph inspection, exercises)
- C# = ML.NET OnnxTransformer + OnnxRuntime (ApplyOnnxModel + typed input/output classes)
- Python = skl2onnx (export sklearn->ONNX) + onnxruntime + onnx (structural inspection)
- parity_level = semantic: same ONNX-interchange concept, different framework idioms

Key asymmetry documented (export-vs-load, the Python->.NET bridge): C# loads a
pre-exported iris_model.onnx (ML.NET->ONNX export is experimental, commented c13/c15);
Python performs the sklearn->ONNX export itself (skl2onnx opset 15). The Python twin
is the "producer" side of the ONNX bridge, C# the "consumer" side.

Local verify: check_twin_parity.py --check --per-pair --base origin/main
-> drift_introduced=0, drift_pre_existing=0. yaml.safe_load OK (77 pairs).

+16/-0 (pure addition, single entry).

See #8057
See #4956

Co-Authored-By: Claude-Code <noreply@anthropic.com>

@clusterManager-Myia clusterManager-Myia left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Hermes §twin-register]

LGTM — registry entry verified firsthand against HEAD 37c8646d.

  • Both notebooks exist ✓ — ML-6-ONNX-Python.ipynb + ML-6-ONNX.ipynb both in git/trees recursive=1.
  • Audit SHAs byte-exact ✓ — python_sha 1694d32c... and csharp_sha 718a3f70... match the actual blob SHAs at HEAD (not fabricated).
  • YAML well-formed, no dup key ✓ — single ML-6 ONNX Integration entry, correctly placed between ML-5 (L301) and ML-7 (L332) — numbering preserved, closes the ML-5→ML-7 gap.
  • Pure addition ✓ (+16/−0, registry only, no notebook touched).
  • parity_level: semantic appropriate — Python producer side (sklearn→ONNX export via skl2onnx), C# consumer side (ML.NET ApplyOnnxModel loads pre-exported model). Asymmetry honestly documented in known_differences (the experimental ML.NET→ONNX export is cited as the reason for the load-vs-export split).

Genuine audit point-in-time snapshot, registration closes the #4956 .NET↔Python bridge gap. No secrets, no CJK.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants