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,369 +0,0 @@
1
- {
2
- "generatedAt": "2026-08-20T04:05:46.795Z",
3
- "currentCommit": "5d9c1c8771e2a03c90bfadafec4b5dd28fada446",
4
- "baselineCommit": "136c00c34aa5cf4561b4137034dbd643177f0a5f",
5
- "settings": {
6
- "width": 512,
7
- "height": 512,
8
- "tileSize": 512,
9
- "warmup": 1,
10
- "runs": 3,
11
- "model": "rt_hdr_calb_cnrm_large.tza",
12
- "gpuQueueCompletionIncluded": true
13
- },
14
- "browser": "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome",
15
- "adapter": {
16
- "vendor": "apple",
17
- "architecture": "metal-3",
18
- "device": "",
19
- "description": ""
20
- },
21
- "results": [
22
- {
23
- "label": "TFJS (136c00c)",
24
- "bundle": "baseline",
25
- "baseline": true,
26
- "initializationMs": 8,
27
- "timesMs": [
28
- 35.100000001490116,
29
- 34.899999998509884,
30
- 34.600000001490116
31
- ],
32
- "supportsFP16": true,
33
- "adapter": {
34
- "vendor": "apple",
35
- "architecture": "metal-3",
36
- "device": "",
37
- "description": ""
38
- },
39
- "summary": {
40
- "minMs": 34.600000001490116,
41
- "medianMs": 34.899999998509884,
42
- "meanMs": 34.86666666716337,
43
- "p95Ms": 35.100000001490116,
44
- "maxMs": 35.100000001490116
45
- },
46
- "messages": []
47
- },
48
- {
49
- "label": "WGSL FP32",
50
- "bundle": "current",
51
- "baseline": false,
52
- "precision": "fp32",
53
- "initializationMs": 357.20000000298023,
54
- "timesMs": [
55
- 41.100000001490116,
56
- 41.399999998509884,
57
- 41.20000000298023
58
- ],
59
- "executionProfile": {
60
- "totalMs": 40.651973000000005,
61
- "layers": [
62
- {
63
- "id": "input-pack",
64
- "durationMs": 0.050788
65
- },
66
- {
67
- "id": "enc_conv1a",
68
- "durationMs": 0.956607
69
- },
70
- {
71
- "id": "enc_conv1b",
72
- "durationMs": 4.502267
73
- },
74
- {
75
- "id": "pool1",
76
- "durationMs": 0.426224
77
- },
78
- {
79
- "id": "enc_conv2a",
80
- "durationMs": 1.667898
81
- },
82
- {
83
- "id": "enc_conv2b",
84
- "durationMs": 2.495847
85
- },
86
- {
87
- "id": "pool2",
88
- "durationMs": 0.055497
89
- },
90
- {
91
- "id": "enc_conv3a",
92
- "durationMs": 0.880279
93
- },
94
- {
95
- "id": "enc_conv3b",
96
- "durationMs": 1.160304
97
- },
98
- {
99
- "id": "pool3",
100
- "durationMs": 0.018082
101
- },
102
- {
103
- "id": "enc_conv4a",
104
- "durationMs": 0.479221
105
- },
106
- {
107
- "id": "enc_conv4b",
108
- "durationMs": 0.810326
109
- },
110
- {
111
- "id": "pool4",
112
- "durationMs": 0.008749
113
- },
114
- {
115
- "id": "enc_conv5a",
116
- "durationMs": 0.293148
117
- },
118
- {
119
- "id": "enc_conv5b",
120
- "durationMs": 0.386769
121
- },
122
- {
123
- "id": "dec_conv4a",
124
- "durationMs": 1.46241
125
- },
126
- {
127
- "id": "dec_conv4b",
128
- "durationMs": 0.717748
129
- },
130
- {
131
- "id": "dec_conv3a",
132
- "durationMs": 2.688002
133
- },
134
- {
135
- "id": "dec_conv3b",
136
- "durationMs": 1.164554
137
- },
138
- {
139
- "id": "dec_conv2a",
140
- "durationMs": 5.136021
141
- },
142
- {
143
- "id": "dec_conv2b",
144
- "durationMs": 2.505514
145
- },
146
- {
147
- "id": "dec_conv1a",
148
- "durationMs": 7.814439
149
- },
150
- {
151
- "id": "dec_conv1b",
152
- "durationMs": 4.486642
153
- },
154
- {
155
- "id": "dec_conv1c",
156
- "durationMs": 0.484637
157
- }
158
- ]
159
- },
160
- "runtimeInfo": {
161
- "configuredEngine": "wgsl",
162
- "gpuEngine": "wgsl",
163
- "precision": "fp32",
164
- "model": "oidn-unet-large-v1",
165
- "modelFamily": "oidn-unet-large",
166
- "inputChannels": 9,
167
- "dynamicTile": {
168
- "enabled": false,
169
- "currentTileSize": 512,
170
- "minTileSize": 256,
171
- "maxTileSize": 512,
172
- "targetTileTimeMs": 16
173
- },
174
- "lastExecution": {
175
- "width": 512,
176
- "height": 512,
177
- "tileWidth": 512,
178
- "tileHeight": 512,
179
- "tileCount": 1,
180
- "durationMs": 42.29999999701977,
181
- "tileTimeMs": {
182
- "min": 42.29999999701977,
183
- "median": 42.29999999701977,
184
- "mean": 42.29999999701977,
185
- "max": 42.29999999701977
186
- }
187
- }
188
- },
189
- "supportsFP16": true,
190
- "adapter": {
191
- "vendor": "apple",
192
- "architecture": "metal-3",
193
- "device": "",
194
- "description": ""
195
- },
196
- "summary": {
197
- "minMs": 41.100000001490116,
198
- "medianMs": 41.20000000298023,
199
- "meanMs": 41.233333334326744,
200
- "p95Ms": 41.399999998509884,
201
- "maxMs": 41.399999998509884
202
- },
203
- "messages": [],
204
- "validation": {
205
- "sampleCount": 6144,
206
- "meanAbsoluteError": 0.0000011096847932397698,
207
- "rootMeanSquaredError": 0.0000018071588418628667,
208
- "maxAbsoluteError": 0.000013589859008789062,
209
- "passed": true,
210
- "thresholds": {
211
- "maxMeanError": 0.0001,
212
- "maxAbsoluteError": 0.001
213
- }
214
- }
215
- },
216
- {
217
- "label": "WGSL FP16",
218
- "bundle": "current",
219
- "baseline": false,
220
- "precision": "fp16",
221
- "initializationMs": 22.600000001490116,
222
- "timesMs": [
223
- 34.899999998509884,
224
- 34.69999999552965,
225
- 34.900000005960464
226
- ],
227
- "executionProfile": {
228
- "totalMs": 34.102793999999996,
229
- "layers": [
230
- {
231
- "id": "input-pack",
232
- "durationMs": 0.04408
233
- },
234
- {
235
- "id": "enc_conv1a",
236
- "durationMs": 0.680458
237
- },
238
- {
239
- "id": "pool1",
240
- "durationMs": 3.923386
241
- },
242
- {
243
- "id": "enc_conv2a",
244
- "durationMs": 1.444079
245
- },
246
- {
247
- "id": "pool2",
248
- "durationMs": 2.233238
249
- },
250
- {
251
- "id": "enc_conv3a",
252
- "durationMs": 0.750372
253
- },
254
- {
255
- "id": "pool3",
256
- "durationMs": 0.913069
257
- },
258
- {
259
- "id": "enc_conv4a",
260
- "durationMs": 0.341854
261
- },
262
- {
263
- "id": "pool4",
264
- "durationMs": 0.588006
265
- },
266
- {
267
- "id": "enc_conv5a",
268
- "durationMs": 0.188779
269
- },
270
- {
271
- "id": "enc_conv5b",
272
- "durationMs": 0.243653
273
- },
274
- {
275
- "id": "dec_conv4a",
276
- "durationMs": 1.295171
277
- },
278
- {
279
- "id": "dec_conv4b",
280
- "durationMs": 0.525218
281
- },
282
- {
283
- "id": "dec_conv3a",
284
- "durationMs": 2.376688
285
- },
286
- {
287
- "id": "dec_conv3b",
288
- "durationMs": 0.926318
289
- },
290
- {
291
- "id": "dec_conv2a",
292
- "durationMs": 4.466269
293
- },
294
- {
295
- "id": "dec_conv2b",
296
- "durationMs": 2.298152
297
- },
298
- {
299
- "id": "dec_conv1a",
300
- "durationMs": 6.740256
301
- },
302
- {
303
- "id": "dec_conv1b",
304
- "durationMs": 3.891303
305
- },
306
- {
307
- "id": "dec_conv1c",
308
- "durationMs": 0.232445
309
- }
310
- ]
311
- },
312
- "runtimeInfo": {
313
- "configuredEngine": "wgsl",
314
- "gpuEngine": "wgsl",
315
- "precision": "fp16",
316
- "model": "oidn-unet-large-v1",
317
- "modelFamily": "oidn-unet-large",
318
- "inputChannels": 9,
319
- "dynamicTile": {
320
- "enabled": false,
321
- "currentTileSize": 512,
322
- "minTileSize": 256,
323
- "maxTileSize": 512,
324
- "targetTileTimeMs": 16
325
- },
326
- "lastExecution": {
327
- "width": 512,
328
- "height": 512,
329
- "tileWidth": 512,
330
- "tileHeight": 512,
331
- "tileCount": 1,
332
- "durationMs": 35.600000001490116,
333
- "tileTimeMs": {
334
- "min": 35.600000001490116,
335
- "median": 35.600000001490116,
336
- "mean": 35.600000001490116,
337
- "max": 35.600000001490116
338
- }
339
- }
340
- },
341
- "supportsFP16": true,
342
- "adapter": {
343
- "vendor": "apple",
344
- "architecture": "metal-3",
345
- "device": "",
346
- "description": ""
347
- },
348
- "summary": {
349
- "minMs": 34.69999999552965,
350
- "medianMs": 34.899999998509884,
351
- "meanMs": 34.833333333333336,
352
- "p95Ms": 34.900000005960464,
353
- "maxMs": 34.900000005960464
354
- },
355
- "messages": [],
356
- "validation": {
357
- "sampleCount": 6144,
358
- "meanAbsoluteError": 0.001123315547980989,
359
- "rootMeanSquaredError": 0.0017765941601853112,
360
- "maxAbsoluteError": 0.013010025024414062,
361
- "passed": true,
362
- "thresholds": {
363
- "maxMeanError": 0.005,
364
- "maxAbsoluteError": 0.05
365
- }
366
- }
367
- }
368
- ]
369
- }
@@ -1,47 +0,0 @@
1
- # oidn-web benchmark
2
-
3
- - Current: `5d9c1c8771e2a03c90bfadafec4b5dd28fada446`
4
- - TFJS baseline: `136c00c34aa5cf4561b4137034dbd643177f0a5f`
5
- - Input: 512x512, fixed tile 512, 3 runs after 1 warmup(s)
6
- - Adapter: apple
7
-
8
- | Runtime | Init ms | Median ms | P95 ms | Speedup | Precision |
9
- | --- | ---: | ---: | ---: | ---: | --- |
10
- | TFJS (136c00c) | 8.00 | 34.90 | 35.10 | 1.00x | fp32 |
11
- | WGSL FP32 | 357.20 | 41.20 | 41.40 | 0.85x | fp32 |
12
- | WGSL FP16 | 22.60 | 34.90 | 34.90 | 1.00x | fp16 |
13
-
14
- ## Output validation
15
-
16
- Compared against sampled TFJS FP32 output.
17
-
18
- | Runtime | Status | MAE | RMSE | Max error | Samples |
19
- | --- | --- | ---: | ---: | ---: | ---: |
20
- | WGSL FP32 | pass | 1.11e-6 | 1.81e-6 | 1.36e-5 | 6144 |
21
- | WGSL FP16 | pass | 1.12e-3 | 1.78e-3 | 1.30e-2 | 6144 |
22
-
23
- ## GPU hot layers
24
-
25
- ### WGSL FP32
26
-
27
- Profiled GPU total: 40.65 ms
28
-
29
- | Node | GPU ms |
30
- | --- | ---: |
31
- | dec_conv1a | 7.81 |
32
- | dec_conv2a | 5.14 |
33
- | enc_conv1b | 4.50 |
34
- | dec_conv1b | 4.49 |
35
- | dec_conv3a | 2.69 |
36
-
37
- ### WGSL FP16
38
-
39
- Profiled GPU total: 34.10 ms
40
-
41
- | Node | GPU ms |
42
- | --- | ---: |
43
- | dec_conv1a | 6.74 |
44
- | dec_conv2a | 4.47 |
45
- | pool1 | 3.92 |
46
- | dec_conv1b | 3.89 |
47
- | dec_conv3a | 2.38 |