Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
110 commits
Select commit Hold shift + click to select a range
c14dc81
GFX: add initial Metal plugin skeleton
allnes Nov 28, 2025
45a0b76
GFX: reorganize Metal plugin architecture and ops
allnes Nov 28, 2025
67c852e
GFX: add Metal batchnorm and softmax ops
allnes Nov 29, 2025
dc4a971
GFX: introduce MLIR-based Metal kernel pipeline
allnes Nov 29, 2025
d682aa4
GFX: align Metal tests and restore convolution registration
allnes Dec 3, 2025
c4d1c84
GFX: fix Metal plugin cache teardown in tests
allnes Dec 6, 2025
0739ccf
GFX: route Metal backend logging through metal_logger
allnes Dec 7, 2025
3c8b933
GFX: split Metal kernel compiler and MLIR builders by op
allnes Dec 7, 2025
9776467
GFX: refactor MLIR codegen and add layout op paths
allnes Dec 7, 2025
03b97b3
GFX: add Metal memory manager and compare benchmark
allnes Dec 14, 2025
a9a1627
GFX: refresh Metal docs for MLIR-only execution
allnes Dec 17, 2025
acfa38c
GFX: reuse pipeline output buffers in Metal runtime
allnes Dec 20, 2025
38bafbc
GFX: update benchmarks after Metal buffer reuse
allnes Dec 20, 2025
bbbacbb
GFX: rename Metal plugin module to GFX
allnes Dec 21, 2025
20abe3d
GFX: add Vulkan backend and backend-aware build wiring
allnes Dec 27, 2025
67b1643
GFX: add shared plugin interfaces and Metal backend integration
allnes Dec 30, 2025
0d32c24
GFX: unify Metal infer request and remote tensor plumbing
allnes Jan 1, 2026
4d2cb84
GFX: unify Metal memory and runtime helper layers
allnes Jan 1, 2026
0c4938f
GFX: unify Metal runtime op interfaces and memory flow
allnes Jan 1, 2026
0956fb2
GFX: unify Metal remote tensor and runtime op state
allnes Jan 2, 2026
ec98341
GFX: unify Metal convolution and elementwise runtime paths
allnes Jan 3, 2026
4340fa8
GFX: ignore local plugin build artifacts
allnes Jan 3, 2026
667fa0c
GFX: add stage fusion and fused sequence execution
allnes Jan 3, 2026
83bc49a
GFX: extend fusion and parallel lowering for Vulkan
allnes Jan 4, 2026
3601064
GFX: update vendored LLVM revision
allnes Jan 9, 2026
3b1b15c
GFX: refresh pipeline implementation and local docs
allnes Mar 23, 2026
9664330
GFX: add stage policy and refresh local docs
allnes Mar 24, 2026
54bda30
GFX: add infer submission and runtime reuse caches
allnes Mar 25, 2026
09502fe
GFX: add reusable output planning for infer IO
allnes Mar 25, 2026
1a3ef2e
Merge branch 'master' into an/gfx-plugin
allnes Mar 25, 2026
8ef7c63
GFX: add RPi Vulkan headers and device-aware scheduling
allnes Mar 27, 2026
dd7ea1f
GFX: add extract-slice lowering and debug tooling updates
allnes Mar 28, 2026
8dd6004
GFX: add profiling reports and microbench workflow
allnes Mar 31, 2026
530d6ff
GFX: add gfx_eval compare harness
allnes Mar 31, 2026
b15a6cb
GFX: convert Vulkan-Headers to submodule
allnes Mar 31, 2026
0ab7d02
GFX: document mobile GPU targets and tested devices
allnes Mar 31, 2026
26b1921
GFX: drop pinned OpenVINO version from docs
allnes Mar 31, 2026
4f516fb
GFX: add family-aware scheduling and const upload batching
allnes Mar 31, 2026
a717840
GFX: refine Vulkan tuning and conv dispatch planning
allnes Apr 1, 2026
7ccd78c
GFX: refine SPIR-V binding inference and conv lowering
allnes Apr 1, 2026
c54b8b4
GFX: broaden Broadcom tuning and portable RPi flags
allnes Apr 2, 2026
7f6558b
GFX: add numeric device ids and Vulkan conv dispatch
allnes Apr 2, 2026
9b4a541
GFX: split conv interior window checks
allnes Apr 3, 2026
d183924
Merge branch 'master' into an/gfx-plugin
allnes Apr 10, 2026
cc70f6b
GFX: add local Codex skill pack
allnes Apr 20, 2026
5c2ed6d
GFX: add profiling skill workflow
allnes Apr 20, 2026
97048af
GFX: restore DFL cleanup and typed reduce lowering
allnes Apr 22, 2026
76c41fb
Merge branch 'master' into an/gfx-plugin
allnes Apr 23, 2026
1c4c31a
GFX: add stateful execution and broaden lowering coverage
allnes Apr 26, 2026
9e5e02b
GFX: drop accidental Java API resource file
allnes Apr 26, 2026
28c535d
GFX: pack Metal dynamic matmul const inputs
allnes Apr 26, 2026
7a117d8
GFX: add backend-aware fusion and output reuse
allnes Apr 27, 2026
0b6d391
GFX: add RoPE and fused compressed MatMul
allnes Apr 27, 2026
5afd43f
GFX: add causal-mask SDPA and Metal encoder reuse
allnes Apr 28, 2026
ef3d5d9
GFX: add output aliasing and richer stage metadata
allnes Apr 29, 2026
77d927f
GFX: add Metal MPSRT stage planning
allnes May 1, 2026
cf23007
GFX: add manifest-driven hybrid Metal stages
allnes May 3, 2026
d88f657
GFX: add MPSRT runtime ABI plans and storage bridges
allnes May 3, 2026
a3d2588
GFX: materialize typed MPSRT programs
allnes May 3, 2026
268a28f
GFX: add Apple stage pipeline and MPSRT dialect
allnes May 4, 2026
1bac69e
GFX: update MPSRT custom kernel manifests
allnes May 6, 2026
a2085b1
GFX: consolidate Metal MSL source planning
allnes May 7, 2026
e30877a
GFX: extend Metal MPSRT resource planning
allnes May 8, 2026
cf74d17
GFX: share MPSRT model and split source planning
allnes May 8, 2026
55e9145
GFX: unify custom kernel ABI planning
allnes May 13, 2026
1622bdc
GFX: add MPSGraph vendor routing
allnes May 17, 2026
01c52a2
GFX: tune Vulkan conv dispatch and submission
allnes May 20, 2026
0a623a5
GFX: add OpenCL source backend
allnes May 23, 2026
6cdebe7
GFX: expand OpenCL source coverage
allnes May 24, 2026
587128c
GFX: extend OpenCL source data movement
allnes May 25, 2026
6ce84d4
docs: update gfx plugin documentation
allnes May 26, 2026
78a19e2
docs: update gfx plugin documentation
allnes May 26, 2026
ad9e514
docs: update gfx plugin documentation
allnes May 26, 2026
cd99c59
docs: update gfx plugin documentation
allnes May 27, 2026
e7e4aba
docs: update gfx plugin documentation
allnes May 28, 2026
6a03714
docs: update gfx plugin documentation
allnes May 28, 2026
0b3eca7
docs: update gfx plugin documentation
allnes May 29, 2026
408b878
docs: update gfx plugin documentation
allnes Jun 1, 2026
42b623f
docs: update gfx plugin documentation
allnes Jun 1, 2026
33b57b6
docs: update gfx plugin documentation
allnes Jun 1, 2026
146b4a4
docs: update gfx plugin documentation
allnes Jun 1, 2026
1959a3c
docs: update gfx plugin documentation
allnes Jun 2, 2026
4e389b5
docs: update gfx plugin documentation
allnes Jun 2, 2026
b20af4f
docs: update gfx plugin documentation
allnes Jun 2, 2026
f0bc551
docs: update gfx plugin documentation
allnes Jun 3, 2026
83aaa84
docs: update gfx plugin documentation
allnes Jun 4, 2026
af2a1ab
docs: update gfx plugin documentation
allnes Jun 5, 2026
6ab3d1d
Merge upstream master into GFX plugin branch
allnes Jun 5, 2026
30d80c9
GFX: drop accidental Java API changes
allnes Jun 5, 2026
b1103c0
GFX: fix test whitespace
allnes Jun 5, 2026
2cfb5c2
GFX: make source-node bridges descriptor-explicit
allnes Jun 6, 2026
0beeadf
GFX: cover descriptor runtime param metadata
allnes Jun 6, 2026
d57cbcc
GFX: make runtime descriptors source-node independent
allnes Jun 6, 2026
8556e6a
GFX: add cache envelope serialization contract
allnes Jun 7, 2026
f9ce985
GFX: add generated OpenCL convolution units
allnes Jun 7, 2026
42acf2c
GFX: catalog OpenCL source kernel units
allnes Jun 9, 2026
5594f91
Merge remote-tracking branch 'upstream/master' into an/gfx-plugin
allnes Jun 9, 2026
9f03ead
docs: update gfx plugin documentation
allnes Jun 10, 2026
52dc3fa
docs: update gfx plugin documentation
allnes Jun 13, 2026
05f41c8
Merge upstream master into an/gfx-plugin
allnes Jun 13, 2026
ffba5e4
docs: update gfx plugin documentation
allnes Jun 15, 2026
acbc60f
Merge remote-tracking branch 'upstream/master' into an/gfx-plugin
allnes Jun 16, 2026
1be163a
docs: update gfx plugin documentation
allnes Jun 16, 2026
4b35dcc
Merge branch 'master' into an/gfx-plugin
allnes Jul 14, 2026
121ba11
Merge branch 'master' into an/gfx-plugin
allnes Aug 3, 2026
6bc0292
Merge branch 'master' into an/gfx-plugin
allnes Aug 4, 2026
9c98c91
Merge branch 'master' into an/gfx-plugin
allnes Aug 19, 2026
3209c88
Merge branch 'master' into an/gfx-plugin
allnes Sep 14, 2026
6ec60d3
Merge branch 'master' into an/gfx-plugin
allnes Oct 1, 2026
1c3dcf1
Merge branch 'master' into an/gfx-plugin
allnes Oct 2, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ jobs:
-DBUILD_nvidia_plugin=OFF \
-DBUILD_ollama_openvino=OFF \
-DBUILD_llama_cpp_plugin=OFF \
-DBUILD_gfx_plugin=OFF \
-DENABLE_INTEL_GPU=OFF \
-DENABLE_OV_TF_FRONTEND=OFF \
-DENABLE_OV_PADDLE_FRONTEND=OFF \
Expand Down
13 changes: 7 additions & 6 deletions .github/workflows/mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,12 +101,13 @@ jobs:
-GNinja \
-DCMAKE_VERBOSE_MAKEFILE=ON \
-DCMAKE_BUILD_TYPE=${{ env.CMAKE_BUILD_TYPE }} \
-DBUILD_nvidia_plugin=OFF \
-DBUILD_ollama_openvino=OFF \
-DBUILD_llama_cpp_plugin=OFF \
-DOPENVINO_EXTRA_MODULES=${{ env.OPENVINO_CONTRIB_REPO }}/modules \
-DCMAKE_OSX_DEPLOYMENT_TARGET=${{ env.MACOSX_DEPLOYMENT_TARGET }} \
-DCMAKE_OSX_ARCHITECTURES=${{ env.OSX_ARCHITECTURES }} \
-DBUILD_nvidia_plugin=OFF \
-DBUILD_ollama_openvino=OFF \
-DBUILD_llama_cpp_plugin=OFF \
-DBUILD_gfx_plugin=OFF \
-DOPENVINO_EXTRA_MODULES=${{ env.OPENVINO_CONTRIB_REPO }}/modules \
-DCMAKE_OSX_DEPLOYMENT_TARGET=${{ env.MACOSX_DEPLOYMENT_TARGET }} \
-DCMAKE_OSX_ARCHITECTURES=${{ env.OSX_ARCHITECTURES }} \
-DCMAKE_CXX_COMPILER_LAUNCHER=${{ env.CMAKE_CXX_COMPILER_LAUNCHER }} \
-DCMAKE_C_COMPILER_LAUNCHER=${{ env.CMAKE_C_COMPILER_LAUNCHER }} \
-DENABLE_OV_PADDLE_FRONTEND=OFF \
Expand Down
13 changes: 7 additions & 6 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -143,12 +143,13 @@ jobs:
& "C:\tools\opencv\build\setup_vars_opencv4.cmd"
cmake -GNinja `
-DCMAKE_BUILD_TYPE=${{ env.CMAKE_BUILD_TYPE }} `
-DBUILD_nvidia_plugin=OFF `
-DBUILD_ollama_openvino=OFF `
-DBUILD_llama_cpp_plugin=OFF `
-DENABLE_OV_TF_FRONTEND=OFF `
-DENABLE_OV_PADDLE_FRONTEND=OFF `
-DENABLE_OV_TF_LITE_FRONTEND=OFF `
-DBUILD_nvidia_plugin=OFF `
-DBUILD_ollama_openvino=OFF `
-DBUILD_llama_cpp_plugin=OFF `
-DBUILD_gfx_plugin=OFF `
-DENABLE_OV_TF_FRONTEND=OFF `
-DENABLE_OV_PADDLE_FRONTEND=OFF `
-DENABLE_OV_TF_LITE_FRONTEND=OFF `
-DENABLE_OV_PYTORCH_FRONTEND=OFF `
-DENABLE_INTEL_GPU=OFF `
-DENABLE_SAMPLES=OFF `
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
# SPDX-License-Identifier: Apache-2.0

.vscode/
build*
/builds/
11 changes: 11 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[submodule "modules/gfx_plugin/third_party/llvm-project"]
path = modules/gfx_plugin/third_party/llvm-project
url = https://github.com/llvm/llvm-project.git
[submodule "modules/gfx_plugin/third_party/clvk"]
path = modules/gfx_plugin/third_party/clvk
url = https://github.com/kpet/clvk.git
branch = main
[submodule "modules/gfx_plugin/third_party/clspv"]
path = modules/gfx_plugin/third_party/clspv
url = https://github.com/google/clspv.git
branch = llvm/release/22.x
340 changes: 340 additions & 0 deletions modules/gfx_plugin/.codex/skills/gfx-plugin-dev/SKILL.md

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
interface:
display_name: "GFX Plugin Dev"
short_description: "Build and refactor the OpenVINO GFX plugin"
default_prompt: "Use $gfx-plugin-dev to implement or refactor a GFX plugin change."
180 changes: 180 additions & 0 deletions modules/gfx_plugin/.codex/skills/gfx-plugin-docs/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,180 @@
---
name: gfx-plugin-docs
description: Use when updating published documentation for modules/gfx_plugin after code changes, especially README, ARCHITECTURE, DEVELOPMENT, TESTING, USAGE, profiling, or microbench docs.
---

