Skip to content

Commit b2a680b

Browse files
guangy10Github Executorchmetascroy
authored
Add Llama3.2 CoreML ANE to benchmark (#7399)
* Add Llama3.2 CoreML ANE to benchmark * Update build_apple_frameworks.sh * Update ETCoreMLModel.mm * Update apple-perf.yml * Update ETCoreMLModel.mm * Update ETCoreMLModel.mm * Update build_apple_frameworks.sh * Update apple-perf.yml * Auto-upgrade device pool for ANE --------- Co-authored-by: Github Executorch <[email protected]> Co-authored-by: Scott Roy <[email protected]>
1 parent 6267b46 commit b2a680b

File tree

3 files changed

+18
-7
lines changed

3 files changed

+18
-7
lines changed

.ci/scripts/gather_benchmark_configs.py

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
# Device pools for AWS Device Farm
1818
DEVICE_POOLS = {
1919
"apple_iphone_15": "arn:aws:devicefarm:us-west-2:308535385114:devicepool:02a2cf0f-6d9b-45ee-ba1a-a086587469e6/3b5acd2e-92e2-4778-b651-7726bafe129d",
20+
"apple_iphone_15+ios_18": "arn:aws:devicefarm:us-west-2:308535385114:devicepool:02a2cf0f-6d9b-45ee-ba1a-a086587469e6/12c8b15c-8d03-4e07-950d-0a627e7595b4",
2021
"samsung_galaxy_s22": "arn:aws:devicefarm:us-west-2:308535385114:devicepool:02a2cf0f-6d9b-45ee-ba1a-a086587469e6/e59f866a-30aa-4aa1-87b7-4510e5820dfa",
2122
"samsung_galaxy_s24": "arn:aws:devicefarm:us-west-2:308535385114:devicepool:02a2cf0f-6d9b-45ee-ba1a-a086587469e6/98f8788c-2e25-4a3c-8bb2-0d1e8897c0db",
2223
"google_pixel_8_pro": "arn:aws:devicefarm:us-west-2:308535385114:devicepool:02a2cf0f-6d9b-45ee-ba1a-a086587469e6/d65096ab-900b-4521-be8b-a3619b69236a",
@@ -39,8 +40,7 @@
3940
"ios": [
4041
"coreml_fp16",
4142
"mps",
42-
# TODO: Add support for llama3 ane
43-
# "llama3_coreml_ane",
43+
"llama3_coreml_ane",
4444
],
4545
}
4646

@@ -198,10 +198,17 @@ def get_benchmark_configs() -> Dict[str, Dict]:
198198

199199
# Add configurations for each valid device
200200
for device in devices:
201-
if device not in DEVICE_POOLS:
202-
logging.warning(f"Unsupported device '{device}'. Skipping.")
203-
continue
204201
for config in configs:
202+
if config == "llama3_coreml_ane" and not device.endswith("+ios_18"):
203+
device = f"{device}+ios_18"
204+
logging.info(
205+
f"Benchmark config '{config}' only works on iOS 18+, auto-upgraded device pool to '{device}'"
206+
)
207+
208+
if device not in DEVICE_POOLS:
209+
logging.warning(f"Unsupported device '{device}'. Skipping.")
210+
continue
211+
205212
record = {
206213
"model": model_name,
207214
"config": config,

.github/workflows/apple-perf.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ jobs:
261261
-kv \
262262
--disable_dynamic_shape \
263263
--coreml \
264-
--coreml-ios 17 \
264+
--coreml-ios 18 \
265265
--coreml-quantize c4w \
266266
--coreml-compute-units cpu_and_ne \
267267
--output_name="${OUT_ET_MODEL_NAME}.pte"

extension/llm/export/partitioner_lib.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,11 @@ def _validate_ios_version() -> None:
158158
op_linear_quantizer_config=op_linear_quantizer_config,
159159
)
160160

161-
take_over_mutable_buffer = minimum_deployment_target >= ct.target.iOS18
161+
# ExecuTorch does not build CoreML delegate runtime to handle state
162+
# when using OSS scripts, so we define take_over_mutable_buffer = False,
163+
# even when target is iOS18
164+
# take_over_mutable_buffer = minimum_deployment_target >= ct.target.iOS18
165+
take_over_mutable_buffer = False
162166
return CoreMLPartitioner( # pyre-fixme[16]
163167
compile_specs=compile_specs,
164168
take_over_mutable_buffer=take_over_mutable_buffer,

0 commit comments

Comments
 (0)