Skip to content

[ET-VK][test] Move operator benchmark binaries under ops/benchmark - #23724

Closed
pytorchbot wants to merge 1 commit into
gh/SS-JIA/660/origfrom
gh/SS-JIA/666/orig
Closed

pytorchbot wants to merge 1 commit into
gh/SS-JIA/660/origfrom
gh/SS-JIA/666/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: #23597 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/666/base
ghstack PR head: https://github.com/pytorch/executorch/tree/gh/SS-JIA/666/head
Merge bot PR base: https://github.com/pytorch/executorch/tree/gh/SS-JIA/660/orig
Merge bot PR head: https://github.com/pytorch/executorch/tree/gh/SS-JIA/666/orig
Differential Revision: D123690842
@diff-train-skip-merge

Pull Request resolved: #23597

## Ulterior Motive

Restructure the Vulkan operator test+benchmark binaries around a single `etvk_benchmark` entry point with registered, per-operator test case sets, so related cases (such as a model's bottleneck shapes) can be grouped and run in isolation.

## Rationale

**What**: Move the test+benchmark binaries, their shared utilities, and the test-only ops and shaders from `test/custom_ops/` into `test/ops/benchmark/`, with one subdirectory per operator under `cases/`, and split the monolithic `utils.{h,cpp}` by topic.

**Why**: The flat `custom_ops/` directory mixes benchmark binaries, framework code, test-only ops, and correctness-only gtests, and `utils.{h,cpp}` (3.5k lines) mixes value specs, test cases, execution, and reporting. Grouping the binaries by operator gives the upcoming case-set registration a home for each operator's cases and reference code.

## Details

- Layout under `test/ops/benchmark/`
  - `framework/`: test framework utilities, `conv2d_utils`, `cm_utils`, and `test_coopmat_probe`.
  - `test_ops/impl/` and `test_ops/glsl/`: test-only ops and shaders, formerly `impl/` and `glsl/`.
  - `cases/`: one directory per operator, `conv2d/` (direct, depthwise, pointwise), `conv1d/`, `q8csw_conv2d/`, `q4gsw_linear/` (including `test_fpa_q4gsw_linear` and `test_coopmat_linear_bench`), `q8csw_linear/`, `mm/`, `sdpa/`, `embedding_q4gsw/`, `choose_qparams_per_row/`, `add/`; `cases/q8ta/` collects the q8ta operators: `conv2d/`, `conv2d_transposed/`, `linear/`, `binary/`, `unary/`, `clone/`, `pixel_shuffle/`, `qdq/`.
- `utils.{h,cpp}` split
  - `config`: global output and debugging options.
  - `labels.h`: test case naming helpers.
  - `value_spec`: `ValueSpec`, data generation, half-precision conversion, and `print_valuespec_data`.
  - `test_case`: `ReferenceKey`, the shader filter defaults, and `TestCase`.
  - `results`: `BenchmarkResult`, `TestResult`, and table printing.
  - `runner`: graph setup, `RepeatedGraphExecutor`, and `execute_test_case(s)`.
  - `weight_utils`: weight canvases and weight sum helpers.
  - `utils.h` includes all of the above, so binaries are unchanged.
  - Moving code into new files exposes it to CLANGTIDY, so its findings are fixed: braces around single-statement bodies, `explicit` on the single-argument `BenchmarkResult`, `TestResult`, and `TestCase` constructors, `const&` for the generator, reference, FLOP calculator, and `op_name` parameters, `utils::safe_downcast<int>` for one narrowing, `(void)` for an unused parameter, and `NOLINTNEXTLINE` on enum `switch`es that list only some enumerators (each has a `default`) and on the `using namespace vkcompute` that binaries rely on. `utils.h` no longer includes `<iostream>`.
- Build
  - `test/ops/benchmark/{BUCK,targets.bzl}` define the binaries, `prototyping_utils`, `operator_implementations`, and `custom_ops_shaderlib`. Binary target names are unchanged; only the package path changes.
  - The CMake project and `build_and_run.sh` move with the binaries and take source paths from the new subdirectories.
- The correctness-only gtests (`utils_test`, `q8ta_conv2d_route_test`, `q8ta_conv2d_stream_plan_test`) stay in `test/custom_ops/`; `utils_test` now depends on `prototyping_utils` in its new package.
- Binaries include framework headers by full path (`executorch/backends/vulkan/test/ops/benchmark/framework/utils.h`).
- CI references move to the new package: the GPU-host and Eureka Skycastle workflows, and the OSS `vulkan.yml` and `pull.yml` workflows.
- Moved files are recorded as renames; the new `BUCK`/`targets.bzl` and the split framework files are recorded as copies.

Binary sources, test cases, and test-only ops are otherwise unchanged.
ghstack-source-id: 446951727
@exported-using-ghexport

Differential Revision: [D123690842](https://our.internmc.facebook.com/intern/diff/D123690842/)
@pytorch-bot

pytorch-bot Bot commented Oct 13, 2026

Copy link
Copy Markdown

🔗 Helpful Links

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

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

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 13, 2026
@SS-JIA SS-JIA closed this Oct 13, 2026

This branch was successfully deployed

1 active deployment
cadence — 8321e1d2 Deployed Oct 13, 2026 by pytorchbot via hifi-op-test / hifi4 #33014
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