Skip to content

[ET-VK][benchmark] Add JSON operator and shader benchmark cases - #24391

Merged
SS-JIA merged 1 commit into
gh/SS-JIA/677/origfrom
gh/SS-JIA/678/orig
Oct 31, 2026
Merged

SS-JIA merged 1 commit into
gh/SS-JIA/677/origfrom
gh/SS-JIA/678/orig

Conversation

@pytorchbot

Copy link
Copy Markdown
Collaborator

This PR was created by the merge bot to help merge the original PR into the main branch.
ghstack PR number: #24344 by @SS-JIA
^ Please use this as the source of truth for the PR details, comments, and reviews
ghstack PR base: https://github.com/pytorch/executorch/tree/gh/SS-JIA/678/base
ghstack PR head: https://github.com/pytorch/executorch/tree/gh/SS-JIA/678/head
Merge bot PR base: https://github.com/pytorch/executorch/tree/gh/SS-JIA/677/orig
Merge bot PR head: https://github.com/pytorch/executorch/tree/gh/SS-JIA/678/orig
Differential Revision: D128509578
@diff-train-skip-merge

Pull Request resolved: #24344

## Ulterior Motive

Replace C++ benchmark case definitions with JSON specifications.

## Rationale

Introduce `etvk_ops_bench` with inline tensor arguments, deterministic initialization, dtype/storage and shader/workgroup sweeps, operator routes, independent CPU references, and registered throughput estimates. Generate host tensor data once per case and share it between the staged validation graph and a separate benchmark graph using automatic calibration. Select validation scope with `--validation_mode=all|first|none`, defaulting to all cases. Default to compact `json` reports; provide condensed tables and detailed `json_full` reports with per-batch GPU/operator samples and shader statistics. Record Android GPU clock start/end snapshots per measurement pass, adjacent to the corresponding batch timing arrays. Tables show observed minimum/maximum GPU clocks across each case and profiling-only ranges for shader rows. Document measurement boundaries, clock units, and shader percentile sampling.

Migrate 64 sets into 4,560 definitions using production operators directly, without a dependency on the old benchmark directory. Keep quantized references, route checks, and scripts together. Case JSONs and reports omit `legacy_case`. Review framework parsing/execution/reporting first, then operator references/routes and JSON cases, then usage documentation.

This remains one commit above the five runtime commits. Runtime-specific generator tests accompany their implementation; workgroup tests and their Buck target live in `test/api_abstractions/`. Benchmark validation also covers rejection of unrecognized SPIR-V capabilities before pipeline creation.

Non-constant tensor inputs display their configured memory layout after the dtype; constant tensors omit this suffix because operator prepacking selects their GPU layout.

`json` uses untruncated input strings, min/median/max batch timing summaries, and per-pass clock extrema. Float arguments and list elements in input strings use three significant figures. `json_full` preserves tensor descriptions and individual batch samples. Both retain shader timing statistics.

The public README describes the binary, layout, JSON schema, validation, and timing. Internal helper scripts and Buck build instructions are documented under `fb/README.md`; migration documents and the TODO file are omitted.

CI workflow integration will follow separately.

Authored with Codex (AI).
ghstack-source-id: 461636577

Differential Revision: [D128509578](https://our.internmc.facebook.com/intern/diff/D128509578/)
@pytorchbot
pytorchbot requested a review from SS-JIA as a code owner October 31, 2026 16:42
@pytorch-bot

pytorch-bot Bot commented Oct 31, 2026 •

Copy link
Copy Markdown

🔗 Helpful Links

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

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

❌ 24 Pending, 6 Unclassified Failures

As of commit cb0cf38 with merge base aed328d (image):

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.

@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 Oct 31, 2026
@SS-JIA
SS-JIA added this pull request to stack #24392 October 31, 2026 17:19
@SS-JIA
SS-JIA merged commit 05092c1 into main Oct 31, 2026
230 of 242 checks passed
@SS-JIA
SS-JIA deleted the gh/SS-JIA/678/orig branch October 31, 2026 17:21

This branch was successfully deployed

1 active deployment
cadence — cb0cf380 Deployed Oct 31, 2026 by pytorchbot via hifi-op-test / hifi4 #35751
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants