onnxruntime
52e8078b - Handle optimizer size overflow without exceptions (#32875)

Commit
6 days ago
Handle optimizer size overflow without exceptions (#32875) ### Description Use checked arithmetic for output-size estimates in constant folding and for MobileClip attention hidden-size calculation. Reject values that overflow (including QKV dimensions) rather than relying on SafeInt exceptions. Keep kernel failure logging compatible with exception-disabled builds. ### Motivation and Context Size estimation is used to decide whether to fold a constant or fuse a graph pattern. Overflow should leave the node unfused without a large allocation or an exception-dependent failure path. ### Validation - Windows Release: built onnxruntime_test_all locally; 34 constant-folding and MobileClip tests passed, two CUDA-only tests skipped. - Added a ConstantOfShape overflow regression that verifies the node remains unfused. - Compiled the affected optimizer translation units with ORT_NO_EXCEPTIONS defined in a targeted clang-cl syntax check. This is not a full no-exceptions build: the supported ORT configuration requires minimal build, and compiling non-minimal ONNX headers with compiler exceptions disabled fails in those dependency headers.
Author
Parents
Loading