From 95c6cd72603429ad8248087581516576e9c0cad4 Mon Sep 17 00:00:00 2001 From: Github Executorch Date: Thu, 19 Dec 2024 17:00:31 -0800 Subject: [PATCH] Auto-upgrade device pool for ANE --- .ci/scripts/gather_benchmark_configs.py | 14 +++++++++++--- extension/llm/export/partitioner_lib.py | 6 +++++- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/.ci/scripts/gather_benchmark_configs.py b/.ci/scripts/gather_benchmark_configs.py index 27dff35eba..a927153778 100755 --- a/.ci/scripts/gather_benchmark_configs.py +++ b/.ci/scripts/gather_benchmark_configs.py @@ -17,6 +17,7 @@ # Device pools for AWS Device Farm DEVICE_POOLS = { "apple_iphone_15": "arn:aws:devicefarm:us-west-2:308535385114:devicepool:02a2cf0f-6d9b-45ee-ba1a-a086587469e6/3b5acd2e-92e2-4778-b651-7726bafe129d", + "apple_iphone_15+ios_18": "arn:aws:devicefarm:us-west-2:308535385114:devicepool:02a2cf0f-6d9b-45ee-ba1a-a086587469e6/12c8b15c-8d03-4e07-950d-0a627e7595b4", "samsung_galaxy_s22": "arn:aws:devicefarm:us-west-2:308535385114:devicepool:02a2cf0f-6d9b-45ee-ba1a-a086587469e6/e59f866a-30aa-4aa1-87b7-4510e5820dfa", "samsung_galaxy_s24": "arn:aws:devicefarm:us-west-2:308535385114:devicepool:02a2cf0f-6d9b-45ee-ba1a-a086587469e6/98f8788c-2e25-4a3c-8bb2-0d1e8897c0db", "google_pixel_8_pro": "arn:aws:devicefarm:us-west-2:308535385114:devicepool:02a2cf0f-6d9b-45ee-ba1a-a086587469e6/d65096ab-900b-4521-be8b-a3619b69236a", @@ -197,10 +198,17 @@ def get_benchmark_configs() -> Dict[str, Dict]: # Add configurations for each valid device for device in devices: - if device not in DEVICE_POOLS: - logging.warning(f"Unsupported device '{device}'. Skipping.") - continue for config in configs: + if config == "llama3_coreml_ane" and not device.endswith("+ios_18"): + device = f"{device}+ios_18" + logging.info( + f"Benchmark config '{config}' only works on iOS 18+, auto-upgraded device pool to '{device}'" + ) + + if device not in DEVICE_POOLS: + logging.warning(f"Unsupported device '{device}'. Skipping.") + continue + record = { "model": model_name, "config": config, diff --git a/extension/llm/export/partitioner_lib.py b/extension/llm/export/partitioner_lib.py index 19c8959676..74a521a61b 100644 --- a/extension/llm/export/partitioner_lib.py +++ b/extension/llm/export/partitioner_lib.py @@ -158,7 +158,11 @@ def _validate_ios_version() -> None: op_linear_quantizer_config=op_linear_quantizer_config, ) - take_over_mutable_buffer = minimum_deployment_target >= ct.target.iOS18 + # 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 return CoreMLPartitioner( # pyre-fixme[16] compile_specs=compile_specs, take_over_mutable_buffer=take_over_mutable_buffer,