Skip to content

docs: with_disabled_optimizers takes a semicolon-separated list, not comma - #617

Merged
decahedron1 merged 3 commits into
pykeio:mainfrom
attevon-admin:docs/disabled-optimizers-separator
Sep 2, 2026
Merged

decahedron1 merged 3 commits into
pykeio:mainfrom
attevon-admin:docs/disabled-optimizers-separator

Conversation

@attevon-admin

Copy link
Copy Markdown
Contributor

The doc comment on with_disabled_optimizers says "comma-separated". ONNX Runtime splits this config value on ;.

From inference_session.cc:

auto disabled_string = session_options_.config_options.GetConfigOrDefault(
    kOrtSessionOptionsDisableSpecifiedOptimizers, "");
if (!disabled_string.empty()) {
  const auto disabled_list = utils::SplitString(disabled_string, ";");

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:

disable "GeluFusionL2"                 model loads
disable "GeluFusionL1;GeluFusionL2"    model loads
disable "GeluFusionL1,GeluFusionL2"    model FAILS to load, so nothing was disabled

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.

davidamacey and others added 3 commits September 2, 2026 05:59
…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.
@decahedron1
decahedron1 merged commit 4687b71 into pykeio:main Sep 2, 2026
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants