Skip to content

[Espressif] Cap concurrent idf.py builds to two Ninja jobs each - #26104

Closed
rascani wants to merge 2 commits into
pytorch:mainfrom
rascani:esp32-idf-build-jobs
Closed

rascani wants to merge 2 commits into
pytorch:mainfrom
rascani:esp32-idf-build-jobs

Conversation

@rascani

@rascani rascani commented Dec 5, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Eight pytest workers build firmware concurrently in the operator-library implementation tests, and each idf.py build otherwise uses the container's whole CPU count for Ninja. Cap each worker's build to two jobs with IDF_PY_BUILD_JOBS, following the same oversubscription reasoning as the worker and thread caps. The variable is scoped to the implementation-test pytest invocation only; no harness or build code changes, and no other invocation in the script is affected. This is an experiment: if the implementation pytest does not get faster, it should be reverted.

Authored with AI assistance using Muse Code powered by muse-latest.

Test plan

Local verification: bash -n and shellcheck pass on .ci/scripts/test_espressif.sh. The control is documented in ESP-IDF v6.1, the version the emulator jobs use: IDF_PY_BUILD_JOBS caps the number of parallel build jobs when running idf.py with the Ninja generator.

Measured on this pull request (Test ESP32 Emulators run 47454237359, all jobs passing): no improvement. The implementation pytest took 824, 900, and 964 seconds on ESP32-S3, ESP32-P4, and ESP32-S31, versus roughly 750 to 860 seconds on recent runs without this cap, and the slowest first-test cold builds were essentially unchanged (173 to 176 seconds on ESP32-S3, 202 to 205 seconds on ESP32-P4, 227 to 230 seconds on ESP32-S31). Total optimized job time was 30m37s, 32m50s, and 34m55s, versus 31m05s, 32m42s, and 34m01s on the control run. The cap did not make the cold builds faster, so this change should be reverted.

Eight pytest workers build firmware concurrently in the operator-library implementation tests, and each idf.py build otherwise uses the container's whole CPU count for Ninja. Cap each worker's build to two jobs with IDF_PY_BUILD_JOBS, following the same oversubscription reasoning as the worker and thread caps. This is an experiment: if the implementation pytest does not get faster, revert it.

Authored with AI assistance using Muse Code powered by muse-latest.
@pytorch-bot

pytorch-bot Bot commented Dec 5, 2026 •

Copy link
Copy Markdown

🔗 Helpful Links

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

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

❌ 4 Cancelled Jobs, 8 Pending, 1 Unrelated Failure

As of commit 2347b34 with merge base 7060464 (image):

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

FLAKY - The following job failed but was likely due to flakiness present on trunk:

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 5, 2026
@rascani

rascani commented Dec 5, 2026

Copy link
Copy Markdown
Contributor Author

Reverted: run 47454237359 showed no improvement from capping Ninja jobs (824, 900, and 964 seconds versus roughly 750 to 860 seconds without the cap, with unchanged cold-build times), so the experiment commit is reverted in 9388566. Closing.

@rascani rascani closed this Dec 5, 2026
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