Skip to content

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

@igorls

Description

@igorls

Description

The ARM64/CoreML segfault mitigation in mempalace/__init__.py line 19 sets an environment variable that ONNX Runtime does not read, making the fix completely non-functional.

os.environ.setdefault("ORT_DISABLE_COREML", "1")

Root Cause

ORT_DISABLE_COREML is not a recognized ONNX Runtime environment variable. ONNX Runtime does not provide a global env var to disable individual execution providers.

This means:

Verification

  1. The ONNX Runtime CoreML documentation lists no such environment variable
  2. Searching the ONNX Runtime source code for "ORT_DISABLE_COREML" returns zero results
  3. Provider selection is controlled at the session level via InferenceSession(model, providers=[...]), not via environment variables

How to actually disable CoreML

The correct approach for ChromaDB's default embedding function:

from chromadb.utils.embedding_functions import ONNXMiniLM_L6_V2
ef = ONNXMiniLM_L6_V2(preferred_providers=["CPUExecutionProvider"])

Or when creating the ONNX session directly:

import onnxruntime as ort
session = ort.InferenceSession(model_path, providers=["CPUExecutionProvider"])

Impact

Suggested Fix

Replace the no-op env var with an actual provider override:

# In mcp_server.py / miner.py wherever ChromaDB clients are created:
import platform
if platform.machine() in ("arm64", "aarch64") and platform.system() == "Darwin":
    ef = ONNXMiniLM_L6_V2(preferred_providers=["CPUExecutionProvider"])
    collection = client.get_or_create_collection("mempalace_drawers", embedding_function=ef)

Remove the no-op from __init__.py:

-os.environ.setdefault("ORT_DISABLE_COREML", "1")

Environment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions