We welcome contributions to extend the functionality of ExecuTorch export. This guide provides high-level instructions for contributors who want to:
If you want to export a model that is not already supported by the library, follow these steps:
.pte
file.my_new_model
by running:
pytest tests/executorch/export/test_*.py -k "test_my_new_model" # doctest: +SKIP
pytest tests/executorch/runtime/test_*.py -k "test_my_new_model" # doctest: +SKIP
To extend ExecuTorch with new recipes or tasks, follow these guidelines:
You can add a custom recipe to define specific optimizations or configurations for exporting models. Below is an example:
from exporters.executorch import register_recipe
@register_recipe("my_custom_recipe")
def export_with_custom_recipe(model, config, *args, **kwargs):
# Example: Apply a custom quantization
The task registration process is same as adding a recipe. Besides that you may need to implement a new ExecuTorchModelForXXX
class.