diff --git a/.github/workflows/apple-perf.yml b/.github/workflows/apple-perf.yml index 4fb3e9711db..50208268757 100644 --- a/.github/workflows/apple-perf.yml +++ b/.github/workflows/apple-perf.yml @@ -341,7 +341,7 @@ jobs: - set-parameters secrets: inherit with: - runner: macos-latest-xlarge + runner: macos-15-xlarge python-version: '3.11' submodules: 'true' ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }} @@ -351,6 +351,9 @@ jobs: script: | set -eux + echo "Setting XCode version" + sudo xcode-select -switch /Applications/Xcode_16.2.app + echo "::group::Setting up CI environment" .ci/scripts/setup-conda.sh diff --git a/extension/benchmark/apple/Benchmark/README.md b/extension/benchmark/apple/Benchmark/README.md index 79daf070e44..cea2d1c7442 100644 --- a/extension/benchmark/apple/Benchmark/README.md +++ b/extension/benchmark/apple/Benchmark/README.md @@ -72,6 +72,15 @@ kernels_portable.xcframework kernels_quantized.xcframework ``` +#### MLState +The prebuilt frameworks do not work with CoreML models that use MLState, which is used in LLM models exported for iOS18. When executing the *.pte file, you will see an error like: + +``` +The input feature for X must be an MLState, but it was not. +``` + +If you encounter this issue, build the frameworks locally (option 2) using **XCode 16.0** or higher. + ## Adding Models and Resources Place your exported model files (`.pte`) and any other resources (e.g., `tokenizer.bin`) into the `extension/benchmark/apple/Benchmark/Resources` directory: diff --git a/extension/llm/export/partitioner_lib.py b/extension/llm/export/partitioner_lib.py index 74a521a61b5..19c89596765 100644 --- a/extension/llm/export/partitioner_lib.py +++ b/extension/llm/export/partitioner_lib.py @@ -158,11 +158,7 @@ def _validate_ios_version() -> None: op_linear_quantizer_config=op_linear_quantizer_config, ) - # ExecuTorch does not build CoreML delegate runtime to handle state - # when using OSS scripts, so we define take_over_mutable_buffer = False, - # even when target is iOS18 - # take_over_mutable_buffer = minimum_deployment_target >= ct.target.iOS18 - take_over_mutable_buffer = False + take_over_mutable_buffer = minimum_deployment_target >= ct.target.iOS18 return CoreMLPartitioner( # pyre-fixme[16] compile_specs=compile_specs, take_over_mutable_buffer=take_over_mutable_buffer,