# GFX Plugin Docs

This skill keeps `modules/gfx_plugin` documentation aligned with the current
implementation.

## Use This Skill When

- The code changed and docs may be stale.
- Public properties, device semantics, backend routes, supported shapes,
profiling, microbench output, or test layout changed.
- The task asks to clean public docs, repo-local skills, or developer
instructions.

## Published Docs

Primary files:

- `README.md`
- `docs/ARCHITECTURE.md`
- `docs/DEVELOPMENT.md`
- `docs/TESTING.md`
- `docs/USAGE.md`

Operational files:

- `docs/MICROBENCH_SCHEMA.md`
- `docs/PROFILING_RUNBOOK.md`

Repo-local skills can also be public orientation material:

- `.codex/skills/gfx-plugin-dev/SKILL.md`
- `.codex/skills/gfx-plugin-docs/SKILL.md`
- `.codex/skills/gfx-plugin-testing/SKILL.md`
- `.codex/skills/gfx-plugin-profiling/SKILL.md`
- `.codex/skills/gfx-plugin-release-sync/SKILL.md`

Do not edit `AGENTS.md` unless the user explicitly asks.

## Update Strategy

1. Inspect the live source tree and current diff first.
2. Identify whether the change affects:
- backend availability, default backend resolution, or CMake-selected
backend registration/stub translation units
- compiler service, backend registry, lowering-plan, manifest, executable
bundle, pipeline-stage builder, pipeline-stage fusion selection,
compiler-side pipeline-stage I/O plan, runtime pipeline-stage plan,
memory plan, cache envelope, runtime executable descriptor builder,
stage-placement policy, stage compiler policy, fused-output lifetime plan,
runtime pipeline-stage materializer, runtime session, or runtime
descriptor behavior
- public compiled-model cache boundaries, including `ov::cache_dir`,
`export_model()`, `import_model()`, cache-envelope wire/store/load
contracts, cache import/repository behavior, backend payload codecs, and
whether the envelope is a plugin-owned public runtime contract or
internal-only
- descriptor-owned tensor binding contracts, generated source
`RuntimeParams` ownership, descriptor-owned `ConstTensor`
materialization, or fail-closed source-node boundary policy
- compiler-owned tensor-layout classification
- public properties
- `query_model()` or compile behavior
- MLIR support/lowering/backend hooks and backend-owned source planning
- Metal placement, MPSRT records, MPS/MPSGraph descriptors,
vendor primitive artifact materialization, shared MPSRT vendor contracts,
`VendorDescriptor` payloads, generated activation/elementwise/reduction/
Softmax/LogSoftmax MSL routes, `Swish` static/runtime beta contracts,
Pool2D vendor-route-only behavior, or MSL binding
- OpenCL source-artifact coverage, runtime-shape handling, static f32
scalars, constants, generated activation/elementwise units, generated f32
Conv2D/GroupConv2D units, generated f32 MatMul units,
generated f32/f16 Softmax units,
dynamic-static-rank Softmax units, generated f32/f16 Pool2D units,
generated f32/f16/i64 Range units, generated f32/f16 Interpolate units,
generated f32 numeric reduction units, generated boolean logical reduction
units, generated ShapeOf/Tile units, generated compare/select and
logical-bool elementwise units, the
`opencl_kernel_unit_catalog.*` route catalog, family-specific OpenCL
kernel-unit adapters, `Swish` default/static/runtime beta artifacts,
missing-route behavior for Transpose/Concat/Split and unsupported MatMul
variants, chunking, or boolean-buffer behavior
- OpenCL remote context/tensor behavior, external `cl_mem` validation, and
backend-unavailable adapters
- CLVK/CLSPV Raspberry OpenCL bundle wiring, OpenCL dynamic-loader search
order, or third-party submodule publication
- OpenCL runtime-bundle candidate ordering or bundled tool-path setup
- backend-owned OpenCL payload materialization in
`src/backends/opencl/compiler/opencl_kernel_artifacts.*`
- removal or reintroduction risk around `BackendLowering`,
`metal_lowering`, `mps_graph_attention_stage`, or source-signature ABI
fallback behavior
- backend stage placement, stage policy, parallelism, partitioning,
submission, caches, or workspace allocation
- stateful `ReadValue` / `Assign`
- output aliasing, compiler-owned pipeline-stage I/O planning, fused-output
lifetimes, pipeline-stage materialization, or source-node-aware output
resolution
- descriptor-backed view-only stages
- compare-runner, profiling, trace sinks, microbench, or target-profile
output
- test layout, controlled test `plugins.xml`, gtest matrix checks,
disabled-pattern hooks, or validation workflow
3. Patch only docs/skills whose contract changed.
4. Keep wording concrete and tied to actual files that exist.

