Skip to content

Use minimal PAL and nano libraries in Cortex-M size tests - #24216

Merged
rascani merged 2 commits into
mainfrom
gh/rascani/48/head
Oct 28, 2026
Merged

rascani merged 2 commits into
mainfrom
gh/rascani/48/head

Conversation

@rascani

@rascani rascani commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Summary

The Cortex-M size tests should measure ExecuTorch's contribution to binary size. The POSIX platform layer and, for GNU, the full C/C++ libraries with exception support and demangling obscure that contribution. Select minimal PAL for both existing configurations and nano.specs for the GNU build to reduce this overhead and make the tests more sensitive to changes in ExecuTorch.

Initialize C and C++ flags with nano.specs so it applies during compilation and linking while preserving the build script's existing flags. Set the runtime size limits to 34,000 bytes for GNU and 57,000 bytes for Zephyr. The GNU configuration uses nano's abort-on-allocation-failure behavior.

Test plan

Built both size targets on base 0549e1ee61 using Cortex-M55, C++17, Release with size optimization and logging disabled; GNU Arm 15.2.Rel1 and Zephyr SDK 1.0.1 (GCC 14.3.0). Stripped ELF file sizes in bytes:

Configuration Binary Before After Saved
GNU bare-metal size_test 117,348 33,372 83,976
GNU bare-metal size_test_all_ops 1,245,820 1,156,180 89,640
Zephyr size_test 56,332 55,800 532
Zephyr size_test_all_ops 1,155,048 1,154,512 536

All 263 C/C++ compile commands and both size-test compile/link commands select nano.specs while retaining the existing compiler flags. Both GNU binaries retain FileDataLoader and contain no exception-unwinder or demangler symbols. Workflow YAML parsing, shell syntax, and both size limits pass.

Authored with AI assistance using Codex.

[ghstack-poisoned]
@rascani

rascani commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor Author

@pytorch-bot

pytorch-bot Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

🔗 Helpful Links

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

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

✅ No Failures

As of commit 038aacb with merge base 0549e1e (image):
💚 Looks good so far! There are no failures yet. 💚

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 Oct 27, 2026
@rascani
rascani requested review from JakeStevens and psiddh October 27, 2026 22:31
@github-actions

Copy link
Copy Markdown

This PR needs a release notes: label

If your change should be included in the release notes (i.e. would users of this library care about this change?), please use a label starting with release notes:. This helps us keep track and include your important work in the next release notes.

To add a label, you can comment to pytorchbot, for example
@pytorchbot label "release notes: none"

For more information, see
https://github.com/pytorch/pytorch/wiki/PyTorch-AutoLabel-Bot#why-categorize-for-release-notes-and-how-does-it-work.

[ghstack-poisoned]
@rascani
rascani merged commit a47ebc7 into main Oct 28, 2026
223 checks passed
@rascani
rascani deleted the gh/rascani/48/head branch October 28, 2026 15:06

This branch was previously deployed

1 inactive deployment
cadence — 038aacb5 Deployed Oct 27, 2026 by rascani via hifi-op-test / hifi4 #34944
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.

2 participants