Skip to content

[Espressif] Add TorchVision model coverage - #26021

Open
rascani wants to merge 3 commits into
codex/espressif-pooling-domainsfrom
codex/espressif-model-coverage
Open

rascani wants to merge 3 commits into
codex/espressif-pooling-domainsfrom
codex/espressif-model-coverage

Conversation

@rascani

@rascani rascani commented Dec 3, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Expand Espressif operator-library coverage beyond MLPerf Tiny with MobileNetV2, MobileNetV3 Small, ShuffleNetV2 x0.5, and SqueezeNet 1.1. Each model has before/after operator expectations, a dialect/serialization test, and an implementation test using the existing ESP runner. Models use standard 1,000-class outputs, seeded synthetic weights and inputs, and 96×96 images. The fixtures require ESP-NN scratch bindings and reuse the same coverage and serialization checks as the MLPerf Tiny tests.

The two MobileNet firmware images exceed the example's default app-slot capacity. Add an explicit 5 MiB single-app test partition table within 8 MiB flash, selected only by those tests, and isolate firmware build directories by partition configuration. The default dual-OTA table is unchanged. Update SPIFFS instructions to look up storage size and address from the generated partition table.

Measured coverage:

Model ESP operator calls Remaining internal float compute
MobileNetV2 64 None
MobileNetV3 Small 107 None
ShuffleNetV2 x0.5 59 Concat, channel-shuffle, and slice regions
SqueezeNet 1.1 27 Three ceil-mode max pools

These tests cover graph lowering, serialization, and execution. The review panel identified a numerical-coverage limitation in the normal seeded fixtures: both MobileNet outputs are zero, and ShuffleNet's final mean collapses to zero before the classifier. Their final-output comparisons therefore cannot catch all internal arithmetic or input-data regressions. Stronger numerical model fixtures remain a follow-up.

Stacks on #26019.

Test plan

All eight MLPerf Tiny and TorchVision dialect/serialization cases passed with the shared coverage helper. With scratch bindings enabled and the existing optimized ESP32-S3 runtime:

python -m pytest -q \
  backends/espressif/test/models/test_mobilenet_v2.py \
  backends/espressif/test/models/test_mobilenet_v3.py \
  backends/espressif/test/models/test_shufflenet_v2.py \
  backends/espressif/test/models/test_squeezenet.py \
  -k implementation

4 passed, with two inferences per model. Generated firmware tables confirmed that MobileNet uses the 5 MiB app and the other models use the default OTA layout. Partition parsing and the README's SPIFFS size lookup and image generation were checked. Formatting, flake8, and git diff --check passed. Three independent agent reviews found the numerical-coverage limitation above and no other actionable issues.

Local validation used Torch 2.13.0, TorchVision 0.28.0, the repository's TorchAO source pin, and ESP-NN 1.5.0. The newer repository-pinned Torch/TorchVision versions and P4/S31 or physical-device execution have not been validated locally.

Authored with AI assistance using Codex.

@pytorch-bot

pytorch-bot Bot commented Dec 3, 2026 •

Copy link
Copy Markdown

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/26021

Note: Links to docs will display an error until the docs builds have been completed.

❌ 7 Cancelled Jobs, 27 Pending, 1 Unclassified Failure

As of commit 88de827 with merge base b2e7366 (image):

UNCLASSIFIED FAILURE - DrCI could not classify the following job because the workflow did not run on the merge base. The failure may be pre-existing on trunk or introduced by this PR:

CANCELLED JOBS - The following jobs were cancelled. Please retry:

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Dec 3, 2026
@rascani
rascani added this pull request to stack #25605 December 3, 2026 22:04
@rascani

rascani commented Dec 3, 2026

Copy link
Copy Markdown
Contributor Author

@claude review effort=max

@claude

claude Bot commented Dec 3, 2026 •

Copy link
Copy Markdown

Claude finished @rascani's task in 36m 28s —— View job


PR #26021 review

The new tests add lowering, serialization and emulator coverage for four TorchVision models, but three of the four compare constant outputs and none of them assert the exact operator coverage the PR description reports, so I'm requesting changes.

Detailed review

PR Review: #26021

Summary

The PR adds dialect, serialization and emulator tests for MobileNetV2, MobileNetV3-Small, ShuffleNetV2 x0.5 and SqueezeNet 1.1. It also adds a 5 MiB single-app partition table, which only the two MobileNet tests select. There are two main problems:

  • Nothing enforces the coverage table in the description.
  • Three of the four numerical checks compare a constant.

All 7 changed files were reviewed.

Infrastructure

  • backends/espressif/test/tester.py:185-189, test_mobilenet_v2.py:64, test_mobilenet_v3.py:69: per-test partition tables add a second firmware tree to every optimized emulator job. (minor)
    • The implementation run doesn't use xdist (.ci/scripts/test_espressif.sh:198-201). The new operator-library-main-partitions_large_models-<target>-optimized directory therefore costs one more from-scratch ESP-IDF build per job.
    • Question for the author (storage):
      • collect_artifacts (test_espressif.sh:49-61) copies the .pte, .bpte, ELF, merged binary and logs from each operator-library-* directory into test-report-<target>-<kernels>.
      • test-espressif.yml:83 uploads that to GitHub storage, not S3, and nothing in .github/ downloads it.
      • The new directory adds roughly 15 MB per optimized job, about 45 MB per run: the ~2.7 MB MobileNetV3-Small program is stored in all four of those files. This happens on every matching push and PR, plus the weekly cron.
      • If the files are only kept for debugging (test_espressif.sh:197), could this job use upload-artifact-to-s3: true, as nightly-espressif-idf.yml:110 does on the same runner?
    • Using one table for all operator-library firmware avoids both costs and removes the parameter:
      • The runner never uses OTA: there are no esp_ota calls under examples/espressif/.
      • The smoke and ESP-NN builds (test_espressif.sh:113-124, 149-167) keep exercising the default partitions.csv.
      • Future large models then work without callers having to know that partition_table is a bare filename that ESP-IDF resolves against examples/espressif/project/.
      • An existing sdkconfig takes precedence over the defaults files, so rename the directory prefix once; otherwise stale local build directories get reused.
    • Fix this →

Testing

  1. test_mobilenet_v2.py:39-47, test_mobilenet_v3.py:44-52, test_shufflenet_v2.py:44-52: three of the four models compare a constant. (major)
    • The description discloses that both MobileNets output zero and that ShuffleNet's pooled features collapse to zero, and it defers stronger fixtures. It understates the effect:
      • With a constant reference, the host check (tester.py:166) and the on-device BundleIO check (tester.py:195-207) only catch errors that move the output off that constant.
      • A wrong requantization, weight layout or padding anywhere upstream still passes.
      • For these three models, test_implementation_* only shows that the firmware builds, fits and runs.
    • A symptom: these three pass at qtol=0, while SqueezeNet (the only model with a live output) and the conv op tests (ops/test_conv2d.py:194) need qtol=1.
    • Likely cause: weights=None leaves every BatchNorm at running mean 0 and variance 1, so in eval mode BN is the identity. Nothing then restores the scale the initialization loses; for example, torchvision's kaiming_normal_(mode="fan_out") scales a depthwise layer's output variance by about 2/C.
    • This doesn't need pretrained weights or a follow-up PR:
      • Set momentum=None on each BatchNorm2d.
      • Run the calibration samples through the model in train() mode, then call .eval().
      • Assert that the reference output is not constant.
      • The tests may then need qtol=1, like SqueezeNet.
    • Fix this →
  2. All four test_dialect_*: check_node_count only checks the ops it lists (backends/test/harness/tester.py:298-303), so nothing enforces the "Remaining internal float compute" column in the description. (major)
    • test_mlperf_tiny.py:142-182 has checks the new tests omit:
      • a scratch-binding check in the fixture;
      • the exact esp_nn op multiset;
      • cpu_ops, quantization_ops and layout_ops from get_operator_library_report;
      • no delegates and no fused_quant:: operators in the serialized plan;
      • a coverage JSON print, which test_espressif.sh:195-196 captures with -s.
    • Trigger: suppose ReLU6 stopped folding into MobileNetV2's convs. Its 35 hard_tanh would become quantized_lut_int8 calls or stay as fused_quant.hard_tanh. Every listed count would stay the same, and the zero output hides the change numerically.
    • Without the scratch-binding check, a local run that lacks EXECUTORCH_BUILD_ESP_NN_PYBINDS=ON silently skips conv and mean lowering (passes/lower_to_esp.py:472-477, 976-978). It then fails with Expected 35 … nodes but found 0. instead of the MLPerf fixture's build hint.
    • Suggested fix: share the ModelCase table, fixture and assertions with test_mlperf_tiny.py, with a factory callable in place of type[EagerModelBase]. This also removes four copies of the fixture and alias boilerplate.
    • Fix this →

Code Quality

  1. Nothing documents the new table, and the existing guidance for this failure is wrong. (minor)
    • examples/espressif/project/partitions_large_models.csv:1 calls itself a table "for large-model tests", but it sits in the user-facing example project and no doc mentions it.
    • examples/espressif/README.md:319-320 still answers "Model too large for flash" with FILESYSTEM_LOAD. That doesn't help for models larger than the 2 MiB storage partition, such as these MobileNets.
    • The pre-existing docs/source/backends/espressif/espressif-overview.md:229-238 and espressif-troubleshooting.md:58 have two errors:
      • They quote an overflow of a 2 MB factory partition at 0x10000, which partitions.csv doesn't have.
      • They suggest a table whose nvs at 0x9000 overlaps the partition table at 0xC000 (sdkconfig.defaults:51).
    • This PR adds a working table for the MobileNetV3-Small case those pages describe, so point them at it.
    • Fix this →
  2. Seven op-test sites rebuild the firmware path to read emulator.log. (minor)
    • The sites: ops/test_conv2d.py:406, test_lut.py:230, test_softmax.py:624, test_conv_padding.py:391, 427 and test_depthwise_conv2d.py:411, 478.
    • The name now includes a partition-table part that only tester.py:185-189 knows about. If one of these tests passes partition_table, it reads the default directory's stale or missing log.
    • Store the directory on the tester in test_implementation and read it from there.
    • Fix this →
  3. tester.py:185 checks if partition_table, but tester.py:215 checks is not None. So partition_table="" writes an empty CONFIG_PARTITION_TABLE_CUSTOM_FILENAME into the default directory's kernel.defaults. (minor)

Recommendation

Request Changes

The two Testing findings leave the PR's main deliverable, enforced coverage with real numerical checks, weaker than the description reports. Both have small local fixes. The storage question doesn't block.

Test ESP32 Emulators was still in progress when this review was posted. It is the only run that executes the new implementation tests, and the first to run them on ESP32-P4 and ESP32-S31.

Specific Comments

  • examples/espressif/project/partitions_large_models.csv:3: the CSV doesn't place the table; CONFIG_PARTITION_TABLE_OFFSET (sdkconfig.defaults:51) does. partitions.csv:3-5 gives the reason as bootloader room on every target, not just the ESP32-P4.
  • backends/espressif/test/tester.py:210: the name kernel.defaults no longer fits, since the file now also holds the partition-table setting.
  • test_mobilenet_v3.py, test_shufflenet_v2.py, test_squeezenet.py: the file names drop the variant (small, x0_5, 1_1) that their test names carry.
  • Gather context (diff, checklist, repo conventions)
  • Run independent review panel (3 reviewers)
  • Consolidate findings
  • Fact-check findings
  • Post final review

Not done: I didn't run the tests, the ESP-IDF builds or the emulator. The findings come from reading the code, CI scripts and workflows. The BatchNorm fix and the artifact-size estimate are untested.
• codex/espressif-model-coverage

@rascani
rascani force-pushed the codex/espressif-model-coverage branch from 46142b2 to 7c61f75 Compare December 4, 2026 17:43
@rascani
rascani force-pushed the codex/espressif-model-coverage branch from 7c61f75 to a75b82f Compare December 4, 2026 21:23
@rascani

rascani commented Dec 5, 2026

Copy link
Copy Markdown
Contributor Author

@claude review effort=xhigh

@claude

claude Bot commented Dec 5, 2026 •

Copy link
Copy Markdown

Claude finished @rascani's task in 5m 3s —— View job


PR #26021 review

The second commit now enforces the coverage table exactly, but three of the four models still compare all-zero outputs, so their numerical checks prove almost nothing; I'm requesting changes for that and a few smaller test and doc gaps.

Detailed review

PR Review: #26021

Summary

The PR adds dialect, serialization and emulator tests for MobileNetV2, MobileNetV3-Small, ShuffleNetV2 x0.5 and SqueezeNet 1.1. It also adds an opt-in 5 MiB single-app partition table and updates the large-model docs.

check_model_coverage now covers the coverage enforcement asked for in the previous round. Still open:

  • Constant outputs: MobileNet and ShuffleNet compare a constant, so their numerical checks are close to vacuous.
  • Fixture guard: the new fixtures dropped the MLPerf scratch-binding check.
  • Duplicated helper: check_model_coverage forks the MLPerf assertions instead of replacing them.
  • Docs: several statements are imprecise.

All 10 changed files were reviewed.

Infrastructure

  • backends/espressif/test/tester.py:185-188: the new firmware directory is uploaded to GitHub storage. (minor, size estimated, not measured)
    • collect_artifacts (.ci/scripts/test_espressif.sh:49-61) copies *.pte, *.bpte, *.elf and merged-binary.bin from every operator-library-* directory.
    • test-espressif.yml:90 uploads them with upload-artifact: and no upload-artifact-to-s3.
    • The new operator-library-<worker>-partitions_large_models-… directories add the multi-MB MobileNet programs and firmware on every optimized matrix leg.
    • I estimate tens of MB per run, below the checklist threshold. Consider upload-artifact-to-s3: true, or skip merged-binary.bin and *.bpte for these directories.

Testing

  1. test_mobilenet_v2.py:40-48, test_mobilenet_v3.py:45-53, test_shufflenet_v2.py:45-53: three of the four models compare a constant. (major, raised by all three reviewers)
    • The description discloses this, but the effect is larger than "cannot catch all" regressions:
      • test_dialect's assert_close (tester.py:166) passes for any upstream error that keeps the output at zero.
      • So does the BundleIO check (atol=1e-6). That covers wrong requantization, weight layout, padding or input handling.
    • So test_implementation_mobilenet_* only shows that the firmware builds, fits and boots. These are the two most expensive tests added: an extra from-scratch IDF build each, in their own partition directory.
    • A symptom: these three pass at the default qtol=0, while SqueezeNet, the only model with a live output, needs qtol=1.
    • Likely cause: with weights=None, the BatchNorm buffers stay at mean 0 and variance 1, so BN is the identity in eval().
    • Fix (a few lines in each fixture):
      • Set momentum=None on each BatchNorm2d.
      • Run the calibration batches through model.train(), then call .eval().
      • Assert that the reference output is not constant.
      • Expect to need qtol=1, as SqueezeNet does.
    • I did not run this fix.
    • Fix this →
  2. The four new fixtures (test_mobilenet_v2.py:40-48, and the same block in each file) drop the scratch-binding guard from test_mlperf_tiny.py:142-144. (minor, 2 reviewers)
    • Without EXECUTORCH_BUILD_ESP_NN_PYBINDS=ON, get_scratch_queries returns None, and conv and mean lowering bail out (passes/lower_to_esp.py:472-477, 976-978).
    • The tests then fail with an opaque node-count mismatch instead of the build hint.
  3. The implementation tests drop the select_ops parametrization from test_mlperf_tiny.py:189-201. (minor, 2 reviewers) Only the selected-ops firmware is exercised. If the default library is left out on purpose (for example, MobileNet plus the full kernel set might not fit in 5 MiB), say so in a comment.

Code Quality

  1. backends/espressif/test/models/utils.py:16-46 forks test_mlperf_tiny.py:158-182 instead of replacing it. (minor, all three reviewers)
    • test_mlperf_tiny.py was not moved onto the helper, so there are two copies to keep in sync, and they have already drifted:
      • MLPerf asserts cpu_ops, quantization_ops and layout_ops separately; the helper merges everything into one Counter.
      • MLPerf checks only execution_plan[0]; the helper loops over every plan.
    • Both copies count esp_nn ops only in edge.exported_program(), the default method. get_operator_library_report walks sorted(edge.methods) (lowering.py:73).
    • The report already classifies esp_nn ops but only returns a count (lowering.py:83-85). Returning per-target entries there would remove the second graph walk from both callers.
    • {op.name(): count ...} (utils.py:38) keys on the overload-less name. Two expected overloads of one op would overwrite each other instead of summing; this is latent only.
    • Switch the MLPerf test to the shared helper, choosing one of the two forms.
  2. tester.py:185 checks if partition_table, but tester.py:215 checks is not None. (minor)
    • With partition_table="", an empty CONFIG_PARTITION_TABLE_CUSTOM_FILENAME is written into the default directory's kernel.defaults.
    • The directory key is only Path(...).stem. Two tables with the same stem in different directories share a firmware directory and its existing sdkconfig, which takes precedence over the defaults files, so the second build silently uses the first table. This is the failure the isolation is meant to prevent.
    • Either restrict the argument to a bare filename in examples/espressif/project (assert it is a file there) or key the directory on the full value.
  3. docs/source/backends/espressif/espressif-overview.md:229-231: "set CONFIG_PARTITION_TABLE_CUSTOM_FILENAME to its path" right after the repo path is misleading. (minor)
    • ESP-IDF resolves a relative value against the project directory, so pasting examples/espressif/project/partitions_large_models.csv fails.
    • tester.py correctly passes the bare partitions_large_models.csv.
    • Show the one-line defaults file, and note that an existing sdkconfig must be removed or fullcleaned for the change to apply.
    • The ESP-IDF resolution behavior is from reviewer knowledge and was not checked against IDF source here.
  4. docs/source/backends/espressif/espressif-troubleshooting.md:58 dropped the searchable error text and gives no default slot size. (minor, all three reviewers)
    • Users find this page by searching the build error. With the default table the overflow line names ota_0, size 0x2e0000 (partitions.csv:10), so quote that.
    • espressif-overview.md:229 also no longer says how large the default slot is (about 2.9 MiB), so readers cannot tell whether their model fits.
  5. The user docs frame the table as test-only. (minor)
    • espressif-overview.md:229, espressif-troubleshooting.md:58 and examples/espressif/README.md:319-322 say "large-model tests on 8 MiB boards". Users with real large models need the same fix, so say "large models".
    • The README entry also dropped the general advice ("quantize it, or use a smaller model").

Recommendation

Request Changes

Item 1 under Testing is the blocker. The PR's headline deliverable is execution coverage for these models, and for three of four it currently can't detect arithmetic regressions. The BN calibration fix is local to the fixtures and avoids a follow-up PR. Everything else is minor. The storage note is an estimate and does not block.

Specific Comments

  • examples/espressif/project/partitions_large_models.csv:1-2: says "8 MB" and "5 MB", while the docs say MiB.
  • examples/espressif/project/partitions_large_models.csv:3: "remains at 0xC000 for the ESP32-P4 bootloader" disagrees with partitions.csv:3-5, which gives the reason as bootloader room "on every target". The offset comes from CONFIG_PARTITION_TABLE_OFFSET (sdkconfig.defaults:51), not this file.
  • docs/source/backends/espressif/espressif-overview.md:227: "Image models need two changes" overstates the case. SqueezeNet and ShuffleNet use neither table change.
  • examples/espressif/README.md:292-301: the build/partition_table/... path assumes the default build directory, but the README's emulator flow uses -B cmake-out-esp-emulator/firmware. Also, write_partition has no --port, unlike the earlier idf.py -p flash step.
  • backends/espressif/test/tester.py:185: partition_config holds a directory suffix; partition_suffix would read better.
  • backends/espressif/test/tester.py:210: the name kernel.defaults no longer fits now that the file also carries the partition table.
  • test_mobilenet_v3.py, test_shufflenet_v2.py, test_squeezenet.py: the file names drop the variant (small, x0_5, 1_1) that the test names carry.
  • .ci/scripts/test_espressif.sh:205-206 (unchanged): says each case builds "in its own per-worker directory". It is now per worker and per partition table.
  • Gather context (diff, checklist, repo conventions)
  • Run independent review panel (3 reviewers)
  • Consolidate findings
  • Fact-check findings
  • Post final review

