Commit a541d90
committed
Update base for 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]1 parent 8c0102d commit a541d90
File tree
0 file changed
+0
-0
lines changed0 file changed
+0
-0
lines changed
0 commit comments