oidn-web 0.4.0 → 0.5.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.
Files changed (106) hide show
  1. package/CHANGELOG.md +45 -0
  2. package/README.md +83 -19
  3. package/dist/oidn.js +3239 -2642
  4. package/dist/oidn.umd.cjs +512 -296
  5. package/lib/UNet.d.ts +54 -20
  6. package/lib/UNet.js +194 -118
  7. package/lib/UNet.js.map +1 -1
  8. package/lib/backend.d.ts +1 -8
  9. package/lib/backend.js +1 -9
  10. package/lib/backend.js.map +1 -1
  11. package/lib/finalRgbShader.d.ts +13 -0
  12. package/lib/finalRgbShader.js +160 -0
  13. package/lib/finalRgbShader.js.map +1 -0
  14. package/lib/graphOptimizer.js +1 -2
  15. package/lib/graphOptimizer.js.map +1 -1
  16. package/lib/hdrTransfer.d.ts +14 -0
  17. package/lib/hdrTransfer.js +61 -0
  18. package/lib/hdrTransfer.js.map +1 -0
  19. package/lib/main.d.ts +16 -7
  20. package/lib/main.js +4 -5
  21. package/lib/main.js.map +1 -1
  22. package/lib/nativeUNet.d.ts +39 -3
  23. package/lib/nativeUNet.js +449 -120
  24. package/lib/nativeUNet.js.map +1 -1
  25. package/lib/process.d.ts +5 -11
  26. package/lib/process.js +35 -49
  27. package/lib/process.js.map +1 -1
  28. package/lib/tileScheduler.d.ts +32 -4
  29. package/lib/tileScheduler.js +133 -20
  30. package/lib/tileScheduler.js.map +1 -1
  31. package/package.json +9 -2
  32. package/src/UNet.ts +287 -158
  33. package/src/backend.ts +1 -14
  34. package/src/finalRgbShader.ts +186 -0
  35. package/src/graphOptimizer.ts +1 -2
  36. package/src/hdrTransfer.ts +88 -0
  37. package/src/main.ts +28 -13
  38. package/src/nativeUNet.ts +515 -116
  39. package/src/process.ts +43 -70
  40. package/src/tileScheduler.ts +216 -24
  41. package/benchmarks/compare.mjs +0 -651
  42. package/benchmarks/leak.mjs +0 -255
  43. package/benchmarks/results/before-spatial.json +0 -391
  44. package/benchmarks/results/before-spatial.md +0 -47
  45. package/benchmarks/results/int8-scan.json +0 -2007
  46. package/benchmarks/results/int8-scan.md +0 -160
  47. package/benchmarks/results/int8-w8a8-scan.json +0 -2007
  48. package/benchmarks/results/int8-w8a8-scan.md +0 -160
  49. package/benchmarks/results/int8-weight-channel.json +0 -1413
  50. package/benchmarks/results/int8-weight-channel.md +0 -118
  51. package/benchmarks/results/int8-weight-only.json +0 -1437
  52. package/benchmarks/results/int8-weight-only.md +0 -118
  53. package/benchmarks/results/kernel-webnn-final.json +0 -1115
  54. package/benchmarks/results/kernel-webnn-final.md +0 -104
  55. package/benchmarks/results/latest-optimized.json +0 -375
  56. package/benchmarks/results/latest-optimized.md +0 -47
  57. package/benchmarks/results/latest.json +0 -391
  58. package/benchmarks/results/latest.md +0 -47
  59. package/benchmarks/results/profile-baseline.json +0 -331
  60. package/benchmarks/results/profile-baseline.md +0 -12
  61. package/benchmarks/results/profile-conv2x.json +0 -331
  62. package/benchmarks/results/profile-conv2x.md +0 -12
  63. package/benchmarks/results/profile-fast-init.json +0 -385
  64. package/benchmarks/results/profile-fast-init.md +0 -47
  65. package/benchmarks/results/profile-fp16-fma.json +0 -369
  66. package/benchmarks/results/profile-fp16-fma.md +0 -47
  67. package/benchmarks/results/profile-fp16-tiled-decoder.json +0 -369
  68. package/benchmarks/results/profile-fp16-tiled-decoder.md +0 -47
  69. package/benchmarks/results/profile-fp16-tiled-encoder.json +0 -369
  70. package/benchmarks/results/profile-fp16-tiled-encoder.md +0 -47
  71. package/benchmarks/results/profile-fp16-unfused-pool.json +0 -385
  72. package/benchmarks/results/profile-fp16-unfused-pool.md +0 -47
  73. package/benchmarks/results/profile-input-major.json +0 -347
  74. package/benchmarks/results/profile-input-major.md +0 -12
  75. package/benchmarks/results/profile-k16.json +0 -347
  76. package/benchmarks/results/profile-k16.md +0 -12
  77. package/benchmarks/results/profile-k4.json +0 -347
  78. package/benchmarks/results/profile-k4.md +0 -12
  79. package/benchmarks/results/profile-pool-reuse.json +0 -331
  80. package/benchmarks/results/profile-pool-reuse.md +0 -12
  81. package/benchmarks/results/profile-precompiled.json +0 -385
  82. package/benchmarks/results/profile-precompiled.md +0 -47
  83. package/benchmarks/results/profile-static-channels.json +0 -385
  84. package/benchmarks/results/profile-static-channels.md +0 -47
  85. package/benchmarks/results/profile-static-io.json +0 -385
  86. package/benchmarks/results/profile-static-io.md +0 -47
  87. package/benchmarks/results/profile-tiled-conv.json +0 -331
  88. package/benchmarks/results/profile-tiled-conv.md +0 -12
  89. package/benchmarks/results/profile-tiled-decoder.json +0 -347
  90. package/benchmarks/results/profile-tiled-decoder.md +0 -12
  91. package/benchmarks/results/profile-tiled-matmul.json +0 -331
  92. package/benchmarks/results/profile-tiled-matmul.md +0 -12
  93. package/benchmarks/results/profile-unfused-decoder.json +0 -379
  94. package/benchmarks/results/profile-unfused-decoder.md +0 -12
  95. package/benchmarks/results/profile-unfused-pool.json +0 -347
  96. package/benchmarks/results/profile-unfused-pool.md +0 -12
  97. package/benchmarks/results/spatial-auto.json +0 -575
  98. package/benchmarks/results/spatial-auto.md +0 -61
  99. package/benchmarks/results/subgroup-smoke.json +0 -1094
  100. package/benchmarks/results/subgroup-smoke.md +0 -104
  101. package/benchmarks/results/webnn-smoke.json +0 -739
  102. package/benchmarks/results/webnn-smoke.md +0 -76
  103. package/scripts/inspect-model.mjs +0 -64
  104. package/tests/modelSpec.test.mjs +0 -128
  105. package/tests/resourceLifecycle.test.mjs +0 -383
  106. package/tests/tileScheduler.test.mjs +0 -90