Not done: I couldn't run Python, the tests, the ESP-IDF builds or the emulator, because the commands needed approval. The findings come from reading the code, the CI scripts and the workflow. The BatchNorm fix, the artifact-size estimate and the ESP-IDF path-resolution behavior are untested.
• codex/espressif-model-coverage

Add paired dialect, serialization, and implementation tests for MobileNetV2,
MobileNetV3 Small, ShuffleNetV2 x0.5, and SqueezeNet 1.1 using standard seeded
models and synthetic calibration inputs.

Give the two MobileNet implementation tests an explicit 5 MiB app partition
configuration and isolate its firmware build directory. Preserve the example's
default dual-OTA layout and derive the README's SPIFFS commands from the
generated partition table.

Authored with AI assistance using Codex.
Check the complete lowered operator multiset for each TorchVision model, including explicit zero-count expectations. Verify that serialized plans contain neither delegates nor Fused Quant operators, and print the coverage report for CI.

Point large-model troubleshooting at the existing tested partition table and remove the stale partition example. The four dialect and serialization tests and targeted lint passed; the combined stack also passed model coverage and serialization checks.

Authored with AI assistance using Codex.
Use the shared model report and serialization checks for MLPerf Tiny, and give the TorchVision fixtures an actionable missing-scratch-bindings error.

Authored with AI assistance using Codex.
@rascani

rascani commented Dec 5, 2026

Copy link
Copy Markdown
Contributor Author

@claude review effort=xhigh

Please re-review head 88de827. MLPerf Tiny now reuses the existing model coverage/serialization helper, and each TorchVision fixture fails clearly if ESP-NN scratch bindings are missing. All eight MLPerf Tiny/TorchVision dialect and serialization cases passed with bindings enabled. Seeded weights, calibration, tolerances, partitions, and CI selection are unchanged.

Agreed deferrals:

  • Stronger numerical fixtures and trained-model accuracy remain follow-up work. The PR explicitly discloses the seeded models' zero-output limitation; these fixtures primarily establish coverage, serialization, and execution.
  • General build/test restructuring and hardening currently unused custom/empty partition-key paths are separate cleanup work.

Declined for this PR:

  • Custom weight initialization/rescaling or BatchNorm training to manufacture nonzero outputs, and tolerance relaxation.
  • Duplicating selected/full-library registration variants for every large TorchVision model; MLPerf already covers both modes.
  • Speculative artifact-storage changes without a measured need, and further README expansion.

Please distinguish new correctness defects from these scoped follow-ups. Review only; do not modify the branch.

@claude

claude Bot commented Dec 5, 2026 •

Copy link
Copy Markdown

Claude finished @rascani's task in 3m 48s —— View job


PR #26021 re-review (head 88de827)

The latest commit introduces no new correctness defect in what CI runs; one minor new local-run problem is that the TorchVision implementation tests now error instead of skipping without the build env. With the deferrals you listed accepted, nothing blocks.

Detailed review

PR Review: #26021

Summary

The PR adds dialect, serialization and emulator tests for four TorchVision models, plus an opt-in 5 MiB partition table. The latest commit moves MLPerf Tiny onto check_model_coverage and adds a scratch-binding guard to each TorchVision fixture.

MLPerf refactor: The three reviewers and I checked it against the old test, and it removes no check:

  • All four cases keep their old Q/DQ and layout counts.
  • portable_ops={} is still enforced: any CPU op makes the merged Counter differ.
  • The serialization check now covers every execution plan.
  • Because Q/DQ and layout ops are now in ops_after_transforms, they are also checked by test_dialect's node count.

