Add benchmarking script (#20188)#20188
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/20188
Note: Links to docs will display an error until the docs builds have been completed. ❌ 1 New Failure, 9 Pending, 1 Unrelated FailureAs of commit ea24622 with merge base 4519036 ( NEW FAILURE - The following job has failed:
BROKEN TRUNK - The following job 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. |
|
@metascroy has exported this pull request. If you are a Meta employee, you can view the originating Diff in D108048181. |
This PR needs a
|
Summary:
Adds a standalone microbenchmark for the ImageProcessor reuse APIs and a companion script to diff two runs, so kernel/pipeline changes (e.g. the NEON deinterleave switch) can be measured reproducibly.
New directory xplat/executorch/extension/image/benchmark/:
* image_processor_benchmark.cpp (cxx_binary) — times process_into (BGRA/RGBA) and process_yuv_into (NV12/NV21) over a sweep of common input sizes × target sizes. Per cell it runs variants covering execution path (CPU / GPU / size-default), resize mode (stretch / letterbox), orientation (upright + 90°), cropped ROI, and the allocating process() vs process_into(). Each row reports mean/median/p95/stddev over 100 iters (10 warmup) on a synthetic gradient input; a row that fails is reported as ERROR rather than timed.
* Flags (all optional): --format=bgra|rgba|nv12|nv21, --unit=cpu|gpu|default (both default to all), --out=PATH (writes a clean results table; the input-size sweep and rotation always run). Output is grouped under === API-section banners with a column legend, and --- per-cell separators.
* compare_benchmarks.py (python_binary, stdlib-only) — matches rows by (API section, input→target cell, variant) and prints per-row base / new speedup plus a summary bucketed by execution path (CPU / GPU / default).
* README.md — usage, the build-mode caveat, and the capture→compare workflow.
* BUCK / TARGETS / targets.bzl — build defs.
Note: benchmark only with an optimized build (-c cxx.extra_cxxflags=-Os); the default buck2 run is -O0 and unrepresentative.
Differential Revision: D108048181
257df08 to
9f42724
Compare
Summary:
Adds a standalone microbenchmark for the ImageProcessor reuse APIs and a companion script to diff two runs, so kernel/pipeline changes (e.g. the NEON deinterleave switch) can be measured reproducibly.
New directory xplat/executorch/extension/image/benchmark/:
* image_processor_benchmark.cpp (cxx_binary) — times process_into (BGRA/RGBA) and process_yuv_into (NV12/NV21) over a sweep of common input sizes × target sizes. Per cell it runs variants covering execution path (CPU / GPU / size-default), resize mode (stretch / letterbox), orientation (upright + 90°), cropped ROI, and the allocating process() vs process_into(). Each row reports mean/median/p95/stddev over 100 iters (10 warmup) on a synthetic gradient input; a row that fails is reported as ERROR rather than timed.
* Flags (all optional): --format=bgra|rgba|nv12|nv21, --unit=cpu|gpu|default (both default to all), --out=PATH (writes a clean results table; the input-size sweep and rotation always run). Output is grouped under === API-section banners with a column legend, and --- per-cell separators.
* compare_benchmarks.py (python_binary, stdlib-only) — matches rows by (API section, input→target cell, variant) and prints per-row base / new speedup plus a summary bucketed by execution path (CPU / GPU / default).
* README.md — usage, the build-mode caveat, and the capture→compare workflow.
* BUCK / TARGETS / targets.bzl — build defs.
Note: benchmark only with an optimized build (-c cxx.extra_cxxflags=-Os); the default buck2 run is -O0 and unrepresentative.
Differential Revision: D108048181
9f42724 to
803f6d3
Compare
Summary:
Adds a standalone microbenchmark for the ImageProcessor reuse APIs and a companion script to diff two runs, so kernel/pipeline changes (e.g. the NEON deinterleave switch) can be measured reproducibly.
New directory xplat/executorch/extension/image/benchmark/:
* image_processor_benchmark.cpp (cxx_binary) — times process_into (BGRA/RGBA) and process_yuv_into (NV12/NV21) over a sweep of common input sizes × target sizes. Per cell it runs variants covering execution path (CPU / GPU / size-default), resize mode (stretch / letterbox), orientation (upright + 90°), cropped ROI, and the allocating process() vs process_into(). Each row reports mean/median/p95/stddev over 100 iters (10 warmup) on a synthetic gradient input; a row that fails is reported as ERROR rather than timed.
* Flags (all optional): --format=bgra|rgba|nv12|nv21, --unit=cpu|gpu|default (both default to all), --out=PATH (writes a clean results table; the input-size sweep and rotation always run). Output is grouped under === API-section banners with a column legend, and --- per-cell separators.
* compare_benchmarks.py (python_binary, stdlib-only) — matches rows by (API section, input→target cell, variant) and prints per-row base / new speedup plus a summary bucketed by execution path (CPU / GPU / default).
* README.md — usage, the build-mode caveat, and the capture→compare workflow.
* BUCK / TARGETS / targets.bzl — build defs.
Note: benchmark only with an optimized build (-c cxx.extra_cxxflags=-Os); the default buck2 run is -O0 and unrepresentative.
Differential Revision: D108048181
803f6d3 to
ea24622
Compare
Summary:
Adds a standalone microbenchmark for the ImageProcessor reuse APIs and a companion script to diff two runs, so kernel/pipeline changes (e.g. the NEON deinterleave switch) can be measured reproducibly.
New directory xplat/executorch/extension/image/benchmark/:
Note: benchmark only with an optimized build (-c cxx.extra_cxxflags=-Os); the default buck2 run is -O0 and unrepresentative.
Differential Revision: D108048181