Skip to content

Arm backend: Write PMU metrics to etdump if available - #24507

Merged
Erik-Lundell merged 1 commit into
pytorch:mainfrom
Erik-Lundell:pmu-counters-to-etdump
Nov 4, 2026
Merged

Erik-Lundell merged 1 commit into
pytorch:mainfrom
Erik-Lundell:pmu-counters-to-etdump

Conversation

@Erik-Lundell

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

Copy link
Copy Markdown
Collaborator

This is done as soon as ethosu_execution_stats is linked, was built with ET_EVENT_TRACER_ENABLED, and a tracer is available.

No EthosUStatsBuffer registration is neccessary.

The metrics are written as a profile_event with
delegate_debug_id_str = "ethosu.pmu.counters", and delegate_debug_metadata binary blob described in
EthosUExecutionStats.h. The blob begins with EUC1 (EthosU Counters), where 1 is a versioning number.

For consuming the metrics,
backends/arm/ethosu/parse_delegate_metadata.py
is added that provides

parse_pmu_profile_event() -> EthosUPmuProfileEvent, that parsers the blob into a typed dataclass, and

parse_ethosu_delegate_pmu_metadata() -> dict
that can be passed to the delegate_metadata_parser argument of Inspector.

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

This is done as soon as ethosu_execution_stats is linked,
was built with ET_EVENT_TRACER_ENABLED, and a tracer
is available.

No EthosUStatsBuffer registration is neccessary.

The metrics are written as a profile_event with
delegate_debug_id_str = "ethosu.pmu.counters", and
delegate_debug_metadata binary blob described in
EthosUExecutionStats.h. The blob begins with `EUC1`
(EthosU Counters), where 1 is a versioning number.

For consuming the metrics,
backends/arm/ethosu/parse_delegate_metadata.py
is added that provides

parse_pmu_profile_event() -> EthosUPmuProfileEvent,
that parsers the blob into a typed dataclass, and

parse_ethosu_delegate_pmu_metadata() -> dict
that can be passed to the delegate_metadata_parser
argument of Inspector.

Signed-off-by: Erik Lundell <erik.lundell@arm.com>
Change-Id: Ib952e2530b23e847aa19aff4d4f0ae093a2bf3e1
@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 3, 2026
@pytorch-bot

pytorch-bot Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

🔗 Helpful Links

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

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

✅ You can merge normally! (3 Unrelated Failures)

As of commit a3cb696 with merge base a489dca (image):

BROKEN TRUNK - The following jobs failed but were 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 3, 2026
@github-actions github-actions Bot added ciflow/trunk module: arm Issues related to arm backend labels Nov 3, 2026
@Erik-Lundell
Erik-Lundell merged commit 4dd3ef2 into pytorch:main Nov 4, 2026
482 of 491 checks passed
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.

3 participants