Repository navigation
Espressif: Add ESP-IDF component template for ExecuTorch - #24292
Merged
Merged
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/24292
Note: Links to docs will display an error until the docs builds have been completed. ❌ 1 New Failure, 3 Pending, 2 Unclassified FailuresAs of commit 000859e with merge base 822cb60 ( NEW FAILURE - The following job has failed:
UNCLASSIFIED FAILURES - DrCI could not classify the following jobs because the workflow did not run on the merge base. The failures may be pre-existing on trunk or introduced by this PR:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
JakeStevens
force-pushed
the
espressif-idf-template
branch
4 times, most recently
from
October 30, 2026 18:10
f824807 to
b2a15ff
Compare
JakeStevens
marked this pull request as ready for review
October 30, 2026 20:41
rascani
approved these changes
Oct 30, 2026
JakeStevens
force-pushed
the
espressif-idf-template
branch
from
November 2, 2026 18:16
b2a15ff to
6eff9fb
Compare
Add the hand-written glue the component generator (next PR) stamps out: a registry-shaped CMakeLists.txt gated by CONFIG_ET_ENABLE with WHOLE_ARCHIVE kernel registration and size options (-Os, program verification, debug asserts, kernel registry size), the idf_component.yml and README templates, and et_model, a small C inference API over Program/Method whose method, planned and optional scratch arenas are caller-provided or placed with heap_caps. The component carries only the core runtime and BufferDataLoader, and the shared PAL is copied in by the generator rather than forked here. Authored with AI assistance using Claude Code.
JakeStevens
force-pushed
the
espressif-idf-template
branch
from
November 2, 2026 18:32
6eff9fb to
000859e
Compare
JakeStevens
added a commit
that referenced
this pull request
Nov 3, 2026
…#24293) ### Summary Add `examples/espressif/build_idf_component.sh`, which generates a source-vendored, registry-shaped ESP-IDF component from this repository, following the same approach as the Arduino library packaging but with an ESP-IDF layout. The generator produces the schema headers, vendors the runtime and needed kernel sources (using the same `build_variables.bzl` lists as the CMake build), copies the component template from #24292 and the shared PAL from #24291, and writes `et_generated.cmake`, `Kconfig`, `idf_component.yml`, licenses, and a `VERSION` file recording the ExecuTorch commit and per-profile op-set hashes. Kernel registration is generated per profile in `idf_profiles/<name>.ops`; the component's Kconfig selects which profile compiles, so switching profiles needs no regeneration. This PR ships one example profile, `wakeword_int8`, which mixes portable ATen glue ops with Cadence backend generic (portable) int8 kernels. Consumers of the generated component need only ESP-IDF — no host CMake build and no `flatc`. Application code and models are not included; they stay with the application. Stacked on #24292 ### Test plan - Generated the component: `./examples/espressif/build_idf_component.sh --profiles wakeword_int8 --out /tmp/et-idf-out` (component version `1.6.0~3`, 80 sources / 292 headers; the known exporter/runtime version-skew warning is printed when the installed Python package was built from a different commit). - Verified the generated `src/platform/esp_pal.cpp` is byte-identical to `examples/espressif/platform/esp_pal.cpp` (`cmp`). - Built a minimal ESP-IDF consumer that vendors the generated component and calls `et_model_create`, for `esp32s3` and `esp32c5` with ESP-IDF v6.0.1 (`idf.py set-target <target> build`); both complete with `Project build complete`. - Ran end to end on Muse Gadget SDK w/ Box 3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add the "hand-written" template for a generated ExecuTorch ESP-IDF
component.
This contains only the component glue that is copied into generated
output: the component
CMakeLists.txt, manifest template, README,the small C inference API in
et_model.h/et_model.cpp, and theESP-IDF
MmapDataLoaderstub (ESP-IDF has nommap). It deliberatelydoes not carry a PAL copy; the generator in the next PR copies the
shared PAL from #24291.
Splitting the template out keeps the hand-written runtime glue
reviewable separately from the generator and its vendored output.
On its own this PR is inert:
et_generated.cmakeandKconfigareTest plan
template and built a minimal ESP-IDF consumer that calls
et_model_createforesp32s3andesp32c5with ESP-IDF v6.0.1;both builds complete.
component's
src/platform/esp_pal.cppis byte-identical to theshared PAL from Espressif: Share one ESP-IDF PAL across examples #24291.