For documentation/security publication tasks, do not run build or test targets
unless the user explicitly asks for that validation. Use source inspection,
security/stale-reference grep, `git diff --check`, and staged diff review for
the publication gate.

## Mapping

- `src/plugin/` or property changes:
- `README.md`
- `docs/USAGE.md`
- `docs/DEVELOPMENT.md`

- `src/compiler/`, compiler backend policies, manifests, executable bundles, or
runtime descriptors:
- `README.md`
- `docs/ARCHITECTURE.md`
- `docs/DEVELOPMENT.md`
- `docs/TESTING.md`

- `src/runtime/`, scheduling, caches, memory, or profiling:
- `README.md`
- `docs/ARCHITECTURE.md`
- `docs/DEVELOPMENT.md`
- `docs/TESTING.md`
- `docs/PROFILING_RUNBOOK.md` when counters or profiling flow changed

- `src/mlir/`, `src/kernel_ir/`, or `src/transforms/`:
- `README.md` for user-visible support changes
- `docs/ARCHITECTURE.md`
- `docs/DEVELOPMENT.md`
- `docs/TESTING.md`

- Metal backend or MPSRT changes:
- `README.md`
- `docs/ARCHITECTURE.md`
- `docs/DEVELOPMENT.md`
- `docs/TESTING.md`
- `docs/USAGE.md` for public properties or diagnostics

