fix: explicitly set graph_optimization_level for non-complex models

Same robustness pattern as the previous mem_pattern commit: previously
inherited ORT's implicit default (ORT_ENABLE_ALL) when is_complex_model
was False. Set explicitly in both branches so the behavior survives any
future ORT default change.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
felalex 2026-05-02 23:52:23 -07:00
parent cf8638f260
commit 6a16fa667b

View File

@ -56,6 +56,12 @@ def get_ort_session_options(
sess_options.graph_optimization_level = (
ort.GraphOptimizationLevel.ORT_ENABLE_BASIC
)
else:
# Most models tolerate aggressive fusions; set explicitly to be robust
# against ORT default changes.
sess_options.graph_optimization_level = (
ort.GraphOptimizationLevel.ORT_ENABLE_ALL
)
return sess_options