docs: with_disabled_optimizers takes a semicolon-separated list, not comma - #617
Merged
decahedron1 merged 3 commits intoSep 2, 2026
Merged
Conversation
…comma ONNX Runtime splits this config value on ';', not ','. inference_session.cc calls utils::SplitString(disabled_string, ";"). A comma-joined list is therefore taken as one optimizer name, matches nothing, and silently disables no optimizers at all. Unrecognized names are ignored without error too, so the failure is invisible: the session opens and behaves exactly as if the call had not been made. Adds an example and notes the silent-ignore behaviour, since that is what makes a wrong value hard to notice.
Session::builder takes the environment, and the doctest needs a model that actually exists in the repo so it can run rather than being no_run. Matches the example on BuilderResult in builder/mod.rs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The doc comment on
with_disabled_optimizerssays "comma-separated". ONNX Runtime splits this config value on;.From
inference_session.cc:So a comma-joined list is taken as a single optimizer name, matches nothing, and disables no optimizers at all.
What makes this worth fixing rather than noting is that it fails silently. ORT ignores unrecognized optimizer names without an error, so passing
"A,B"produces a session that opens normally and behaves exactly as though the call had never been made. There is no warning and no way to tell from the outside.I hit this while working around an ORT fusion problem on aarch64. I was passing a comma-separated list, saw no change in behaviour, and concluded the config entry did not work. It took a while to find that the list was fine and only the separator was wrong.
Measured on ort 2.0.0-rc.12 against ORT 1.24.2, using session load success as the signal:
The change corrects the separator, adds an example, and documents the silent-ignore behaviour for unrecognized names, since that is the part that makes a wrong value hard to notice.
Docs only, no behaviour change.