Skip to content

Conversation

@gggekov
Copy link
Collaborator

@gggekov gggekov commented Nov 17, 2025

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

@gggekov gggekov requested a review from digantdesai as a code owner November 17, 2025 16:43
@pytorch-bot
Copy link

pytorch-bot bot commented Nov 17, 2025

🔗 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 Failures

As of commit f6037a4 with merge base b91987e (image):

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.

@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 Nov 17, 2025
@gggekov gggekov added partner: arm For backend delegation, kernels, demo, etc. from the 3rd-party partner, Arm ciflow/trunk topic: not user facing and removed CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. labels Nov 17, 2025
@mergennachin mergennachin requested a review from Copilot November 17, 2025 19:22
Copilot finished reviewing on behalf of mergennachin November 17, 2025 19:23
Copy link
Contributor

Copilot AI left a 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",
Copy link

Copilot AI Nov 17, 2025

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.

Suggested change
"from torch.utils.data import DataLoader, Subset\n",
"from torch.utils.data import Subset\n",

Copilot uses AI. Check for mistakes.
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@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 Nov 17, 2025
@zingo zingo added release notes: arm Changes to the ARM backend delegate and removed topic: not user facing labels Nov 20, 2025
@zingo
Copy link
Collaborator

zingo commented Nov 20, 2025

@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
@gggekov gggekov force-pushed the pruning_example_ethos_U branch from 1f012a9 to 8119d6d Compare November 20, 2025 14:54
Copilot AI review requested due to automatic review settings November 20, 2025 22:21
Copy link
Contributor

Copilot AI left a 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ciflow/trunk CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. partner: arm For backend delegation, kernels, demo, etc. from the 3rd-party partner, Arm release notes: arm Changes to the ARM backend delegate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants