Commit 99ec14f
committed
[ExecuTorch][WebGPU] GPU timestamp query profiling for SDPA
Pull Request resolved: #20167
SDPA-specific instrumentation layered on the general GPU-timestamp infrastructure (companion diff below): tag each fused SDPA dispatch with its `kernel_name` so the `WebGPUQueryPool` can attribute on-GPU time to the attention stage that produced it. `sdpa_with_kv_cache` runs four chained dispatches — `update_cache` -> QK (`attn_weights`) -> softmax -> AV (`compute_out`); `WebGPUGraph::execute()` brackets each compute pass with a timestamp when the pool is active, and this diff labels each dispatch so the per-pass durations map back to the right stage. Opt-in via the `WEBGPU_TIMESTAMP_QUERY` env var; off by default, so the production `execute()` path is byte-identical. This is the per-kernel hook a forthcoming SDPA kernel benchmark will read; the benchmark itself (and any comparative numbers) is a separate follow-up.
Co-authored with Claude.
ghstack-source-id: 392093463
@exported-using-ghexport
Differential Revision: [D107678235](https://our.internmc.facebook.com/intern/diff/D107678235/)1 parent b43121c commit 99ec14f
1 file changed
Lines changed: 11 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
156 | 156 | | |
157 | 157 | | |
158 | 158 | | |
159 | | - | |
| 159 | + | |
| 160 | + | |
160 | 161 | | |
161 | 162 | | |
162 | 163 | | |
| |||
227 | 228 | | |
228 | 229 | | |
229 | 230 | | |
230 | | - | |
| 231 | + | |
231 | 232 | | |
232 | 233 | | |
233 | 234 | | |
| |||
269 | 270 | | |
270 | 271 | | |
271 | 272 | | |
272 | | - | |
| 273 | + | |
| 274 | + | |
273 | 275 | | |
274 | 276 | | |
275 | 277 | | |
| |||
473 | 475 | | |
474 | 476 | | |
475 | 477 | | |
476 | | - | |
| 478 | + | |
| 479 | + | |
477 | 480 | | |
478 | 481 | | |
479 | 482 | | |
| |||
496 | 499 | | |
497 | 500 | | |
498 | 501 | | |
499 | | - | |
| 502 | + | |
| 503 | + | |
500 | 504 | | |
501 | 505 | | |
502 | 506 | | |
| |||
521 | 525 | | |
522 | 526 | | |
523 | 527 | | |
524 | | - | |
| 528 | + | |
| 529 | + | |
525 | 530 | | |
526 | 531 | | |
527 | 532 | | |
| |||
0 commit comments