From b6ca51de2c0a661f33122e20944dca0f4462d649 Mon Sep 17 00:00:00 2001 From: Mohammed Alkindi Date: Tue, 25 Aug 2026 02:01:20 +0400 Subject: [PATCH 1/2] docs(_framework_apis): say check_model is a deliberate no-op The docstring read "Check the model." and the body read `del model # Unused yet`, which together suggest validation is pending implementation. It is not: the ONNX checker was deliberately removed because it can report false positives and adds export overhead, and the function is kept only for API compatibility. Records that rationale where a reader of the function will see it. --- onnxscript/_framework_apis/torch_2_5.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/onnxscript/_framework_apis/torch_2_5.py b/onnxscript/_framework_apis/torch_2_5.py index 5bbb64af88..ef8317d34e 100644 --- a/onnxscript/_framework_apis/torch_2_5.py +++ b/onnxscript/_framework_apis/torch_2_5.py @@ -59,9 +59,13 @@ def convert_version(model: ir.Model, target_version: int) -> ir.Model: def check_model(model: ir.Model) -> None: - """Check the model.""" + """No-op retained for API compatibility. - del model # Unused yet + This intentionally performs no validation. Running the ONNX checker here was + dropped because it can report false positives and adds overhead to export. + """ + + del model # Intentionally unused: this function performs no validation. def save_model_with_external_data( @@ -117,6 +121,7 @@ def get_torchlib_ops() -> list[_OnnxFunctionMeta]: del ops # Unused torchlib_registry = registration.default_registry + function_metas = [] for qualified_name, aten_overloads_func in torchlib_registry.items(): From cbf59a4583742576e5d5867ae45ffaac851d51d8 Mon Sep 17 00:00:00 2001 From: Mohammed Alkindi Date: Tue, 25 Aug 2026 02:01:51 +0400 Subject: [PATCH 2/2] docs(_framework_apis): say check_model is a deliberate no-op The docstring read "Check the model." and the body read `del model # Unused yet`, which together suggest validation is pending implementation. It is not: the ONNX checker was deliberately removed because it can report false positives and adds export overhead, and the function is kept only for API compatibility. Records that rationale where a reader of the function will see it. --- onnxscript/_framework_apis/torch_2_5.py | 1 - 1 file changed, 1 deletion(-) diff --git a/onnxscript/_framework_apis/torch_2_5.py b/onnxscript/_framework_apis/torch_2_5.py index ef8317d34e..9f31934701 100644 --- a/onnxscript/_framework_apis/torch_2_5.py +++ b/onnxscript/_framework_apis/torch_2_5.py @@ -121,7 +121,6 @@ def get_torchlib_ops() -> list[_OnnxFunctionMeta]: del ops # Unused torchlib_registry = registration.default_registry - function_metas = [] for qualified_name, aten_overloads_func in torchlib_registry.items():