Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion modelopt/onnx/trt_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,13 @@ def load_onnx_model(
intermediate_generated_files.append(ir_version_onnx_path)

# Check that the model is valid
onnx.checker.check_model(onnx_model)
if use_external_data_format:
# For large models, use the file path to avoid protobuf size limitation
model_path_to_check = ir_version_onnx_path or static_shaped_onnx_path or onnx_path
onnx.checker.check_model(model_path_to_check)
else:
# For smaller models, checking the model object is fine
onnx.checker.check_model(onnx_model)

return (
onnx_model,
Expand Down