Binary size skill#17988
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/17988
Note: Links to docs will display an error until the docs builds have been completed.
|
This PR needs a
|
96f140d to
997ff16
Compare
There was a problem hiding this comment.
Pull request overview
Adds a new “binary-size” skill to the .claude skill set and tightens CI binary-size thresholds to reflect current stripped size_test sizes.
Changes:
- Document a new
/binary-sizeskill and add it to the top-level skills index. - Update CI binary-size thresholds for GCC9 and Clang12 size test jobs.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
CLAUDE.md |
Adds /binary-size to the skills list. |
.github/workflows/pull.yml |
Updates binary size thresholds and records current CI sizes. |
.claude/skills/binary-size/SKILL.md |
New skill doc describing how to measure/analyze binary size and where to look for size wins. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| output=$(ls -la cmake-out/test/size_test) | ||
| arr=($output) | ||
| size=${arr[4]} |
There was a problem hiding this comment.
The workflow parses file size from ls -la output (arr=($output); size=${arr[4]}), which is brittle (format can vary with locale/ACL markers) and can misread the size. Prefer using stat (e.g., bytes via stat -c%s <file>) to make this check robust.
| # Current CI size: 48008 (gcc9-nopytorch, 2026-03-06) | ||
| threshold="48500" |
There was a problem hiding this comment.
The new gcc9 threshold (48,500) is very close to the observed size (48,008). This small buffer risks CI flakiness when toolchain/image deps change slightly; consider leaving a larger margin (or documenting why ~500 bytes is sufficient).
| # Current CI size: 48008 (gcc9-nopytorch, 2026-03-06) | |
| threshold="48500" | |
| # Current CI size: 48008 (gcc9-nopytorch, 2026-03-06); leave ~2KB headroom to avoid CI flakiness | |
| threshold="50000" |
| - `EXECUTORCH_OPTIMIZE_SIZE=ON` — enables `-Os`, `-fno-exceptions`, `-fno-rtti`, unwind table suppression | ||
| - `CXXFLAGS="-fno-exceptions -fno-rtti -Wall -Werror"` |
There was a problem hiding this comment.
This “Key build flags” list is incomplete vs test/build_size_test.sh (it also sets -Wno-int-in-bool-context and -DET_HAVE_PREAD=0 via COMMON_CXXFLAGS). Consider updating this section to reflect the full flags actually used, and clarify which flags come from EXECUTORCH_OPTIMIZE_SIZE vs explicit CXXFLAGS.
| - `EXECUTORCH_OPTIMIZE_SIZE=ON` — enables `-Os`, `-fno-exceptions`, `-fno-rtti`, unwind table suppression | |
| - `CXXFLAGS="-fno-exceptions -fno-rtti -Wall -Werror"` | |
| - `EXECUTORCH_OPTIMIZE_SIZE=ON` | |
| - Typically enables: `-Os`, `-fno-exceptions`, `-fno-rtti`, and unwind table suppression | |
| - Explicit compiler flags (`CXXFLAGS`/`COMMON_CXXFLAGS`): | |
| - `-fno-exceptions -fno-rtti -Wall -Werror` | |
| - `-Wno-int-in-bool-context` | |
| - `-DET_HAVE_PREAD=0` |
### Summary Add binary size skill and update ci with new binary size thresholds ### Test plan ci --------- Co-authored-by: Github Executorch <github_executorch@arm.com>
Summary
Add binary size skill and update ci with new binary size thresholds
Test plan
ci