Repository navigation
Add ETDump profiling workflow for CpuBackend (#24335) - #24335
JakeStevens wants to merge 2 commits into
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/24335
Note: Links to docs will display an error until the docs builds have been completed. ❌ 10 Unclassified FailuresAs of commit 30e6781 with merge base 6c7b213 ( UNCLASSIFIED FAILURES - DrCI could not classify the following jobs because the workflow did not run on the merge base. The failures may be pre-existing on trunk or introduced by this PR:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
|
@JakeStevens has exported this pull request. If you are a Meta employee, you can view the originating Diff in D128598106. |
This PR needs a
|
Summary: `CPUPlan` records one ETDump delegate event per step, named `provider/implementation:first_node[+N]`, so every provider is traced without provider changes. The XNNPACK provider enables XNNPACK runtime profiling when a tracer is attached and logs `<operator> #<n>` events, such as `Transpose (ND, X32) #3`, inside its step, with each operator's input and output shapes as JSON delegate metadata. Shapes come from XNNPACK's internal runtime (`src/xnnpack/subgraph.h`). That header dependency and the code that reads it are only compiled when `ET_EVENT_TRACER_ENABLED` is defined. `runner` writes an ETDump when `ET_CPU_ETDUMP` is set. CMake builds `XNNProfiler` as a separate `xnnpack_profiler` library that `xnnpack_backend` and the CPU provider targets link, matching the Buck split, and adds XNNPACK's source root to the CPU targets' include path for the traced build. The Apple XNNPACK framework packs the new archive. Authored with Claude Code. Differential Revision: D125525223
Summary: `etdump_cpu` runs a CPU delegate model through a traced runner with `ET_CPU_ETDUMP`, drops warmup samples, and writes `profile.json` with median/min/max latency per plan step and XNNPACK operator, plus each XNNPACK operator's input and output shapes. Each CPU delegate's plan is reassembled from the runner log, so a program with several CPU delegates is profiled as a whole. Events with an unexpected sample count are reported with a warning, and malformed operator metadata degrades to no shapes. It fails if any plan step or, for XNNPACK regions, operator events are missing from the ETDump. The model runner gains configurable warmups (`ET_CPU_WARMUP_RUNS`), timed iterations (`ET_CPU_TIMED_RUNS`), golden tolerances (`ET_CPU_ATOL`, `ET_CPU_RTOL`) and a latency summary. The workflows README now covers export and profiling. Authored with Claude Code. Differential Revision: D128598106
CpuBackendCpuBackend (#24335)
906f6eb to
30e6781
Compare
Summary:
etdump_cpuruns a CPU delegate model through a traced runner withET_CPU_ETDUMP, drops warmup samples, and writesprofile.jsonwith median/min/max latency per plan step and XNNPACK operator, plus each XNNPACK operator's input and output shapes. Each CPU delegate's plan is reassembled from the runner log, so a program with several CPU delegates is profiled as a whole. Events with an unexpected sample count are reported with a warning, and malformed operator metadata degrades to no shapes. It fails if any plan step or, for XNNPACK regions, operator events are missing from the ETDump.The model runner gains configurable warmups (
ET_CPU_WARMUP_RUNS), timed iterations (ET_CPU_TIMED_RUNS), golden tolerances (ET_CPU_ATOL,ET_CPU_RTOL) and a latency summary. The workflows README now covers export and profiling.Authored with Claude Code.
Differential Revision: D128598106