Skip to content

Arm backend: Collect PMU counters in EthosUExecutionStats - #24432

Open
Erik-Lundell wants to merge 1 commit into
pytorch:mainfrom
Erik-Lundell:upstream-ethos-pmu
Open

Erik-Lundell wants to merge 1 commit into
pytorch:mainfrom
Erik-Lundell:upstream-ethos-pmu

Conversation

@Erik-Lundell

@Erik-Lundell Erik-Lundell commented Nov 2, 2026 •

Copy link
Copy Markdown
Collaborator

In the Ethos-U Backend, create a delegate context that is passed to ethosu_invoke_v3 as user_args.

When ethosu_execution_stats is linked in, it registers ethosu callbacks that use the context to write to an EthosUStatsBuffer that is owned by the application and registered using set_ethosu_stats_buffer.

The buffer consists of EthosUExecutionRecords that contain data for one delegate call, including metadata to identify what npu ran the delegate.

Additional introduced API:

  • EthosUBackend_npu_begin() callback
  • EthosUBackend_npu_end() callback These can be used for measuring CPU time during npu dispatch.
  • ethosu_execution_metrics_enabled() -> bool

Use this infra in arm_perf_monitor.

cc @digantdesai @freddan80 @per @zingo @oscarandersson8218 @mansnils @Sebastian-Larsson @robell @rascani

In the Ethos-U Backend, create a delegate context that is
passed to ethosu_invoke_v3 as user_args.

When ethosu_execution_stats is linked in, it registers
ethosu callbacks that use the context to write to an
EthosUStatsBuffer that is owned by the application and
registered using `set_ethosu_stats_buffer`.

The buffer consists of EthosUExecutionRecords that contain
data for one delegate call, including metadata to identify
what npu ran the delegate.

Additional introduced API:
- EthosUBackend_npu_begin() callback
- EthosUBackend_npu_end() callback
These can be used for measuring CPU time during npu dispatch.
- ethosu_execution_metrics_enabled() -> bool

Use this infra in arm_perf_monitor.

Change-Id: I7d4c2a87e0df624ba99d22dfc09f5fb290b66837
Signed-off-by: Erik Lundell <erik.lundell@arm.com>
@Erik-Lundell Erik-Lundell added partner: arm For backend delegation, kernels, demo, etc. from the 3rd-party partner, Arm release notes: none Do not include this in the release notes labels Nov 2, 2026
@pytorch-bot

pytorch-bot Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

🔗 Helpful Links

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

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

❌ 4 New Failures, 4 Pending

As of commit 4cc369b with merge base ab68460 (image):

NEW FAILURES - The following jobs have failed:

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@Erik-Lundell
Erik-Lundell requested a review from rascani as a code owner November 2, 2026 15:13
@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 2, 2026
@github-actions github-actions Bot added ciflow/trunk module: arm Issues related to arm backend labels Nov 2, 2026

@zingo zingo left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Ok to merge, it seems buck2 is updated. Nice.

This branch has not been deployed

No deployments
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. module: arm Issues related to arm backend partner: arm For backend delegation, kernels, demo, etc. from the 3rd-party partner, Arm release notes: none Do not include this in the release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants