Summary
Two Core ML options in the llama export config are parsed, stored, and then read by nothing:
backend.coreml.enable_state
backend.coreml.preserve_sdpa
The command line accepts --coreml-enable-state and --coreml-preserve-sdpa, LlmConfig holds
both, and from_args assigns both. No exporter ever reads them, so setting either has no effect.
This is not theoretical. The Core ML config shipped in this repository for lfm2 sets both to true:
enable_state: True
preserve_sdpa: True
So that config exports without stateful Core ML models and without the preserved SDPA op, silently,
and has presumably been doing so since the options were added.
Why it surfaced now
Until recently a Core ML llama export could not run at all: the branch selecting the Core ML lowering
read a backend field that no longer existed and raised AttributeError first. With that fixed, this
path executes for the first time, which is what makes the dropped options observable.
What to decide
Either wire both options into the Core ML lowering, or remove them from the parser and the config so
nobody sets something that does nothing. Leaving a shipped config setting them to true while they are
ignored is the worst of the three.
Summary
Two Core ML options in the llama export config are parsed, stored, and then read by nothing:
The command line accepts
--coreml-enable-stateand--coreml-preserve-sdpa,LlmConfigholdsboth, and
from_argsassigns both. No exporter ever reads them, so setting either has no effect.This is not theoretical. The Core ML config shipped in this repository for lfm2 sets both to true:
So that config exports without stateful Core ML models and without the preserved SDPA op, silently,
and has presumably been doing so since the options were added.
Why it surfaced now
Until recently a Core ML llama export could not run at all: the branch selecting the Core ML lowering
read a backend field that no longer existed and raised
AttributeErrorfirst. With that fixed, thispath executes for the first time, which is what makes the dropped options observable.
What to decide
Either wire both options into the Core ML lowering, or remove them from the parser and the config so
nobody sets something that does nothing. Leaving a shipped config setting them to true while they are
ignored is the worst of the three.