Skip to content

Commit 6b6a64f

Browse files
committed
Add FAQs and Common Issues doc page
1 parent 4796da7 commit 6b6a64f

File tree

2 files changed

+51
-1
lines changed

2 files changed

+51
-1
lines changed

docs/source/getting-started-faqs.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# FAQs and Common Issues
2+
3+
This page summarizes frequently asked questions and provides guidance on issues that commonly occur when adopting ExecuTorch.
4+
5+
## Export
6+
7+
### Missing out variants: { _ }
8+
9+
The model likely contains torch custom operators. Custom ops need an Executorch implementation and need to be loaded at export time. See the [ExecuTorch Custom Ops Documentation](https://pytorch.org/executorch/main/kernel-library-custom-aten-kernel.html#apis) for details on how to do this.
10+
11+
### RuntimeError: PyTorch convert function for op _ not implemented
12+
13+
The model likely contains an operator that is not yet supported on ExecuTorch. In this case, consider search for or creating an issue on [GitHub](https://github.com/pytorch/executorch/issues).
14+
15+
## Runtime
16+
17+
ExecuTorch error codes are defined in [executorch/core/runtime/error.h](https://github.com/pytorch/executorch/blob/main/runtime/core/error.h).
18+
19+
### Inference is Slow / Performance Troubleshooting
20+
21+
If building the runtime from source, ensure that the build is done in release mode. For CMake builds, this can be done by passing `-DCMAKE_BUILD_TYPE=Release`.
22+
23+
Ensure the model is delegated. If not targeting a specific accelerator, use the XNNPACK delegate for CPU performance. Undelegated operators will typically fall back to the ExecuTorch portable library, which is designed as a fallback, and is not intended for performance sensitive operators. To target XNNPACK, pass an `XnnpackPartitioner` to `to_edge_transform_and_lower`. See [Building and Running ExecuTorch with XNNPACK Backend](https://pytorch.org/executorch/main/tutorial-xnnpack-delegate-lowering.html) for more information.
24+
25+
Thread count can have a significant impact on CPU performance. The optimal thread count may depend on the model and application. By default, ExecuTorch will currently use as many threads as there are cores. Consider setting the thread count to cores / 2, or just set to 4 on mobile CPUs.
26+
27+
Thread count can be set with the following function. Ensure this is done prior to loading or running a model.
28+
```
29+
::executorch::extension::threadpool::get_threadpool()->_unsafe_reset_threadpool(num_threads);
30+
```
31+
32+
We are actively working to improve the out-of-box behavior, but the above APIs can be used to improve mobile performance as workaround until deeper changes for performant core detection land.
33+
34+
### Error setting input: 0x10 / Attempted to resize a bounded tensor...
35+
36+
This usually means the inputs provided do not match the shape of the example inputs used during model export. If the model is expected to handle varying size inputs (dynamic shapes), make sure the model export specifies the appropriate bounds. See [Expressing Dynamism](https://pytorch.org/docs/stable/export.html#expressing-dynamism) for more information on specifying dynamic shapes.
37+
38+
### Error 0x14 (Operator Missing)
39+
40+
This usually means that the selective build configuration is incorrect. Ensure that the operator library is generated from the current version of the model and the corresponding `et_operator_library` is a dependency of the app-level `executorch_generated_lib` and the generated lib is linked into the application.
41+
42+
This can also occur if the ExecuTorch portable library does not yet have an implementation of the given ATen operator. In this case, consider search for or creating an issue on [GitHub](https://github.com/pytorch/executorch/issues).
43+
44+
### Error 0x20 (Not Found)
45+
46+
This error can occur for a few reasons, but the most common is a missing backend target. Ensure the appropriate backend target is linked. For XNNPACK, this is `xnnpack_backend`.
47+
48+
### Duplicate Kernel Registration Abort
49+
50+
This manifests as a crash call stack including ExecuTorch kernel registration and failing with an `et_pal_abort`. This typically means there are multiple `gen_operators_lib` targets linked into the applications. There must be only one generated operator library per target, though each model can have its own `gen_selected_ops/generate_bindings_for_kernels` call.

docs/source/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ Topics in this section will help you get started with ExecuTorch.
8787
getting-started-setup
8888
export-overview
8989
runtime-build-and-cross-compilation
90-
90+
getting-started-faqs
9191

9292
.. toctree::
9393
:glob:

0 commit comments

Comments
 (0)