feat: add WebGPU DAS backend

This commit is contained in:
Codex
2026-08-28 11:26:19 +09:00
parent 08fcf578de
commit d5f7530620
15 changed files with 2136 additions and 29 deletions
+23
View File
@@ -0,0 +1,23 @@
# WebGPU 기준 실측
2026-08-28에 Chrome 151 headless, Intel Gen9 adapter에서 synthetic 1 kHz fixture를 측정했다. 입력은
48 kHz · 0.25 s, 192 microphones, FFT 512 / hop 256, 900–1100 Hz band이며 16×16 warm-up 뒤 각
해상도를 3회 실행한 중앙값이다.
| scan grid | complex MAC | GPU wall median | end-to-end median | working set | 50² 대비 GPU wall |
| --- | ---: | ---: | ---: | ---: | ---: |
| 50×50 | 44,160,000 | 79.2 ms | 1,818.1 ms | 9.33 MiB | 1.00× |
| 100×100 | 176,640,000 | 251.4 ms | 2,102.0 ms | 36.91 MiB | 3.17× |
| 200×200 | 706,560,000 | 891.9 ms | 4,206.7 ms | 80.47 MiB | 11.26× |
`GPU wall`은 host packing/`writeBuffer()` 호출 직후부터 queue에 들어간 transfer 완료, steering pass,
DAS pass와 readback까지 기다린 시간이다. `end-to-end`에는 이 host 작업과 장치/pipeline 초기화,
distance 생성, CPU STFT가 포함된다. 200×200은 64 MiB steering buffer 목표를 지키면서 두 FFT bin을
한 번에 유지하고 scan point를 21,845개씩 나눈다. 따라서 point chunk가 필요해도 CPU FFT를 다시
계산하지 않는다. 절대 시간은 브라우저, driver와 GPU에 따라 달라지며 자동 성능 통과/실패 기준으로
쓰지 않는다.
같은 환경의 자동 검증에서 192채널·50×50 GPU raw map은 CPU raw map 대비 peak-normalized RMS
오차 `3.008e-5`를 기록했고, 모든 37개 테스트를 통과했다. 상세 원자료는
`webgpu-intel-gen9-2026-08-28.json`에 있다. 사용자는 `/benchmarks/webgpu-scaling.html`에서 자신의
장치 결과를 다시 측정해 JSON으로 저장할 수 있다.
@@ -0,0 +1,90 @@
{
"schemaVersion": "1.0.0",
"kind": "micarrsim.webgpu-benchmark",
"createdAt": "2026-08-28T02:24:00.354Z",
"fixture": {
"arrayId": "rectangular-16x12",
"microphoneCount": 192,
"sceneId": "single-tone",
"durationSeconds": 0.25,
"sampleRate": 48000,
"fftSize": 512,
"hopSize": 256,
"selectedBandHz": [[900, 1100]]
},
"environment": {
"userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/151.0.0.0 Safari/537.36",
"adapterInfo": {
"vendor": "intel",
"architecture": "gen-9",
"device": "",
"description": ""
},
"timingKind": "wall-clock",
"note": "GPU wall time starts after host packing/writeBuffer calls and waits for queued transfers, two compute passes, and readback; total also includes device/pipeline setup and CPU STFT."
},
"signalGenerationMs": 1200.5,
"warmupGrid": "16x16",
"resolutions": [
{
"grid": "50x50",
"pointCount": 2500,
"runs": 3,
"medianTotalMs": 1818.1,
"medianStftMs": 1669.8,
"medianGpuWallMs": 79.2,
"medianBeamformingMs": 162.1,
"localizationErrorM": 0.008227,
"complexMacCount": 44160000,
"estimatedGpuWorkingMiB": 9.33,
"binBatchSize": 2,
"pointBatchSize": 2500,
"samples": [
{ "totalMs": 1907.7, "stftMs": 1727.7, "gpuWallMs": 82.5, "beamformingMs": 180 },
{ "totalMs": 1795.7, "stftMs": 1633.6, "gpuWallMs": 79.2, "beamformingMs": 162.1 },
{ "totalMs": 1818.1, "stftMs": 1669.8, "gpuWallMs": 79.1, "beamformingMs": 148.3 }
],
"gpuWallScalingVs50": 1
},
{
"grid": "100x100",
"pointCount": 10000,
"runs": 3,
"medianTotalMs": 2102,
"medianStftMs": 1681.1,
"medianGpuWallMs": 251.4,
"medianBeamformingMs": 537.8,
"localizationErrorM": 0.001515,
"complexMacCount": 176640000,
"estimatedGpuWorkingMiB": 36.91,
"binBatchSize": 2,
"pointBatchSize": 10000,
"samples": [
{ "totalMs": 2102, "stftMs": 1564.2, "gpuWallMs": 251.4, "beamformingMs": 537.8 },
{ "totalMs": 2220.1, "stftMs": 1681.1, "gpuWallMs": 254.7, "beamformingMs": 539 },
{ "totalMs": 2098.8, "stftMs": 1685, "gpuWallMs": 220.4, "beamformingMs": 413.8 }
],
"gpuWallScalingVs50": 3.17
},
{
"grid": "200x200",
"pointCount": 40000,
"runs": 3,
"medianTotalMs": 4206.7,
"medianStftMs": 2057.5,
"medianGpuWallMs": 891.9,
"medianBeamformingMs": 2039,
"localizationErrorM": 0.002099,
"complexMacCount": 706560000,
"estimatedGpuWorkingMiB": 80.468,
"binBatchSize": 2,
"pointBatchSize": 21845,
"samples": [
{ "totalMs": 4206.7, "stftMs": 2057.5, "gpuWallMs": 891.9, "beamformingMs": 2149.2 },
{ "totalMs": 3388.9, "stftMs": 1686.9, "gpuWallMs": 808.5, "beamformingMs": 1702 },
{ "totalMs": 6227.8, "stftMs": 4188.8, "gpuWallMs": 939.7, "beamformingMs": 2039 }
],
"gpuWallScalingVs50": 11.26
}
]
}