Skip to content

Cortex-M: size scratch buffers in a dedicated pass - #22860

Merged
rascani merged 2 commits into
mainfrom
gh/rascani/43/head
Sep 16, 2026
Merged

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

Conversation

@rascani

@rascani rascani commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

Move CMSIS-NN scratch allocation sizing out of AtenToCortexMPass into InitializeScratchBuffersPass. Run it immediately after dialect lowering in both default pipelines. This lets later graph rewrites, such as padding fusion, run before sizing without embedding them in dialect conversion.

Preserve target-specific sizing, metadata updates and validation of trailing allocation nodes. Recompile after changing allocation arguments. Explicit custom pipelines that perform dialect lowering must include the sizing pass before memory planning. The extraction is independently reviewed; existing convolution, pooling, layout and DS-CNN dialect tests exercise both pipelines.

Authored with AI assistance from Codex.

[ghstack-poisoned]
[ghstack-poisoned]
@rascani

rascani commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor Author

@pytorch-bot

pytorch-bot Bot commented Sep 15, 2026 •

Copy link
Copy Markdown

🔗 Helpful Links

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

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

✅ No Failures

As of commit 57305bb with merge base 026ca3f (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 Sep 15, 2026
@rascani
rascani marked this pull request as ready for review September 16, 2026 17:30
rascani added a commit that referenced this pull request Sep 16, 2026
Move CMSIS-NN scratch allocation sizing out of AtenToCortexMPass into InitializeScratchBuffersPass. Run it immediately after dialect lowering in both default pipelines. This lets later graph rewrites, such as padding fusion, run before sizing without embedding them in dialect conversion.

Preserve target-specific sizing, metadata updates and validation of trailing allocation nodes. Recompile after changing allocation arguments. Explicit custom pipelines that perform dialect lowering must include the sizing pass before memory planning. The extraction is independently reviewed; existing convolution, pooling, layout and DS-CNN dialect tests exercise both pipelines.

Authored with AI assistance from Codex.


ghstack-source-id: 238c20d
ghstack-comment-id: 5689271806
Pull-Request: #22860
Base automatically changed from gh/rascani/42/head to main September 16, 2026 19:06
@rascani
rascani merged commit 9250dc3 into main Sep 16, 2026
218 of 224 checks passed
@rascani
rascani deleted the gh/rascani/43/head branch September 16, 2026 19:52

This branch was successfully deployed

1 active deployment
cadence — 57305bb7 Deployed Sep 15, 2026 by rascani via hifi-op-test / hifi4 #28053
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