oidn-web 0.3.4 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +49 -0
- package/README.md +140 -4
- package/benchmarks/compare.mjs +651 -0
- package/benchmarks/leak.mjs +255 -0
- package/benchmarks/results/before-spatial.json +391 -0
- package/benchmarks/results/before-spatial.md +47 -0
- package/benchmarks/results/int8-scan.json +2007 -0
- package/benchmarks/results/int8-scan.md +160 -0
- package/benchmarks/results/int8-w8a8-scan.json +2007 -0
- package/benchmarks/results/int8-w8a8-scan.md +160 -0
- package/benchmarks/results/int8-weight-channel.json +1413 -0
- package/benchmarks/results/int8-weight-channel.md +118 -0
- package/benchmarks/results/int8-weight-only.json +1437 -0
- package/benchmarks/results/int8-weight-only.md +118 -0
- package/benchmarks/results/kernel-webnn-final.json +1115 -0
- package/benchmarks/results/kernel-webnn-final.md +104 -0
- package/benchmarks/results/latest-optimized.json +375 -0
- package/benchmarks/results/latest-optimized.md +47 -0
- package/benchmarks/results/latest.json +391 -0
- package/benchmarks/results/latest.md +47 -0
- package/benchmarks/results/profile-baseline.json +331 -0
- package/benchmarks/results/profile-baseline.md +12 -0
- package/benchmarks/results/profile-conv2x.json +331 -0
- package/benchmarks/results/profile-conv2x.md +12 -0
- package/benchmarks/results/profile-fast-init.json +385 -0
- package/benchmarks/results/profile-fast-init.md +47 -0
- package/benchmarks/results/profile-fp16-fma.json +369 -0
- package/benchmarks/results/profile-fp16-fma.md +47 -0
- package/benchmarks/results/profile-fp16-tiled-decoder.json +369 -0
- package/benchmarks/results/profile-fp16-tiled-decoder.md +47 -0
- package/benchmarks/results/profile-fp16-tiled-encoder.json +369 -0
- package/benchmarks/results/profile-fp16-tiled-encoder.md +47 -0
- package/benchmarks/results/profile-fp16-unfused-pool.json +385 -0
- package/benchmarks/results/profile-fp16-unfused-pool.md +47 -0
- package/benchmarks/results/profile-input-major.json +347 -0
- package/benchmarks/results/profile-input-major.md +12 -0
- package/benchmarks/results/profile-k16.json +347 -0
- package/benchmarks/results/profile-k16.md +12 -0
- package/benchmarks/results/profile-k4.json +347 -0
- package/benchmarks/results/profile-k4.md +12 -0
- package/benchmarks/results/profile-pool-reuse.json +331 -0
- package/benchmarks/results/profile-pool-reuse.md +12 -0
- package/benchmarks/results/profile-precompiled.json +385 -0
- package/benchmarks/results/profile-precompiled.md +47 -0
- package/benchmarks/results/profile-static-channels.json +385 -0
- package/benchmarks/results/profile-static-channels.md +47 -0
- package/benchmarks/results/profile-static-io.json +385 -0
- package/benchmarks/results/profile-static-io.md +47 -0
- package/benchmarks/results/profile-tiled-conv.json +331 -0
- package/benchmarks/results/profile-tiled-conv.md +12 -0
- package/benchmarks/results/profile-tiled-decoder.json +347 -0
- package/benchmarks/results/profile-tiled-decoder.md +12 -0
- package/benchmarks/results/profile-tiled-matmul.json +331 -0
- package/benchmarks/results/profile-tiled-matmul.md +12 -0
- package/benchmarks/results/profile-unfused-decoder.json +379 -0
- package/benchmarks/results/profile-unfused-decoder.md +12 -0
- package/benchmarks/results/profile-unfused-pool.json +347 -0
- package/benchmarks/results/profile-unfused-pool.md +12 -0
- package/benchmarks/results/spatial-auto.json +575 -0
- package/benchmarks/results/spatial-auto.md +61 -0
- package/benchmarks/results/subgroup-smoke.json +1094 -0
- package/benchmarks/results/subgroup-smoke.md +104 -0
- package/benchmarks/results/webnn-smoke.json +739 -0
- package/benchmarks/results/webnn-smoke.md +76 -0
- package/dist/oidn.js +4189 -22603
- package/dist/oidn.umd.cjs +784 -5807
- package/lib/UNet.d.ts +66 -15
- package/lib/UNet.js +162 -257
- package/lib/UNet.js.map +1 -1
- package/lib/WGPUComputePass.d.ts +1 -1
- package/lib/WGPUComputePass.js +6 -4
- package/lib/WGPUComputePass.js.map +1 -1
- package/lib/backend.d.ts +8 -4
- package/lib/backend.js +36 -44
- package/lib/backend.js.map +1 -1
- package/lib/graphOptimizer.d.ts +54 -0
- package/lib/graphOptimizer.js +216 -0
- package/lib/graphOptimizer.js.map +1 -0
- package/lib/main.d.ts +33 -10
- package/lib/main.js +5 -0
- package/lib/main.js.map +1 -1
- package/lib/modelSpec.d.ts +80 -0
- package/lib/modelSpec.js +270 -0
- package/lib/modelSpec.js.map +1 -0
- package/lib/nativeUNet.d.ts +67 -0
- package/lib/nativeUNet.js +1735 -0
- package/lib/nativeUNet.js.map +1 -0
- package/lib/process.js +38 -35
- package/lib/process.js.map +1 -1
- package/lib/resourceTracker.d.ts +26 -0
- package/lib/resourceTracker.js +65 -0
- package/lib/resourceTracker.js.map +1 -0
- package/lib/tileScheduler.d.ts +33 -0
- package/lib/tileScheduler.js +86 -0
- package/lib/tileScheduler.js.map +1 -0
- package/lib/webnnUNet.d.ts +52 -0
- package/lib/webnnUNet.js +535 -0
- package/lib/webnnUNet.js.map +1 -0
- package/package.json +9 -5
- package/scripts/inspect-model.mjs +64 -0
- package/src/UNet.ts +236 -339
- package/src/WGPUComputePass.ts +6 -4
- package/src/backend.ts +42 -55
- package/src/graphOptimizer.ts +301 -0
- package/src/main.ts +71 -11
- package/src/modelSpec.ts +414 -0
- package/src/nativeUNet.ts +2256 -0
- package/src/process.ts +38 -36
- package/src/resourceTracker.ts +94 -0
- package/src/tileScheduler.ts +138 -0
- package/src/webnnUNet.ts +812 -0
- package/tests/modelSpec.test.mjs +128 -0
- package/tests/resourceLifecycle.test.mjs +383 -0
- package/tests/tileScheduler.test.mjs +90 -0
- package/lib/helper.d.ts +0 -4
- package/lib/helper.js +0 -33
- package/lib/helper.js.map +0 -1
- package/lib/kernels.d.ts +0 -1
- package/lib/kernels.js +0 -26
- package/lib/kernels.js.map +0 -1
- package/src/helper.ts +0 -43
- package/src/kernels.ts +0 -31
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
# oidn-web benchmark
|
|
2
|
+
|
|
3
|
+
- Current: `e6b8577b1c69cc8ce979022717984aec5b9ea881`
|
|
4
|
+
- TFJS baseline: `136c00c34aa5cf4561b4137034dbd643177f0a5f`
|
|
5
|
+
- Input: 512x512, fixed tile 512, 2 runs after 1 warmup(s)
|
|
6
|
+
- Adapter: apple
|
|
7
|
+
|
|
8
|
+
| Runtime | Init ms | Median ms | P95 ms | Speedup | Precision |
|
|
9
|
+
| --- | ---: | ---: | ---: | ---: | --- |
|
|
10
|
+
| TFJS (136c00c) | 10.10 | 36.90 | 37.30 | 1.00x | fp32 |
|
|
11
|
+
| WGSL FP32 Auto | 38.90 | 37.95 | 38.40 | 0.97x | fp32 |
|
|
12
|
+
| WGSL FP32 Direct | 44.20 | 66.35 | 66.40 | 0.56x | fp32 |
|
|
13
|
+
| WGSL FP16 Direct | 28.40 | 29.85 | 30.20 | 1.24x | fp16 |
|
|
14
|
+
| WGSL FP16 Implicit GEMM | 31.00 | 30.75 | 30.80 | 1.20x | fp16 |
|
|
15
|
+
| WGSL FP16 Spatial (experimental) | 29.00 | 65.15 | 65.30 | 0.57x | fp16 |
|
|
16
|
+
| WGSL FP16 Subgroup (experimental) | 115.80 | 31.35 | 31.40 | 1.18x | fp16 |
|
|
17
|
+
| WebNN FP16 (experimental) | skipped | - | - | - | Error: WebNN FP16 WebGPU interop failed: NotSupportedError: Failed to execute 'createExportableTensor' on 'MLContext': WebGPU Interop is not supported. |
|
|
18
|
+
|
|
19
|
+
## Output validation
|
|
20
|
+
|
|
21
|
+
Compared against sampled TFJS FP32 output.
|
|
22
|
+
|
|
23
|
+
| Runtime | Status | MAE | RMSE | Max error | Samples |
|
|
24
|
+
| --- | --- | ---: | ---: | ---: | ---: |
|
|
25
|
+
| WGSL FP32 Auto | pass | 1.11e-6 | 1.81e-6 | 1.36e-5 | 6144 |
|
|
26
|
+
| WGSL FP32 Direct | pass | 1.11e-6 | 1.81e-6 | 1.36e-5 | 6144 |
|
|
27
|
+
| WGSL FP16 Direct | pass | 1.02e-3 | 1.61e-3 | 1.24e-2 | 6144 |
|
|
28
|
+
| WGSL FP16 Implicit GEMM | pass | 1.56e-3 | 2.55e-3 | 4.48e-2 | 6144 |
|
|
29
|
+
| WGSL FP16 Spatial (experimental) | pass | 1.02e-3 | 1.61e-3 | 1.24e-2 | 6144 |
|
|
30
|
+
| WGSL FP16 Subgroup (experimental) | pass | 1.02e-3 | 1.61e-3 | 1.24e-2 | 6144 |
|
|
31
|
+
|
|
32
|
+
## GPU hot layers
|
|
33
|
+
|
|
34
|
+
### WGSL FP32 Auto
|
|
35
|
+
|
|
36
|
+
Profiled GPU total: 37.38 ms
|
|
37
|
+
|
|
38
|
+
| Node | GPU ms |
|
|
39
|
+
| --- | ---: |
|
|
40
|
+
| dec_conv1a | 7.37 |
|
|
41
|
+
| dec_conv2a | 4.67 |
|
|
42
|
+
| dec_conv1b | 4.18 |
|
|
43
|
+
| enc_conv1b | 3.98 |
|
|
44
|
+
| dec_conv3a | 2.32 |
|
|
45
|
+
|
|
46
|
+
### WGSL FP32 Direct
|
|
47
|
+
|
|
48
|
+
Profiled GPU total: 66.17 ms
|
|
49
|
+
|
|
50
|
+
| Node | GPU ms |
|
|
51
|
+
| --- | ---: |
|
|
52
|
+
| dec_conv1a | 10.11 |
|
|
53
|
+
| dec_conv1b | 9.30 |
|
|
54
|
+
| enc_conv1b | 9.19 |
|
|
55
|
+
| dec_conv2a | 7.01 |
|
|
56
|
+
| dec_conv2b | 5.84 |
|
|
57
|
+
|
|
58
|
+
### WGSL FP16 Direct
|
|
59
|
+
|
|
60
|
+
Profiled GPU total: 29.17 ms
|
|
61
|
+
|
|
62
|
+
| Node | GPU ms |
|
|
63
|
+
| --- | ---: |
|
|
64
|
+
| dec_conv1a | 5.06 |
|
|
65
|
+
| dec_conv1b | 3.09 |
|
|
66
|
+
| enc_conv1b | 3.09 |
|
|
67
|
+
| dec_conv2a | 2.98 |
|
|
68
|
+
| dec_conv3a | 2.37 |
|
|
69
|
+
|
|
70
|
+
### WGSL FP16 Implicit GEMM
|
|
71
|
+
|
|
72
|
+
Profiled GPU total: 29.76 ms
|
|
73
|
+
|
|
74
|
+
| Node | GPU ms |
|
|
75
|
+
| --- | ---: |
|
|
76
|
+
| dec_conv1a | 6.26 |
|
|
77
|
+
| dec_conv2a | 3.65 |
|
|
78
|
+
| dec_conv1b | 2.94 |
|
|
79
|
+
| enc_conv1b | 2.94 |
|
|
80
|
+
| enc_conv2b | 2.22 |
|
|
81
|
+
|
|
82
|
+
### WGSL FP16 Spatial (experimental)
|
|
83
|
+
|
|
84
|
+
Profiled GPU total: 65.14 ms
|
|
85
|
+
|
|
86
|
+
| Node | GPU ms |
|
|
87
|
+
| --- | ---: |
|
|
88
|
+
| dec_conv1a | 23.61 |
|
|
89
|
+
| enc_conv1b | 6.07 |
|
|
90
|
+
| dec_conv1b | 6.01 |
|
|
91
|
+
| enc_conv2b | 4.97 |
|
|
92
|
+
| dec_conv2b | 4.35 |
|
|
93
|
+
|
|
94
|
+
### WGSL FP16 Subgroup (experimental)
|
|
95
|
+
|
|
96
|
+
Profiled GPU total: 30.67 ms
|
|
97
|
+
|
|
98
|
+
| Node | GPU ms |
|
|
99
|
+
| --- | ---: |
|
|
100
|
+
| dec_conv1a | 4.38 |
|
|
101
|
+
| dec_conv1b | 4.07 |
|
|
102
|
+
| enc_conv1b | 4.06 |
|
|
103
|
+
| dec_conv2a | 3.14 |
|
|
104
|
+
| dec_conv2b | 2.49 |
|