Skip to content

Commit ac207db

Browse files
committed
Update on "use --use_sdpa_with_kv_cache for 1B/3B bf16"
We should use this option during exporting 1B/3B models as bf16 because KVCache is always fp32. Otherwise, we see regressed performance for 1B/3B in bf16 format. Differential Revision: [D63871048](https://our.internmc.facebook.com/intern/diff/D63871048/) [ghstack-poisoned]
2 parents 95c889a + 00231ed commit ac207db

File tree

38 files changed

+351
-124
lines changed

38 files changed

+351
-124
lines changed

backends/arm/test/ops/test_sigmoid.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,12 +152,32 @@ def test_sigmoid_tosa_MI(
152152
def test_sigmoid_tosa_BI(self, test_name: str, test_data: torch.Tensor):
153153
self._test_sigmoid_tosa_BI_pipeline(self.Sigmoid(), (test_data,))
154154

155+
def test_add_sigmoid_tosa_MI(self):
156+
self._test_sigmoid_tosa_MI_pipeline(self.AddSigmoid(), (test_data_suite[0][1],))
157+
158+
@unittest.skip(
159+
reason="Started to fails when PyTorch 2.5->2.6 https://github.com/pytorch/executorch/issues/5832"
160+
)
155161
def test_add_sigmoid_tosa_BI(self):
156162
self._test_sigmoid_tosa_BI_pipeline(self.AddSigmoid(), (test_data_suite[0][1],))
157163

164+
def test_sigmoid_add_tosa_MI(self):
165+
self._test_sigmoid_tosa_MI_pipeline(self.SigmoidAdd(), (test_data_suite[0][1],))
166+
167+
@unittest.skip(
168+
reason="Started to fails when PyTorch 2.5->2.6 https://github.com/pytorch/executorch/issues/5832"
169+
)
158170
def test_sigmoid_add_tosa_BI(self):
159171
self._test_sigmoid_tosa_BI_pipeline(self.SigmoidAdd(), (test_data_suite[0][1],))
160172

173+
def test_sigmoid_add_sigmoid_tosa_MI(self):
174+
self._test_sigmoid_tosa_MI_pipeline(
175+
self.SigmoidAddSigmoid(), (test_data_suite[4][1], test_data_suite[3][1])
176+
)
177+
178+
@unittest.skip(
179+
reason="Started to fails when PyTorch 2.5->2.6 https://github.com/pytorch/executorch/issues/5832"
180+
)
161181
def test_sigmoid_add_sigmoid_tosa_BI(self):
162182
self._test_sigmoid_tosa_BI_pipeline(
163183
self.SigmoidAddSigmoid(), (test_data_suite[4][1], test_data_suite[3][1])

backends/mediatek/scripts/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Before you begin, ensure you have the following prerequisites installed and conf
1616

1717
### 2. Android NDK
1818

19-
- **Download Android NDK**: Acquire the Android NDK from the [Android developer site](https://developer.android.com/ndk/downloads).
19+
- **Download Android NDK**: Acquire the Android NDK version 26.3.11579264 from the [Android developer site](https://developer.android.com/ndk/downloads).
2020
- **Set NDK Path**: Ensure that the `$ANDROID_NDK` environment variable is set to the path where the NDK is located.
2121
```bash
2222
export ANDROID_NDK=<path_to_android_ndk>

examples/demo-apps/android/LlamaDemo/README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,12 @@ First it’s important to note that currently ExecuTorch provides support across
3434
| QNN (Qualcomm AI Accelerators) | [link](https://github.com/pytorch/executorch/blob/main/examples/demo-apps/android/LlamaDemo/docs/delegates/qualcomm_README.md) |
3535
| MediaTek (MediaTek AI Accelerators) | [link](https://github.com/pytorch/executorch/blob/main/examples/demo-apps/android/LlamaDemo/docs/delegates/mediatek_README.md) |
3636

37+
**WARNING** NDK r27 will cause issues like:
38+
```
39+
java.lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol "_ZTVNSt6__ndk114basic_ifstreamIcNS_11char_traitsIcEEEE" referenced by "/data/app/~~F5IwquaXUZPdLpSEYA-JGA==/com.example.executorchllamademo-FSyx80gEhsQCsxz7hvS2Ew==/lib/arm64/libexecutorch.so"...
40+
```
41+
Please use NDK version 26.3.11579264.
42+
3743
## How to Use the App
3844

3945
This section will provide the main steps to use the app, along with a code snippet of the ExecuTorch API.

examples/demo-apps/android/LlamaDemo/docs/delegates/qualcomm_README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ More specifically, it covers:
66
2. Building and linking libraries that are required to inference on-device for Android platform using Qualcomm AI accelerators.
77
3. Building the Android demo app itself.
88

9-
Verified on Linux CentOS, QNN SDK [v2.26](https://softwarecenter.qualcomm.com/api/download/software/qualcomm_neural_processing_sdk/v2.26.0.240828.zip), python 3.10, Android SDK r27 and r26b.
9+
Verified on Linux CentOS, QNN SDK [v2.26](https://softwarecenter.qualcomm.com/api/download/software/qualcomm_neural_processing_sdk/v2.26.0.240828.zip), python 3.10, Android SDK r26c.
1010

1111
Phone verified: OnePlus 12, Samsung 24+, Samsung 23
1212

1313
## Prerequisites
1414
* Download and unzip QNN SDK [v2.26](https://softwarecenter.qualcomm.com/api/download/software/qualcomm_neural_processing_sdk/v2.26.0.240828.zip)
15-
* Download and unzip Android SDK [r27](https://developer.android.com/ndk/downloads)
15+
* Download and unzip Android SDK [r26](https://developer.android.com/ndk/downloads)
1616
* Android phone with Snapdragon8 Gen3 (SM8650) or Gen2 (SM8550). Gen 1 and lower SoC might be supported but not fully validated.
1717
* Desired Llama model weights in .PTH format. You can download them on HuggingFace ([Example](https://huggingface.co/meta-llama/Meta-Llama-3-8B-Instruct)).
1818

@@ -40,7 +40,7 @@ Install dependencies
4040
## Setup QNN
4141
```
4242
# Set these variables correctly for your environment
43-
export ANDROID_NDK_ROOT=$HOME/android-ndk-r27 # Download android SDK and unzip to home directory
43+
export ANDROID_NDK_ROOT=$HOME/android-ndk-r26 # Download android SDK and unzip to home directory
4444
export QNN_SDK_ROOT=$HOME/Your-SDK-Root #Folder contains lib
4545
export EXECUTORCH_ROOT=$HOME/repos/executorch
4646
export LD_LIBRARY_PATH=$QNN_SDK_ROOT/lib/x86_64-linux-clang/:$LD_LIBRARY_PATH

examples/demo-apps/android/LlamaDemo/docs/delegates/xnnpack_README.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,11 @@ Phone verified: OnePlus 12, OnePlus 9 Pro. Samsung S23 (Llama only), Samsung S24
1616

1717
## Prerequisites
1818
* Install [Java 17 JDK](https://www.oracle.com/java/technologies/javase/jdk17-archive-downloads.html).
19-
* Install the [Android SDK API Level 34](https://developer.android.com/about/versions/15/setup-sdk) and [Android NDK 26.3.11579264](https://developer.android.com/studio/projects/install-ndk).
19+
* Install the [Android SDK API Level 34](https://developer.android.com/about/versions/15/setup-sdk) and [Android NDK 26.3.11579264](https://developer.android.com/studio/projects/install-ndk). **WARNING** NDK r27 will cause issues like:
20+
```
21+
java.lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol "_ZTVNSt6__ndk114basic_ifstreamIcNS_11char_traitsIcEEEE" referenced by "/data/app/~~F5IwquaXUZPdLpSEYA-JGA==/com.example.executorchllamademo-FSyx80gEhsQCsxz7hvS2Ew==/lib/arm64/libexecutorch.so"...
22+
```
23+
Please downgrade to version 26.3.11579264.
2024
* If you have Android Studio set up, you can install them with
2125
* Android Studio Settings -> Language & Frameworks -> Android SDK -> SDK Platforms -> Check the row with API Level 34.
2226
* Android Studio Settings -> Language & Frameworks -> Android SDK -> SDK Tools -> Check NDK (Side by side) row.
@@ -67,7 +71,7 @@ We have supported BFloat16 as a data type on the XNNPACK backend for Llama 3.2 1
6771
* Export Llama model and generate .pte file as below:
6872

6973
```
70-
python -m examples.models.llama2.export_llama --checkpoint <checkpoint.pth> --params <params.json> -kv -X -d bf16 --metadata '{"get_bos_id":128000, "get_eos_ids":[128009, 128001]}' --output_name="llama3_2.pte"
74+
python -m examples.models.llama2.export_llama --checkpoint <checkpoint.pth> --params <params.json> -kv --use_sdpa_with_kv_cache -X -d bf16 --metadata '{"get_bos_id":128000, "get_eos_ids":[128009, 128001]}' --output_name="llama3_2.pte"
7175
```
7276

7377
* Rename tokenizer for Llama 3.2 with command: `mv tokenizer.model tokenizer.bin`. We are updating the demo app to support tokenizer in original format directly.
@@ -135,6 +139,7 @@ export ANDROID_NDK=<path_to_android_ndk>
135139
export ANDROID_ABI=arm64-v8a
136140
```
137141
*Note: <path_to_android_ndk> is the root for the NDK, which is usually under ~/Library/Android/sdk/ndk/XX.Y.ZZZZZ for macOS, and contains NOTICE and README.md. We use <path_to_android_ndk>/build/cmake/android.toolchain.cmake for CMake to cross-compile.*
142+
138143
3. Build the Android Java extension code:
139144
```
140145
pushd extension/android

examples/demo-apps/apple_ios/LLaMA/docs/delegates/xnnpack_README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ We have supported BFloat16 as a data type on the XNNPACK backend for Llama 3.2 1
5555
* Export Llama model and generate .pte file as below:
5656

5757
```
58-
python -m examples.models.llama2.export_llama --checkpoint <checkpoint.pth> --params <params.json> -kv -X -d bf16 --metadata '{"get_bos_id":128000, "get_eos_ids":[128009, 128001]}' --output_name="llama3_2.pte"
58+
python -m examples.models.llama2.export_llama --checkpoint <checkpoint.pth> --params <params.json> -kv --use_sdpa_with_kv_cache -X -d bf16 --metadata '{"get_bos_id":128000, "get_eos_ids":[128009, 128001]}' --output_name="llama3_2.pte"
5959
```
6060

6161
For more detail using Llama 3.2 lightweight models including prompt template, please go to our official [website](https://www.llama.com/docs/model-cards-and-prompt-formats/llama3_2#-llama-3.2-lightweight-models-(1b/3b)-).
1.01 MB
Loading

examples/models/llama2/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,10 @@ We have verified running Llama 2 7B [mobile applications](#step-6-build-mobile-a
8585
### Llama 3.2 1B and 3B
8686
Llama 3.2 1B and 3B performance was measured on the OnePlus 12 device. The performance measurement is expressed in terms of tokens per second using an [adb binary-based approach](#step-5-run-benchmark-on) for generating 128 tokens.
8787

88-
|Model | 4bit(*) via SpinQuant
89-
|--------| ---------------
90-
|1B | 53.41 tokens/second |
91-
|3B | 22.98 tokens/second |
88+
|Model | bf16 | 4bit(*) via SpinQuant
89+
|--------| ---------------------- | ---------------
90+
|1B | 19.4 tokens/second | 53.41 tokens/second |
91+
|3B | 7.76 tokens/second | 22.98 tokens/second |
9292

9393
(*) With SpinQuant, we currently quantize 4-bit groupwise (with groupsize 32) weight, 8bit dynamic activation of all the linear layers of the model, except embedding and output layers. The embedding and output layers are quantized as 8-bit per-channel weight and 8-bit dynamic activation.
9494

examples/models/flamingo/cross_attention/cross_attention_mask.cpp renamed to examples/models/llama3_2_mm/cross_attention/cross_attention_mask.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* LICENSE file in the root directory of this source tree.
77
*/
88

9-
#include <executorch/examples/models/flamingo/cross_attention/cross_attention_mask.h>
9+
#include <executorch/examples/models/llama3_2_mm/cross_attention/cross_attention_mask.h>
1010

1111
#include <algorithm>
1212
#include <string>

examples/models/flamingo/cross_attention/cross_attention_mask_test.cpp renamed to examples/models/llama3_2_mm/cross_attention/cross_attention_mask_test.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* LICENSE file in the root directory of this source tree.
77
*/
88

9-
#include <executorch/examples/models/flamingo/cross_attention/cross_attention_mask.h>
9+
#include <executorch/examples/models/llama3_2_mm/cross_attention/cross_attention_mask.h>
1010

1111
#include <gtest/gtest.h>
1212

examples/models/flamingo/preprocess/export_preprocess.py renamed to examples/models/llama3_2_mm/preprocess/export_preprocess.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# LICENSE file in the root directory of this source tree.
66

77
import torch
8-
from executorch.examples.models.flamingo.preprocess.export_preprocess_lib import (
8+
from executorch.examples.models.llama3_2_mm.preprocess.export_preprocess_lib import (
99
export_preprocess,
1010
get_example_inputs,
1111
lower_to_executorch_preprocess,

examples/models/flamingo/preprocess/preprocess.cpp renamed to examples/models/llama3_2_mm/preprocess/preprocess.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* LICENSE file in the root directory of this source tree.
77
*/
88

9-
#include "executorch/examples/models/flamingo/preprocess/preprocess.h"
9+
#include "executorch/examples/models/llama3_2_mm/preprocess/preprocess.h"
1010

1111
#include <algorithm>
1212
#include <cassert>

examples/models/flamingo/preprocess/preprocess_test.cpp renamed to examples/models/llama3_2_mm/preprocess/preprocess_test.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* LICENSE file in the root directory of this source tree.
77
*/
88

9-
#include <executorch/examples/models/flamingo/preprocess/preprocess.h>
9+
#include <executorch/examples/models/llama3_2_mm/preprocess/preprocess.h>
1010
#include <gtest/gtest.h>
1111

1212
using namespace ::testing;

examples/selective_build/test_selective_build.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@ test_buck2_select_ops_in_list() {
4848
${PYTHON_EXECUTABLE} -m examples.portable.scripts.export --model_name="add_mul"
4949

5050
echo "Running selective build test"
51-
# set max_kernel_num=21: 19 primops, add, mul
51+
# set max_kernel_num=22: 19 primops, add, mul
5252
$BUCK run //examples/selective_build:selective_build_test \
53-
--config=executorch.max_kernel_num=21 \
53+
--config=executorch.max_kernel_num=22 \
5454
--config=executorch.select_ops=list \
5555
-- --model_path=./add_mul.pte
5656

@@ -117,11 +117,11 @@ test_cmake_select_ops_in_list() {
117117

118118
local example_dir=examples/selective_build
119119
local build_dir=cmake-out/${example_dir}
120-
# set MAX_KERNEL_NUM=21: 19 primops, add, mul
120+
# set MAX_KERNEL_NUM=22: 19 primops, add, mul
121121
rm -rf ${build_dir}
122122
retry cmake -DBUCK2="$BUCK" \
123123
-DCMAKE_BUILD_TYPE=Release \
124-
-DMAX_KERNEL_NUM=21 \
124+
-DMAX_KERNEL_NUM=22 \
125125
-DEXECUTORCH_SELECT_OPS_LIST="aten::convolution.out,\
126126
aten::_native_batch_norm_legit_no_training.out,aten::hardtanh.out,aten::add.out,\
127127
aten::mean.out,aten::view_copy.out,aten::permute_copy.out,aten::addmm.out,\

exir/backend/test/demos/rpc/ExecutorBackend.cpp

Lines changed: 29 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,30 @@
2121
#include <executorch/runtime/executor/method.h>
2222
#include <executorch/runtime/executor/program.h>
2323

24-
namespace torch {
25-
namespace executor {
24+
using ::executorch::aten::Tensor;
25+
using ::executorch::extension::BufferDataLoader;
26+
using ::executorch::runtime::ArrayRef;
27+
using ::executorch::runtime::Backend;
28+
using ::executorch::runtime::BackendExecutionContext;
29+
using ::executorch::runtime::BackendInitContext;
30+
using ::executorch::runtime::CompileSpec;
31+
using ::executorch::runtime::DelegateHandle;
32+
using ::executorch::runtime::Error;
33+
using ::executorch::runtime::EValue;
34+
using ::executorch::runtime::FreeableBuffer;
35+
using ::executorch::runtime::HierarchicalAllocator;
36+
using ::executorch::runtime::MemoryAllocator;
37+
using ::executorch::runtime::MemoryManager;
38+
using ::executorch::runtime::Method;
39+
using ::executorch::runtime::MethodMeta;
40+
using ::executorch::runtime::Program;
41+
using ::executorch::runtime::Result;
42+
using ::executorch::runtime::Span;
43+
using ::executorch::runtime::Tag;
44+
using ::executorch::runtime::internal::copy_tensor_data;
45+
46+
namespace example {
47+
2648
/**
2749
* ExecutorBackend is a backend to execute an executorch program via delegate.
2850
* In preprocess, the preprocesed bytes (delegate blob) is an executorch
@@ -51,8 +73,8 @@ class ExecutorBackend final : public ::executorch::runtime::BackendInterface {
5173
// will return the data directly without copying it.
5274
MemoryAllocator* runtime_allocator = context.get_runtime_allocator();
5375
auto loader = ET_ALLOCATE_INSTANCE_OR_RETURN_ERROR(
54-
runtime_allocator, util::BufferDataLoader);
55-
new (loader) util::BufferDataLoader(processed->data(), processed->size());
76+
runtime_allocator, BufferDataLoader);
77+
new (loader) BufferDataLoader(processed->data(), processed->size());
5678
// Can't free `processed` because the program will point into that memory.
5779

5880
// Try loading the program.
@@ -150,7 +172,7 @@ class ExecutorBackend final : public ::executorch::runtime::BackendInterface {
150172
if (output.tag == Tag::Tensor) {
151173
Tensor t_src = output.toTensor();
152174
Tensor t_dst = args[num_inputs + i]->toTensor();
153-
status = internal::copy_tensor_data(t_dst, t_src);
175+
status = copy_tensor_data(t_dst, t_src);
154176
}
155177
}
156178

@@ -165,12 +187,11 @@ class ExecutorBackend final : public ::executorch::runtime::BackendInterface {
165187
}
166188
};
167189

168-
Error registerExecutorBackend() {
190+
Error register_executor_backend() {
169191
static auto cls = ExecutorBackend();
170192
static Backend backend{"ExecutorBackend", &cls};
171193
static auto success_with_compiler = register_backend(backend);
172194
return success_with_compiler;
173195
}
174196

175-
} // namespace executor
176-
} // namespace torch
197+
} // namespace example

exir/backend/test/demos/rpc/ExecutorBackend.h

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,8 @@
1010

1111
#include <executorch/runtime/core/error.h>
1212

13-
namespace torch {
14-
namespace executor {
13+
namespace example {
1514

16-
Error registerExecutorBackend();
15+
::executorch::runtime::Error register_executor_backend();
1716

18-
} // namespace executor
19-
} // namespace torch
17+
} // namespace example

exir/backend/test/demos/rpc/ExecutorBackendRegister.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,9 @@
1010
#include <executorch/runtime/backend/interface.h>
1111
#include <executorch/runtime/core/error.h>
1212

13-
namespace torch {
14-
namespace executor {
13+
namespace example {
1514
namespace {
16-
static Error register_success = registerExecutorBackend();
15+
static ::executorch::runtime::Error register_success =
16+
register_executor_backend();
1717
} // namespace
18-
} // namespace executor
19-
} // namespace torch
18+
} // namespace example

extension/apple/Benchmark/Benchmark.xcodeproj/project.pbxproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
03B0118E2CAC567900054791 /* DynamicTestCase.m in Sources */ = {isa = PBXBuildFile; fileRef = 03B0118C2CAC567900054791 /* DynamicTestCase.m */; };
1212
03B011912CAD114E00054791 /* ResourceTestCase.m in Sources */ = {isa = PBXBuildFile; fileRef = 03B011902CAD114E00054791 /* ResourceTestCase.m */; };
1313
03B2D37A2C8A515C0046936E /* GenericTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = 03B2D3792C8A515C0046936E /* GenericTests.mm */; };
14-
03C7FA382C8AA3EC00E6E9AE /* Models in Resources */ = {isa = PBXBuildFile; fileRef = 03C7FA322C8AA24200E6E9AE /* Models */; };
14+
03C7FA382C8AA3EC00E6E9AE /* Resources in Resources */ = {isa = PBXBuildFile; fileRef = 03C7FA322C8AA24200E6E9AE /* Resources */; };
1515
03DD00A92C8FE44600FE4619 /* backend_coreml.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 03DD00992C8FE44600FE4619 /* backend_coreml.xcframework */; };
1616
03DD00AA2C8FE44600FE4619 /* kernels_custom.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 03DD009A2C8FE44600FE4619 /* kernels_custom.xcframework */; };
1717
03DD00AF2C8FE44600FE4619 /* kernels_portable.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 03DD009F2C8FE44600FE4619 /* kernels_portable.xcframework */; };
@@ -50,7 +50,7 @@
5050
03B0118F2CAD114E00054791 /* ResourceTestCase.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ResourceTestCase.h; sourceTree = "<group>"; };
5151
03B011902CAD114E00054791 /* ResourceTestCase.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ResourceTestCase.m; sourceTree = "<group>"; };
5252
03B2D3792C8A515C0046936E /* GenericTests.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = GenericTests.mm; sourceTree = "<group>"; };
53-
03C7FA322C8AA24200E6E9AE /* Models */ = {isa = PBXFileReference; lastKnownFileType = folder; path = Models; sourceTree = SOURCE_ROOT; };
53+
03C7FA322C8AA24200E6E9AE /* Resources */ = {isa = PBXFileReference; lastKnownFileType = folder; path = Resources; sourceTree = SOURCE_ROOT; };
5454
03DD00992C8FE44600FE4619 /* backend_coreml.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = backend_coreml.xcframework; path = Frameworks/backend_coreml.xcframework; sourceTree = "<group>"; };
5555
03DD009A2C8FE44600FE4619 /* kernels_custom.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = kernels_custom.xcframework; path = Frameworks/kernels_custom.xcframework; sourceTree = "<group>"; };
5656
03DD009F2C8FE44600FE4619 /* kernels_portable.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = kernels_portable.xcframework; path = Frameworks/kernels_portable.xcframework; sourceTree = "<group>"; };
@@ -105,7 +105,7 @@
105105
children = (
106106
03B2D3662C8A515A0046936E /* App */,
107107
03ED6CEB2C8AAF5300F2D6EE /* Frameworks */,
108-
03C7FA322C8AA24200E6E9AE /* Models */,
108+
03C7FA322C8AA24200E6E9AE /* Resources */,
109109
03B2D3782C8A515C0046936E /* Tests */,
110110
03B0118D2CAC567900054791 /* TestUtils */,
111111
03B2D3652C8A515A0046936E /* Products */,
@@ -261,7 +261,7 @@
261261
isa = PBXResourcesBuildPhase;
262262
buildActionMask = 2147483647;
263263
files = (
264-
03C7FA382C8AA3EC00E6E9AE /* Models in Resources */,
264+
03C7FA382C8AA3EC00E6E9AE /* Resources in Resources */,
265265
);
266266
runOnlyForDeploymentPostprocessing = 0;
267267
};
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!/bin/bash
2+
# Copyright (c) Meta Platforms, Inc. and affiliates.
3+
# All rights reserved.
4+
#
5+
# This source code is licensed under the BSD-style license found in the
6+
# LICENSE file in the root directory of this source tree.
7+
8+
frameworks=(
9+
"backend_coreml"
10+
"backend_mps"
11+
"backend_xnnpack"
12+
"executorch"
13+
"kernels_custom"
14+
"kernels_optimized"
15+
"kernels_portable"
16+
"kernels_quantized"
17+
)
18+
19+
for framework in "${frameworks[@]}"; do
20+
rm -f "${f}-latest.zip"
21+
rm -rf "${f}.xcframework"
22+
curl -sSLO "https://ossci-ios.s3.amazonaws.com/executorch/${framework}-latest.zip" && \
23+
unzip -q "${framework}-latest.zip" && \
24+
rm "${framework}-latest.zip"
25+
done
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Resources
2+
3+
This directory and all files in it will be copied to the bundle’s resources directory, accessible via `NSBundle.resourcePath`.
4+
Place any resource files you want to access at runtime here.

extension/apple/Benchmark/Tests/GenericTests.mm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ @implementation GenericTests
2929

3030
+ (NSArray<NSString *> *)directories {
3131
return @[
32-
@"Models",
33-
@"aatp/data",
32+
@"Resources",
33+
@"aatp/data", // AWS Farm devides look at this subdirectory.
3434
];
3535
}
3636

0 commit comments

Comments
 (0)