-
Notifications
You must be signed in to change notification settings - Fork 594
Backend doc template #8524
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Backend doc template #8524
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/8524
Note: Links to docs will display an error until the docs builds have been completed. This comment was automatically generated by Dr. CI and updates every 15 minutes. |
eac2994
to
bf938cc
Compare
Tentatively merging this to unblock doc work. Feel free to leave comments and I will address as a follow-up. |
6ab321a
into
pytorch:executorch-just-works
@@ -1,146 +1,69 @@ | |||
# XNNPACK Backend | |||
|
|||
This is a high-level overview of the ExecuTorch XNNPACK backend delegate. This high performance delegate is aimed to reduce CPU inference latency for ExecuTorch models. We will provide a brief introduction to the XNNPACK library and explore the delegate’s overall architecture and intended use cases. | |||
The XNNPACK delegate is the ExecuTorch solution for CPU execution on mobile CPUs. XNNPACK is a library that provides optimized kernels for machine learning operators on Arm and x86 CPUs. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reference to https://github.com/google/XNNPACK
@@ -1,146 +1,69 @@ | |||
# XNNPACK Backend | |||
|
|||
This is a high-level overview of the ExecuTorch XNNPACK backend delegate. This high performance delegate is aimed to reduce CPU inference latency for ExecuTorch models. We will provide a brief introduction to the XNNPACK library and explore the delegate’s overall architecture and intended use cases. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are a lot of good content in this old document. But I agree that it is not really relevant for users, mainly around implementation details. So it's good that we made it crisper.
I would actually preserve a lot of the old documents (https://pytorch.org/executorch/stable/native-delegates-executorch-xnnpack-delegate.html) and move to "Backend Development" section. XNNPACK delegate is the most mature backend, and serve as a good reference implementation for new backends.
Maybe call it "Backend Development: Case study on XNNPACK" or something like that.
cc @digantdesai
.set_object_type(torch.nn.functional.linear, quantization_config) # or torch functional op typea | ||
.set_module_name("foo.bar", quantization_config) # or by module fully qualified name | ||
``` | ||
The XNNPACK delegate is included by default in the published Android, iOS, and pip packages. When building from source, pass `-DEXECUTORCH_BUILD_XNNPACK=ON` when configuring the CMake build to compile the XNNPACK backend. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This section really needs to be improved. Having three reference implementations:
- CMake file for C++
- iOS
- Android
print(quantized_model) | ||
``` | ||
You will now see the Q/DQ representation of the model, which means `torch.ops.quantized_decomposed.dequantize_per_tensor` are inserted at quantized operator inputs and `torch.ops.quantized_decomposed.quantize_per_tensor` are inserted at operator outputs. Example: | ||
### Runner |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of calling "Runner", maybe call "Testing"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, before testing in C++, can you add testing via pybind section?
Add backend template, update XNNPACK docs
Add backend template, update XNNPACK docs
Add backend template, update XNNPACK docs
* New Getting Started documentation (#8179) WIP New getting started * Update documentation flow and add placeholders (#8287) Add placeholder top-level doc pages * Add new export + lowering docs, update getting started (#8412) Write new top-level export and lowering documentation * More doc placeholders (#8523) * Move cmake and faq docs to new location * Rename CMake build to Building from Source * Move backend docs to new locations (#8413) * Temporarily remove new backend pages * Move backend docs to new locations * Update backend titles and inline contents * Backend doc template (#8524) Add backend template, update XNNPACK docs * Add runtime integration documentation (#8516) Add runtime integration doc * Move iOS docs to top, add Android placeholders (#8511) * Temporarily remove using-executorch-ios.md * Move Apple runtime docs to new location * Clean up documentation placeholders and links, add top-level docs for C++ APIs, Android, and troubleshooting (#8618) * Clean up getting-started.md, remove placeholders * Move Android pre-built AAR info into top-level Android page * Add placeholder backend overview * Add placeholder troubleshooting docs * Populate top-level C++ API doc * Clean up additional doc placeholders and fix broken links * Add env setup instructions for source build * Fix getting started code snippet (#8637) Fix quotes in getting started code snippets * Clean up a few more doc sections and links (#8672) Clean up a few more broken links and sections in new doc flow * Fix QNN link, typo (#8729) * Add a CMake snippet to the XNNPACK backend doc build section (#8730) Add CMake example to xnnpack backend doc
Summary
Add a template for backend docs under Backends/. Update XNNPACK doc to follow the new template.
Test plan
Built docs locally.