- OpenCL backend or source-artifact changes:
- `README.md`
- `docs/ARCHITECTURE.md`
- `docs/DEVELOPMENT.md`
- `docs/TESTING.md`
- `docs/USAGE.md`

- compare/profiling/microbench tools:
- `docs/TESTING.md`
- `docs/USAGE.md`
- `docs/MICROBENCH_SCHEMA.md`
- `docs/PROFILING_RUNBOOK.md`

## Writing Rules

- Do not describe removed architectures or removed backends as current.
- Do not promise backend parity unless tests and code support it.
- Use exact property names such as `GFX_BACKEND`, `ov::available_devices`, and
`ov::device::id`.
- Mention concrete source or test files when that helps orientation.
- Keep README public-facing; keep deep mechanics in `docs/ARCHITECTURE.md` and
`docs/DEVELOPMENT.md`.
- Keep docs in English.
- Keep local dumps, build artifacts, machine paths, sensitive access material, and agent notes
out of public docs and commits.

## Output Expectations

- State which docs changed and why.
- State what stale or private content was removed.
- If no doc change is needed after inspection, say that explicitly.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
interface:
display_name: "GFX Plugin Docs"
short_description: "Keep GFX plugin docs aligned with code"
default_prompt: "Use $gfx-plugin-docs to sync GFX plugin documentation with the current code."
139 changes: 139 additions & 0 deletions modules/gfx_plugin/.codex/skills/gfx-plugin-profiling/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
---
name: gfx-plugin-profiling
description: Use when analyzing GFX plugin performance, profiling reports, microbench output, trace correlation, or backend overhead on macOS, Android, Linux, or Raspberry Pi for Metal and OpenCL paths.
---

# GFX Plugin Profiling

This skill is for performance triage and profiling workflows in
`modules/gfx_plugin/`.

## Use This Skill When

- The user asks about performance, bottlenecks, slow inference, submit overhead,
cache effects, transfer pressure, or synchronization cost.
- The task mentions `GFX_PROFILING_REPORT`, `ov_gfx_microbench`, MB0-MB3,
Perfetto, AGI, Xcode/Instruments, or `perf`.
- The task needs interpretation of profiling JSON, calibration artifacts, or
trace output.
- The task compares `metal`, `opencl`, or `auto` and needs to confirm which
backend route actually ran.

## Read First

1. `docs/PROFILING_RUNBOOK.md`
2. `docs/MICROBENCH_SCHEMA.md`
3. `docs/USAGE.md`
4. `docs/TESTING.md`
5. `README.md`

## Tooling Surface

- `ov_gfx_microbench`
- `GFX_PROFILING_REPORT`
- `OV_GFX_PROFILE_TRACE` trace sinks registered through
`src/runtime/gfx_profiling_trace_sink.*`
- `tools/gfx_profile_runbook.py`
- `tools/gfx_microbench_smoke.py`
- `tools/gfx_calibration_diff.py`
- `tools/gfx_external_trace_summary.py`

Native trace surfaces:

- macOS: Instruments, `xcrun xctrace`, Xcode GPU capture, Metal-registered
`signpost` / `os_signpost` trace sinks
- Android: Perfetto or AGI
- Linux/Raspberry Pi: `perf stat`, `perf record`

## Core Workflow

1. Rebuild the relevant binary.
2. Run `ov_gfx_microbench` and save report plus calibration JSON.
3. Run the real workload with profiling enabled.
4. Capture a platform trace only when plugin counters point to a category.
5. Correlate:
- `analysis.triage_hints`
- `benchmarks[].derived`
- `benchmarks[].profile_digest`
- `GFX_PROFILING_REPORT.compile`
- `GFX_PROFILING_REPORT.extended`
- `GFX_PROFILING_REPORT.extended.target_profile`

## Inspect First

### Fixed Overhead

- MB0 fixed overhead
- `fixed_overhead_us`
- `fixed_overhead_share`
- first-to-steady ratios

### Synchronization

- wait segments
- `wait_share_of_wall`
- final fence wait counters
- submit and barrier counts
- dependency-window extension counters

### Transfers

- H2D/D2H bytes
- upload/download spans
- `transfer_share_of_wall`
- remote tensor and output reuse paths

### Binding Or Descriptor Churn

- descriptor or binding update counters
- prepared binding cache behavior
- `binding_prepare_in_infer`
- Metal `mpsrt_*` resource-binding counters
- OpenCL program/kernel setup spans

### Compile Or Cache Regression

- `compile_ms`
- pipeline creation counters
- OpenCL program-cache behavior
- Metal MSL/MPSRT prepared-pipeline cache counters
- first-infer versus steady-state timing

## Interpretation Rules

- Treat microbench numbers as heuristics, not peak hardware claims.
- Use `ov_gfx_compare_runner` for correctness and `ov_gfx_microbench` for
profiling triage.
- Distinguish wall time, GPU time, and overhead-subtracted estimates.
- Confirm `actual_backend`, `extended.target_profile`, or target backend
counters before comparing `auto`, Metal, and OpenCL runs.
- Treat standalone OpenCL microbench output as kernel evidence only; plugin
performance claims require execution through the GFX OpenCL backend.

## Platform Notes

### macOS

- Prefer signposts or `xctrace` when correlating CPU and Metal execution.
- Compare command-buffer timing with plugin stage/segment timing.
- Capture GFX profile output with compare-runner when placement counters and
accuracy need to be tied to the same run.

### Android / OpenCL

- Use Perfetto or AGI for GPU busy/idle gaps and CPU blocking around queue
submits or waits.
- Confirm the target has a working OpenCL GPU runtime before interpreting
backend performance.

### Linux / Raspberry Pi OpenCL

- Use `perf stat` and `perf record` for CPU-side attribution.
- Keep backend, device key, model, runtime libraries, and calibration artifact
matched before comparing runs.

## Output Expectations

- State the most likely bottleneck category first.
- Point to exact fields or tool outputs.
- Recommend the next measurement step or fix target.
Loading
Loading