-
Notifications
You must be signed in to change notification settings - Fork 731
Arm backend: Minimal example of pruning #15851
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/15851
Note: Links to docs will display an error until the docs builds have been completed. ❌ 47 New Failures, 3 Unrelated FailuresAs of commit f6037a4 with merge base b91987e ( NEW FAILURES - The following jobs have failed:
FLAKY - The following job failed but was likely due to flakiness present on trunk:
BROKEN TRUNK - The following jobs failed but was present on the merge base:👉 Rebase onto the `viable/strict` branch to avoid these failures
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces a comprehensive tutorial on neural network pruning for the Arm Ethos-U NPU, demonstrating how to prune a model and measure the resulting performance improvements. The example uses a simple MNIST classifier and shows the complete workflow from training to deployment.
Key changes:
- Adds a Jupyter notebook tutorial demonstrating pruning workflow with PyTorch and ExecuTorch
- Updates performance monitoring to track MAC and Weight Decoder activity for Ethos-U85
- Shows 3x+ inference speedup and significant memory reduction through pruning
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 7 comments.
| File | Description |
|---|---|
| examples/arm/pruning_minimal_example.ipynb | Complete tutorial notebook showing how to prune a neural network, quantize it, and deploy to Ethos-U NPU with performance analysis |
| examples/arm/executor_runner/arm_perf_monitor.cpp | Adds MAC_ACTIVE and WD_ACTIVE PMU counter tracking for Ethos-U85 to support detailed performance analysis |
Comments suppressed due to low confidence (1)
examples/arm/pruning_minimal_example.ipynb:1
- The flag '--debug-force-regor' appears to contain a typo. Verify if this should be '--debug-force-regor' or if it's a misspelling of a valid flag like '--debug-force-regen' or '--debug-force-reorder'.
{
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| "from torch import nn\n", | ||
| "import torch.nn.utils.prune as prune\n", | ||
| "import torch.nn.functional as F\n", | ||
| "from torch.utils.data import DataLoader, Subset\n", |
Copilot
AI
Nov 17, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The import 'DataLoader' is duplicated on lines 54 and 58. Remove the duplicate import from line 58.
| "from torch.utils.data import DataLoader, Subset\n", | |
| "from torch.utils.data import Subset\n", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
|
@gggekov the label "topic: not user facing" is not used anymore so no need to set it it was replaced with "release notes: arm" or "release notes: none" |
Explain how to prune a NN and the associated uplift in performance when running on the Ethos-U NPU. Change-Id: Ib68513e5b4cb7ceef280b6fe089985e9948a8140
1f012a9 to
8119d6d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.
Explain how to prune a NN and the associated uplift in performance when running on the Ethos-U NPU.
cc @freddan80 @per @zingo @oscarandersson8218 @digantdesai