@@ -1,118 +0,0 @@
1
- # oidn-web benchmark
2
-
3
- - Current: `4dc1797b24c64aa0d647eada0cb3389fb0d24705`
4
- - TFJS baseline: `136c00c34aa5cf4561b4137034dbd643177f0a5f`
5
- - Input: 512x512, fixed tile 512, 5 runs after 1 warmup(s)
6
- - Adapter: apple
7
-
8
- | Runtime | Init ms | Median ms | P95 ms | Speedup | Precision |
9
- | --- | ---: | ---: | ---: | ---: | --- |
10
- | TFJS (136c00c) | 9.30 | 36.70 | 37.10 | 1.00x | fp32 |
11
- | WGSL FP32 Auto | 38.60 | 37.70 | 37.80 | 0.97x | fp32 |
12
- | WGSL FP32 Direct | 37.60 | 66.50 | 67.20 | 0.55x | fp32 |
13
- | WGSL FP16 Direct | 26.90 | 30.10 | 30.20 | 1.22x | fp16 |
14
- | WGSL FP16 Implicit GEMM | 31.20 | 30.80 | 31.00 | 1.19x | fp16 |
15
- | WGSL FP16 Spatial (experimental) | 28.60 | 65.10 | 65.70 | 0.56x | fp16 |
16
- | WGSL FP16 Subgroup (experimental) | 28.50 | 31.30 | 31.50 | 1.17x | fp16 |
17
- | WGSL INT8 weights / FP16 activations (experimental) | 152.10 | 101.30 | 101.60 | 0.36x | int8 |
18
- | WebNN FP16 (experimental) | skipped | - | - | - | Error: WebNN FP16 WebGPU interop failed: NotSupportedError: Failed to execute 'createExportableTensor' on 'MLContext': WebGPU Interop is not supported. |
19
-
20
- ## Output validation
21
-
22
- Compared against sampled TFJS FP32 output.
23
-
24
- | Runtime | Status | MAE | RMSE | Max error | Samples |
25
- | --- | --- | ---: | ---: | ---: | ---: |
26
- | WGSL FP32 Auto | pass | 1.11e-6 | 1.81e-6 | 1.36e-5 | 6144 |
27
- | WGSL FP32 Direct | pass | 1.11e-6 | 1.81e-6 | 1.36e-5 | 6144 |
28
- | WGSL FP16 Direct | pass | 1.02e-3 | 1.61e-3 | 1.24e-2 | 6144 |
29
- | WGSL FP16 Implicit GEMM | pass | 1.56e-3 | 2.55e-3 | 4.48e-2 | 6144 |
30
- | WGSL FP16 Spatial (experimental) | pass | 1.02e-3 | 1.61e-3 | 1.24e-2 | 6144 |
31
- | WGSL FP16 Subgroup (experimental) | pass | 1.02e-3 | 1.61e-3 | 1.24e-2 | 6144 |
32
- | WGSL INT8 weights / FP16 activations (experimental) | FAIL | 5.26e-1 | 7.73e-1 | 2.58e+0 | 6144 |
33
-
34
- ## GPU hot layers
35
-
36
- ### WGSL FP32 Auto
37
-
38
- Profiled GPU total: 37.10 ms
39
-
40
- | Node | GPU ms |
41
- | --- | ---: |
42
- | dec_conv1a | 7.13 |
43
- | dec_conv2a | 4.59 |
44
- | enc_conv1b | 4.25 |
45
- | dec_conv1b | 3.80 |
46
- | dec_conv3a | 2.60 |
47
-
48
- ### WGSL FP32 Direct
49
-
50
- Profiled GPU total: 65.77 ms
51
-
52
- | Node | GPU ms |
53
- | --- | ---: |
54
- | dec_conv1a | 10.51 |
55
- | enc_conv1b | 9.26 |
56
- | dec_conv1b | 8.71 |
57
- | dec_conv2a | 6.99 |
58
- | enc_conv2b | 5.62 |
59
-
60
- ### WGSL FP16 Direct
61
-
62
- Profiled GPU total: 29.51 ms
63
-
64
- | Node | GPU ms |
65
- | --- | ---: |
66
- | dec_conv1a | 4.42 |
67
- | dec_conv1b | 3.82 |
68
- | enc_conv1b | 3.12 |
69
- | dec_conv2a | 2.97 |
70
- | dec_conv2b | 2.66 |
71
-
72
- ### WGSL FP16 Implicit GEMM
73
-
74
- Profiled GPU total: 29.74 ms
75
-
76
- | Node | GPU ms |
77
- | --- | ---: |
78
- | dec_conv1a | 6.22 |
79
- | dec_conv2a | 4.07 |
80
- | dec_conv1b | 2.94 |
81
- | enc_conv1b | 2.94 |
82
- | dec_conv3a | 1.90 |
83
-
84
- ### WGSL FP16 Spatial (experimental)
85
-
86
- Profiled GPU total: 64.84 ms
87
-
88
- | Node | GPU ms |
89
- | --- | ---: |
90
- | dec_conv1a | 23.73 |
91
- | dec_conv1b | 5.72 |
92
- | enc_conv1b | 5.44 |
93
- | enc_conv2b | 4.76 |
94
- | dec_conv2b | 4.30 |
95
-
96
- ### WGSL FP16 Subgroup (experimental)
97
-
98
- Profiled GPU total: 30.59 ms
99
-
100
- | Node | GPU ms |
101
- | --- | ---: |
102
- | dec_conv1a | 4.38 |
103
- | dec_conv1b | 4.07 |
104
- | enc_conv1b | 4.02 |
105
- | dec_conv2a | 3.04 |
106
- | dec_conv2b | 2.55 |
107
-
108
- ### WGSL INT8 weights / FP16 activations (experimental)
109
-
110
- Profiled GPU total: 100.74 ms
111
-
112
- | Node | GPU ms |
113
- | --- | ---: |
114
- | dec_conv1a | 19.51 |
115
- | dec_conv2a | 12.72 |
116
- | dec_conv1b | 11.86 |
117
- | enc_conv1b | 11.63 |
118
- | dec_conv2b | 6.59 |