Commit ff9b4c5
committed
[ET-VK][sdpa] Add SDPA operator perf benchmark binary (test_sdpa)
Pull Request resolved: #21062
Adds a standalone custom-ops perf binary that builds a ComputeGraph containing only the SDPA op (`llama.custom_sdpa`, the causal LLM KV-cache decode/prefill path) and reports per-dispatch GPU timing for the three SDPA dispatches (QK GEMM, softmax, AV GEMM) in isolation, so shader variants can be A/B-benchmarked without a full model. `TestSDPA.cpp` registers a `test_etvk.test_sdpa` op wrapper that synthesizes `input_pos` from the tensor shapes and drives `llama.custom_sdpa`. Two env toggles: `SDPA_DECODE_ONLY=1` restricts the sweep to the decode (S==1) shape matrix, and `SDPA_NO_CHAIN=1` sets `op_invocations_per_execute=1` to remove inter-invocation pipelining from the timing. Follows the existing `test/custom_ops/` pattern (e.g. `test_mm`) and is registered via `define_custom_op_test_binary` in `targets.bzl`.
ghstack-source-id: 405400496
@exported-using-ghexport
Differential Revision: [D112906312](https://our.internmc.facebook.com/intern/diff/D112906312/)1 parent b22a902 commit ff9b4c5
3 files changed
Lines changed: 414 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
108 | 108 | | |
109 | 109 | | |
110 | 110 | | |
| 111 | + | |
0 commit comments