What's left:

  • New problem: one minor issue in the latest commit (the skip ordering below).
  • Still open from the last round: a few doc wording issues. None of them is covered by your deferral list.

All 11 changed files were reviewed. I left out everything you deferred or declined: constant outputs and numerical fixtures, BN calibration and tolerance changes, the empty/same-stem partition keys, select_ops variants, artifact storage and README expansion.

Testing

  1. New in 88de827: test_implementation_* in the four TorchVision files now error instead of skipping when ESPRESSIF_BUILD_DIR is unset. (minor, 2 of 3 reviewers, confirmed by reading the code)
    • test_squeezenet.py:61 and its counterparts in test_mobilenet_v2.py, test_mobilenet_v3.py and test_shufflenet_v2.py have no skipif marker. They rely on the pytest.skip inside EspTester.test_implementation (tester.py:179-181), which only runs after the fixture.
    • The fixture's new assert (test_squeezenet.py:49-51) runs first.
    • Trigger: run pytest backends/espressif/test/models on a host without EXECUTORCH_BUILD_ESP_NN_PYBINDS. Each implementation test reports a setup ERROR ("Build with …PYBINDS=ON") instead of SKIPPED. test_implementation_mlperf_tiny (test_mlperf_tiny.py:148-151) skips in the same situation.
    • Even with bindings, each test builds a TorchVision model before it skips.
    • CI is not affected: .ci/scripts/test_espressif.sh builds the bindings before both pytest steps.
    • Fix: copy the MLPerf skipif marker onto the four implementation tests.
    • Fix this →

Code Quality

These were raised last round, were not addressed, and are not in your deferral list. None of them blocks.

  1. docs/source/backends/espressif/espressif-overview.md:231: "set CONFIG_PARTITION_TABLE_CUSTOM_FILENAME to its path" comes right after the repo-relative path examples/espressif/project/partitions_large_models.csv.
    • ESP-IDF resolves a relative value against the project directory, so a reader who pastes that path gets a missing-file error. tester.py passes the bare partitions_large_models.csv.
    • Also, an existing sdkconfig takes precedence over the defaults files, so the table is silently ignored in a build directory that already exists.
    • Fix: give the bare filename and note that a fresh build directory is needed (two short clauses).
  2. docs/source/backends/espressif/espressif-troubleshooting.md:58: the build-error text is gone, and readers find this page by searching for that error.
    • The old string was wrong for the current table, so quote the current one instead: the overflow of ota_0, size 0x2e0000.
    • Neither page says how big the default slot is (about 2.9 MiB), so readers can't tell whether their model needs the new table.
  3. examples/espressif/project/partitions_large_models.csv:1-3:
    • "8 MB", "5 MB" and "2 MB" here clash with "MiB" in the docs.
    • "remains at 0xC000 for the ESP32-P4 bootloader" is narrower than partitions.csv:3-5, which gives the reason as bootloader room on every target.
    • The offset comes from CONFIG_PARTITION_TABLE_OFFSET, not from this file.

Latent only, not triggered by any current model: utils.py:28 counts esp_nn ops only in edge.exported_program(), the default method. get_operator_library_report walks every method. A multi-method program would get a wrong ESP count.

Recommendation

Approve, with the skipif fix above suggested. It is the only defect introduced by the latest commit and needs four decorator lines. Everything else is either deferred by agreement or a minor doc wording issue.

  • Gather context (diff, checklist, repo conventions)
  • Run independent review panel (3 reviewers)
  • Consolidate findings, separate from agreed deferrals
  • Fact-check findings
  • Post final review

Not done: I didn't run pytest, the ESP-IDF builds or the emulator, because the commands needed approval. The findings come from reading the code, the CI script and the diffs. I didn't modify the branch, as you asked.
• codex/espressif-model-coverage

@rascani
rascani marked this pull request as ready for review December 5, 2026 02:09
@rascani
rascani requested a review from mergennachin as a code owner December 5, 2026 02:09

This branch is being deployed

1 queued deployment
cadence — 88de827d Deployed Dec 5, 2026 by rascani via hifi5s-op-test / hifi5s #42470
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant