Skip to content

fix: remove no-op ORT_DISABLE_COREML env var (#397)#653

Merged
bensig merged 1 commit intoMemPalace:developfrom
mvalentsev:fix/ort-disable-coreml-noop
Apr 12, 2026
Merged

fix: remove no-op ORT_DISABLE_COREML env var (#397)#653
bensig merged 1 commit intoMemPalace:developfrom
mvalentsev:fix/ort-disable-coreml-noop

Conversation

@mvalentsev
Copy link
Copy Markdown
Contributor

@mvalentsev mvalentsev commented Apr 12, 2026

What does this PR do?

Closes #397. ORT_DISABLE_COREML is not a recognized ONNX Runtime environment variable, so the os.environ.setdefault in mempalace/__init__.py was a silent no-op. ONNX Runtime does not expose a global way to disable a specific execution provider -- providers are selected per session via the providers argument to InferenceSession. The CoreMLExecutionProvider was still loaded on Apple Silicon, so the code claimed a mitigation that never worked.

Why the old mitigation never helped

The line was added in df33550 (v3.1.0) with the stated goal of fixing the #74 ARM64 segfault. In practice:

Fix

Test plan

python -m pytest tests/ -q
ruff check mempalace/__init__.py
ruff format --check mempalace/__init__.py

598 tests pass, file is format-clean.

Conflict check vs #581

#581 also touches mempalace/__init__.py, but only the posthog telemetry comment block. The ORT block lives a few lines below and is not in #581's hunk, so the two PRs modify non-overlapping regions and can merge in either order without a hard conflict.

ORT_DISABLE_COREML is not a recognized ONNX Runtime environment
variable. ONNX Runtime does not expose a global env var to disable
individual execution providers -- providers are selected per session
via the providers argument to InferenceSession. Setting it had zero
effect.

The mitigation was added in df33550 (v3.1.0) with the stated goal of
fixing the MemPalace#74 ARM64 segfault. Two problems: the env var doesn't
work as described above, and MemPalace#74 is a null-pointer crash in
chromadb_rust_bindings.abi3.so -- not an ONNX issue, so disabling
CoreML would not have fixed it anyway.

MemPalace#521 has since traced the actual macOS arm64 crashes (both mine and
search) to the 0.x chromadb hnswlib binding. Filtering
CoreMLExecutionProvider at the ONNX layer leaves the hnswlib C++
crash intact, so the real fix is upgrading chromadb to 1.5.4+,
which MemPalace#581 proposes. This PR only removes the misleading no-op and
leaves a NOTE pointing at MemPalace#521 / MemPalace#581.

Closes MemPalace#397
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.

ARM64 segfault mitigation is a no-op — ORT_DISABLE_COREML is not a real ONNX Runtime env var

2 participants