check_model in onnxscript/_framework_apis/torch_2_5.py is:
def check_model(model: ir.Model) -> None:
"""Check the model."""
del model # Unused yet
torch_2_6.py through torch_2_11.py all re-export this same function unchanged (confirmed on current main).
torch.onnx.export(..., dynamo=True, verify=True) calls this via onnxscript_apis.check_model(onnx_program.model) in torch/onnx/_internal/exporter/_core.py, prints "Check the ONNX model... ✅", and sets export_status.onnx_checker = True — regardless of whether the model is actually valid. A model that would fail onnx.checker.check_model(..., full_check=True) still gets reported as checked and passing.
Repro:
import torch
class M(torch.nn.Module):
def forward(self, x):
return x + 1
torch.onnx.export(M(), (torch.randn(2, 2),), "m.onnx", dynamo=True, verify=True)
# Prints "Check the ONNX model... ✅" no matter what — the check never runs.
Is real validation (e.g. wiring in onnx.checker.check_model) planned, or should the verify=True reporting reflect that this step is currently a stub?
check_modelinonnxscript/_framework_apis/torch_2_5.pyis:torch_2_6.pythroughtorch_2_11.pyall re-export this same function unchanged (confirmed on currentmain).torch.onnx.export(..., dynamo=True, verify=True)calls this viaonnxscript_apis.check_model(onnx_program.model)intorch/onnx/_internal/exporter/_core.py, prints"Check the ONNX model... ✅", and setsexport_status.onnx_checker = True— regardless of whether the model is actually valid. A model that would failonnx.checker.check_model(..., full_check=True)still gets reported as checked and passing.Repro:
Is real validation (e.g. wiring in
onnx.checker.check_model) planned, or should theverify=Truereporting reflect that this step is currently a stub?