Commit 25822ee
committed
Update on "[Executorch][target recipes] Add target based recipes for lowering models to a target device"
This diff introduces multi backend/ target based recipes to lower a model with very less code. Target recipes provide pre-configured backend recipes to use them and retarget if needed.
See RFC: #13732
## Usage
```
from executorch.export import export, ExportRecipe, IOSTargetRecipeType
# CoreML + XNNPACK
coreml_xnnpack_recipe = ExportRecipe.get_recipe(IOSTargetRecipeType.IOS_ARM64_COREML_FP32)
session = export(model, coreml_xnnpack_recipe, example_inputs)
session.save_pte_file("model.pte")
```
## Advanced usage
one can directly use `ExportRecipe.combine_recipes()` to combine specific backend recipes.
```
recipe1 = ExportRecipe.get_recipe(AndroidRecipeType.XYZ)
recipe2 = ExportRecipe.get_recipe(XNNPackRecipeType.FP32)
combined_recipe = ExportRecipe.combine(
[recipe1, recipe2],
recipe_name="multi_backend_coreml_xnnpack_fp32"
)
session = export(model, combined_recipe, example_inputs)
```
Fixes: #13732
Differential Revision: [D81297451](https://our.internmc.facebook.com/intern/diff/D81297451/)
[ghstack-poisoned]File tree
191 files changed
+9312
-1964
lines changed- .ci/scripts
- .github/workflows
- backends
- apple
- coreml
- recipes
- test
- mps/serialization
- arm
- operator_support
- scripts
- test
- misc
- models
- stable_diffusion
- ops
- tester
- tosa/dialect/ops
- cadence/aot
- tests
- cortex_m
- ops
- passes
- test
- nxp
- backend/ir/tflite_optimizer
- optimizations
- tests
- openvino
- qualcomm
- _passes
- builders
- partition
- quantizer
- scripts
- serialization
- tests
- utils
- vulkan
- runtime
- api
- graph
- vk_api
- serialization
- test/custom_ops
- glsl
- impl
- xnnpack
- recipes
- serialization
- test
- recipes
- devtools
- bundled_program/serialize
- etdump
- examples
- arm
- executor_runner
- demo-apps
- android/LlamaDemo
- gradle/wrapper
- apple_ios/LLaMA/LLaMA.xcodeproj
- models
- llama
- nxp
- qualcomm/oss_scripts
- llm_utils
- qwen2_5
- exir
- dialects/edge
- serde
- tests
- export
- multi_backend_recipes
- tests
- extension
- android
- executorch_android
- jni
- apple/ExecuTorch/Exported
- flat_tensor/serialize
- llm
- runner
- sampler
- tensor
- kernels
- optimized/cpu
- portable/cpu
- test
- runtime/core/exec_aten/util
- scripts
- shim_et/xplat/executorch/kernels/optimized
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
191 files changed
+9312
-1964
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
46 | | - | |
| 46 | + | |
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
19 | 20 | | |
20 | 21 | | |
21 | 22 | | |
| |||
83 | 84 | | |
84 | 85 | | |
85 | 86 | | |
| 87 | + | |
| 88 | + | |
86 | 89 | | |
87 | 90 | | |
88 | 91 | | |
89 | | - | |
| 92 | + | |
90 | 93 | | |
91 | 94 | | |
92 | 95 | | |
93 | 96 | | |
94 | 97 | | |
95 | 98 | | |
96 | 99 | | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
97 | 110 | | |
98 | 111 | | |
99 | 112 | | |
| |||
106 | 119 | | |
107 | 120 | | |
108 | 121 | | |
109 | | - | |
| 122 | + | |
110 | 123 | | |
111 | 124 | | |
112 | 125 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
416 | 416 | | |
417 | 417 | | |
418 | 418 | | |
419 | | - | |
| 419 | + | |
420 | 420 | | |
421 | 421 | | |
422 | 422 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
52 | | - | |
| 52 | + | |
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
| |||
136 | 136 | | |
137 | 137 | | |
138 | 138 | | |
139 | | - | |
| 139 | + | |
140 | 140 | | |
141 | 141 | | |
142 | 142 | | |
| |||
276 | 276 | | |
277 | 277 | | |
278 | 278 | | |
279 | | - | |
| 279 | + | |
280 | 280 | | |
281 | 281 | | |
282 | 282 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
| 25 | + | |
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
66 | | - | |
| 66 | + | |
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
855 | 855 | | |
856 | 856 | | |
857 | 857 | | |
858 | | - | |
| 858 | + | |
| 859 | + | |
859 | 860 | | |
860 | 861 | | |
861 | 862 | | |
862 | 863 | | |
863 | 864 | | |
864 | | - | |
| 865 | + | |
865 | 866 | | |
866 | 867 | | |
867 | 868 | | |
| |||
901 | 902 | | |
902 | 903 | | |
903 | 904 | | |
| 905 | + | |
| 906 | + | |
| 907 | + | |
| 908 | + | |
| 909 | + | |
| 910 | + | |
| 911 | + | |
| 912 | + | |
| 913 | + | |
| 914 | + | |
| 915 | + | |
| 916 | + | |
| 917 | + | |
| 918 | + | |
| 919 | + | |
| 920 | + | |
| 921 | + | |
| 922 | + | |
| 923 | + | |
| 924 | + | |
| 925 | + | |
| 926 | + | |
| 927 | + | |
| 928 | + | |
| 929 | + | |
| 930 | + | |
| 931 | + | |
| 932 | + | |
904 | 933 | | |
905 | 934 | | |
906 | 935 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
435 | 435 | | |
436 | 436 | | |
437 | 437 | | |
438 | | - | |
| 438 | + | |
439 | 439 | | |
440 | 440 | | |
441 | 441 | | |
| |||
940 | 940 | | |
941 | 941 | | |
942 | 942 | | |
| 943 | + | |
| 944 | + | |
| 945 | + | |
| 946 | + | |
| 947 | + | |
| 948 | + | |
| 949 | + | |
| 950 | + | |
| 951 | + | |
| 952 | + | |
| 953 | + | |
| 954 | + | |
| 955 | + | |
| 956 | + | |
| 957 | + | |
| 958 | + | |
| 959 | + | |
| 960 | + | |
| 961 | + | |
| 962 | + | |
| 963 | + | |
| 964 | + | |
| 965 | + | |
| 966 | + | |
| 967 | + | |
| 968 | + | |
| 969 | + | |
| 970 | + | |
| 971 | + | |
| 972 | + | |
| 973 | + | |
| 974 | + | |
| 975 | + | |
| 976 | + | |
| 977 | + | |
| 978 | + | |
| 979 | + | |
| 980 | + | |
| 981 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
582 | 582 | | |
583 | 583 | | |
584 | 584 | | |
585 | | - | |
586 | 585 | | |
587 | 586 | | |
588 | 587 | | |
| |||
649 | 648 | | |
650 | 649 | | |
651 | 650 | | |
652 | | - | |
653 | 651 | | |
654 | 652 | | |
655 | 653 | | |
| |||
968 | 966 | | |
969 | 967 | | |
970 | 968 | | |
| 969 | + | |
| 970 | + | |
| 971 | + | |
| 972 | + | |
971 | 973 | | |
972 | 974 | | |
973 | 975 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
| |||
111 | 112 | | |
112 | 113 | | |
113 | 114 | | |
114 | | - | |
115 | | - | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
116 | 118 | | |
117 | 119 | | |
118 | 120 | | |
| |||
0 commit comments